-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add pci bus and device uuid to AdapterInfo
#8290
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
base: trunk
Are you sure you want to change the base?
Conversation
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. |
@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. |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code's fine and we can land. So the purpose of this is to differentiate between multiple cards on the same machine, across backends?
} | ||
} | ||
|
||
fn get_adapter_pci_info(vendor_id: u32, device_id: u32) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How the hell did you figure out how to do this lmao
"dep:range-alloc", | ||
"dep:windows-core", | ||
"dep:gpu-allocator", | ||
"gpu-allocator/d3d12", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kpreid is this a problem for feature sets? I'm never quite sure how implicit features work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh hmm, i may have resolved a merge conflict incorrectly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it — this line should be dropped. It would not hurt but it would not have any effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm never quite sure how implicit features work.
The rule is that if
- a dependency is optional, and
- not mentioned using
dep:
syntax anywhere in[features]
,
then it gets an implicit feature. (When RFC 3491 is implemented in a future edition, implicit features will no longer be created and this will be an error.)
Yeah so the immediate thing is that I'm trying to set up benchmarking for bevy on my build server, but I need a way to have a stable reference to a particular card when I'm spawning docker containers. Iteration order alone probably would work for this but it's also important longer term for some media server/installation things that use multiple cards that you for sure know you are getting the physical outputs for cards plugged into a certain slot. |
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.