Skip to content

Conversation

tychedelia
Copy link
Collaborator

Setting up some test infrastructure, and it's a bit frustrating not to be able to select a given adapter by a stable identifier when multiple GPUs with the same vendor id exist.

Adds the PCI bus id and device uuid to AdapterInfo on Vulkan.

@cwfitzgerald
Copy link
Member

If you wouldn't mind, it shouldn't be hard to wire up these in d3d via https://learn.microsoft.com/en-us/windows/win32/api/dxgi/ns-dxgi-dxgi_adapter_desc which has all this info.

If you're feeling extra crazy, you could also wire this up on GL via https://registry.khronos.org/OpenGL/extensions/EXT/EXT_external_objects.txt, but not touching that one is also understandable lol.

@jimblandy
Copy link
Member

@tychedelia Can you clear up the CI failures? We generally don't start reviewing PRs until CI likes them.

@tychedelia
Copy link
Collaborator Author

@tychedelia Can you clear up the CI failures? We generally don't start reviewing PRs until CI likes them.

Yes, apologies was just (slowly) doing @cwfitzgerald's suggestion.

I've removed Uuid as there doesn't appear a way to do this in the Windows API. But the bus ID is sufficient for a stable identifier and probably more useful anyway.

@cwfitzgerald
Copy link
Member

cwfitzgerald commented Oct 8, 2025

Is the Luid in the adapter info not the same? I thought that was how you matched devices when doing cross api interop.

@tychedelia
Copy link
Collaborator Author

Is the Luid in the adapter info not the same? I thought that was how you matched devices when doing cross api interop.

I am not super familiar with these APIs but the docs here suggest it's not valid across restarts, which limits its usefullness relative to the Uuid provided by Vulkan.

https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-getadapterluid

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