Skip to content

Improve device UUID filtering logic - #4956

Merged
doitsujin merged 12 commits into
doitsujin:masterfrom
gilvbp:filter-uuid
May 30, 2025
Merged

doitsujin merged 12 commits into
doitsujin:masterfrom
gilvbp:filter-uuid

Conversation

@gilvbp

@gilvbp gilvbp commented May 30, 2025 •

Copy link
Copy Markdown
Contributor

This is a replacement for PR #2408.

In relation to #2036.

This PR improves and corrects the UUID filtering logic in DxvkDeviceFilter,
ensuring proper selection based on Vulkan deviceUUID. It also prevents memory
leaks by cleaning up rejected adapters and simplifies the adapter query logic.

Closes #2408.

@doitsujin

Copy link
Copy Markdown
Owner

is there any reason why this changes the indentation of the entire file?

@gilvbp

gilvbp commented May 30, 2025

Copy link
Copy Markdown
Contributor Author

It's my IDE (CLION). I'll fix it. Sorry.

@Blisto91

Blisto91 commented May 30, 2025 •

Copy link
Copy Markdown
Collaborator

Since device UUID's aren't guaranteed to be unique I don't think this is good as a general solution. Even if it helped in your case.
#2036 (comment)

Edit: actually I see now that the example shown is unique so maybe that isn't true ? Then it would be fine I guess.

@gilvbp

gilvbp commented May 30, 2025 •

Copy link
Copy Markdown
Contributor Author

Since device UUID's aren't guaranteed to be unique I don't think this is good as a general solution. Even if it helped in your case.
#2036 (comment)

Edit: actually I see now that the example shown is unique so maybe that isn't true ? Then it would be fine I guess.

"Implementations should return deviceUUID values which are likely to be unique even in the presence of multiple Vulkan implementations (such as a GPU driver and a software renderer; two drivers for different GPUs; or the same Vulkan driver running on two logically different devices)."

Reference: https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceIDProperties.html?utm_source=chatgpt.com

So. Yes, there are unique.

@WinterSnowfall

Copy link
Copy Markdown
Contributor

Since device UUID's aren't guaranteed to be unique I don't think this is good as a general solution.

I don't think they're guaranteed to be unique across the entire population of cards and vendors, however the odds of someone having two cards with the same UUID in the same system should be quite astronomical. At least that's the gist I'm getting from the documentation.

@gilvbp

gilvbp commented May 30, 2025

Copy link
Copy Markdown
Contributor Author

Indentation has been fixed now, @doitsujin. Let me know if anything else needs adjustment.

@doitsujin doitsujin left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Just a nit now.

I will likely refactor this whole area in the near future so we can skip devices that don't support the required feature set beyond just the core Vulkan version, but in the meantime this will do.

Comment thread src/dxvk/dxvk_instance.cpp Outdated
Comment thread src/dxvk/dxvk_device_filter.cpp Outdated
@doitsujin
doitsujin merged commit 1e64bb8 into doitsujin:master May 30, 2025
@gilvbp
gilvbp deleted the filter-uuid branch June 2, 2025 12:12
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.

4 participants