#!/usr/bin/bash # RUN AS ROOT # Generates a .json file, just in case the Vulkan stops working on NVIDIA GPU due to the missing file # This solved the issue when I couldn't play my games that rely on Vulkan (i.e. Windows games on Steam) # Source: https://twitter.com/Terry_Hendrix/status/1067506733868666880 cd /usr/share/vulkan/icd.d/ touch nvidia_icd.json a=`vulkaninfo | grep "Vulkan Instance Version"` inarr=(${a}) vulkan_ver=${inarr[3]} echo "{" > nvidia_icd.json echo -e "\t\"file_format_version\":\"1.0.0\"," >> nvidia_icd.json echo -e "\t\"ICD\": {" >> nvidia_icd.json echo -e "\t\t\"library_path\":\"libGLX_nvidia.so.0\"," >> nvidia_icd.json echo -e "\t\t\"api_version\":\"$vulkan_ver\"" >> nvidia_icd.json echo -e "\t\"" >> nvidia_icd.json echo "}" >> nvidia_icd.json