karli-sjoberg / gswitch

BSD 3-Clause "New" or "Revised" License
91 stars 14 forks source link

vulkan ICD loader error when egpu not plugged in. Service to disable egpu's /usr/share/vulkan/icd.d/<driver>_icd.json upon unplugging? #19

Closed minerscale closed 1 month ago

minerscale commented 9 months ago

Hi!

Sometimes when vulkan loads up I get an error due to it trying to load the nvidia driver but it doesn't exist. This happens when my egpu is not plugged in. A feature which disables the json file while the egpu is not plugged in could be a solution to the issue. In the end it's just an error but apparently it can increase load times while it attempts to load using the wrong driver. (I haven't measured how much it is for me but it's not much. But the reddit thread linked below seems to imply that it could be longer. Either way vulkan shouldn't even have access to try to load a gpu which doesn't exist anyway. So I think it would be wise to disable this file too.

loader_scanned_icd_add: Could not get 'vkCreateInstance' via 'vk_icdGetInstanceProcAddr' for ICD libGLX_nvidia.so.0

Here is a similar report here: https://www.reddit.com/r/Fedora/comments/1690iqv/vulkan_icd_loader_trying_to_load_egpu_driver_when/

Thanks very much, Aaron.

karli-sjoberg commented 9 months ago

Hey dude! Are you using the proprietary NVIDIA driver?

minerscale commented 9 months ago

Hi Karli,

Oops, that would have been helpful. Yes, I am using the nvidia proprietary drivers.

This issue is frankly quite niche as I am only running into it while using the vulkan validation layers. But it nonetheless seems reasonable to me that applications shouldn't even try to search for drivers which don't exist.

Thanks, Aaron.

karli-sjoberg commented 9 months ago

And what distro are you using? Because I'm also using the proprietary driver and it provides vulkan support built in to the driver so there is no need to have that file on disk.

minerscale commented 9 months ago

Oh I use Arch (btw).

nvidia_icd.json points to libGLX_nvidia.so.0

karli-sjoberg commented 9 months ago

Could you please run this command for me? I'm just curious which package that file comes from and if it's even necessary for you: pacman -Qo /usr/share/vulkan/icd.d/nvidia_icd.json