-
Notifications
You must be signed in to change notification settings - Fork 13.5k
vulkan: deduplicate Microsoft Direct3D12 devices #16689
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
Conversation
… from the `vulkan-dozen` driver
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 good otherwise. I can't test it.
ggml/src/ggml-vulkan/ggml-vulkan.cpp
Outdated
| return std::equal(std::begin(old_id.deviceUUID), std::end(old_id.deviceUUID), std::begin(new_id.deviceUUID)); | ||
|
|
||
| bool equals = std::equal(std::begin(old_id.deviceUUID), std::end(old_id.deviceUUID), std::begin(new_id.deviceUUID)); | ||
| equals |= old_id.deviceLUIDValid && new_id.deviceLUIDValid && |
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.
|= is a bitwise or, please use a logical or.
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.
Done
* fix: deduplicate and deprioritize Microsoft Direct3D12 vulkan devices from the `vulkan-dozen` driver * style: indent * fix: decrease priority * fix: switch to `||`
* fix: deduplicate and deprioritize Microsoft Direct3D12 vulkan devices from the `vulkan-dozen` driver * style: indent * fix: decrease priority * fix: switch to `||`
A Microsoft Direct3D12 device appears on some Windows machines, which comes from the Microsoft Dozen (Dzn) Vulkan driver that is built on top of Direct3D 12.
This PR fixes an issue where sometimes both the native device entry and the Direct3D12 device entry are picked up by llama.cpp, and since both point to the same underlying device, after using all the memory of the first device, buffer allocations on the second will always fail.
When a native Vulkan driver is already available for a given device, we now prioritize it over the Dozen driver for reduced overhead.
I found a note on VulkanHub about the Direct3D12 device that was helpful in figuring this out.
Before
After