Skip to content

Instantly share code, notes, and snippets.

@YamiYukiSenpai
Last active August 23, 2020 20:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YamiYukiSenpai/649d953015c7492e52e1268f0c6b8ec2 to your computer and use it in GitHub Desktop.
Save YamiYukiSenpai/649d953015c7492e52e1268f0c6b8ec2 to your computer and use it in GitHub Desktop.
Generates a .json file, just in case the Vulkan stops working on NVIDIA GPU due to the missing file
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment