Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent loader device ordering #781

Merged
merged 1 commit into from
Jan 12, 2022
Merged

Consistent loader device ordering #781

merged 1 commit into from
Jan 12, 2022

Conversation

MarkY-LunarG
Copy link
Collaborator

The loader ICD ordering could be random on Linux based on using readdir
to find ICD manifest files. This can result in random behaviors as
applications that select only the first device can switch which device is
used. To resolve this, we now sort based on device type and then
internally to the types based on PCI bus information.

This also introduces a VK_LOADER_DEFAULT_DEVICE environment variable
that can be used to force a specific PCI device. This environment variable
is actually a duplicate of the MESA_VK_DEVICE_SELECT variable, which is
also looked for if the loader environment variable is not found.

Note, that at least one ICD must support it for the extension to be used at all.
So we only do the sorting if one ICD supports it.

Fixes part of #657

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 10473.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 932 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 932 passed.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 10485.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 933 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 933 passed.

Copy link
Collaborator

@charles-lunarg charles-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main comment|concern is the semantics of the env-vars being added. Code wise, nothing major save for some nit picks. Also need to add documentations for the new env-vars being added.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 11329.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 936 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 936 passed.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 12266.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 942 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 942 passed.

The loader ICD ordering could be random on Linux based on using readdir
to find ICD manifest files.  This can result in random behaviors as
applications that select only the first device can switch which device is
used.  To resolve this, we now sort based on device type and then
internally to the types based on PCI bus information.

This also introduces a VK_LOADER_DEFAULT_DEVICE environment variable
that can be used to force a specific PCI device.  This environment variable
is actually a duplicate of the MESA_VK_DEVICE_SELECT variable, which is
also looked for if the loader environment variable is not found.

Note, that at least one ICD must support it for the extension to be used at all.
So we only do the sorting if one ICD supports it.

Fixes part of #657
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 15510.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 952 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 952 passed.

@MarkY-LunarG MarkY-LunarG merged commit cbe28ac into KhronosGroup:master Jan 12, 2022
@MarkY-LunarG MarkY-LunarG deleted the linux_consistent_sort branch January 12, 2022 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants