-
Notifications
You must be signed in to change notification settings - Fork 315
Description
Describe the bug
On a system with multiple Vulkan drivers and multiple ICD files, the documentation specifies the loading order.
As an example, it would pick first the driver manifest from /etc/vulkan/icd.d (say driver1.json), then the one from /usr/share/vulkan/icd.d (driver2.json).
Then using VK_LOADER_DEBUG=info, I can see that:
driver1is loaded first, thendriver2- but in the
Original orderandSorted orderlogs,driver2comes first, thendriver1and so applications usedriver2.
AFAICT this is caused by loader_icd_add that will prepend newly found drivers to the list of drivers.
The sort step in loader_linux.c doesn't change the order of the 2 drivers - which is expected because the sort is mostly based on the PCI bus information and in my test case both drivers expose the same GPU.
Is this the expected behavior? Or should apps end up using driver1 because its "Search Order" is smaller than driver2's?
Additional Information
Tweaking the loader_icd_add function to append newly found driver fixes the issue.