nix-community/nixGL

nixVulkanNvidia doesn't allow the vulkan-loader to find the vulkan icd files

expipiplus1 opened this issue · 5 comments

setting VK_ICD_FILENAMES to the icd json file in the driver derivation allows things to work. But I think it would be better to append to XDG_Whatever_it_is to allow the wrapped program to find this file more naturally.

@expipiplus1 could you do a PR for that? I'll approve it if it looks sane. I unfortunately have no idea about the vulkan environment, and no idea on how to test it.

@guibou Unfortunately I'm not sure setting that var is actually the correct thing to do as it will prevent the loader finding system icd files

This need is met with the use of the "VK_ICD_FILENAMES" environment variable, which will override the mechanism used for finding system-installed ICDs. In other words, only the ICDs listed in "VK_ICD_FILENAMES" will be used.

I think it's probably better than not setting it. The other alternatives would be

  • patching the loader to also look in a NIX_VK_ICD_FILENAME_PATHS
  • performing the icd resolution in the wrapper and passing that as well as the new icd to the loader in VK_ICD_FILENAMES

Obviously it's very undesirable to put heaps of functionality in these wrapper programs

I'm closing because of #35. Tell me if you think there is still work to do.