Skip to content

Linux ICD ordering doesn't match the documentation #1725

@peppsac

Description

@peppsac

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:

  • driver1 is loaded first, then driver2
  • but in the Original order and Sorted order logs, driver2 comes first, then driver1 and so applications use driver2.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions