Skip to content

Commit 72f2d95

Browse files
giladgdpwilkin
authored andcommitted
vulkan: deduplicate Microsoft Direct3D12 devices (ggml-org#16689)
* fix: deduplicate and deprioritize Microsoft Direct3D12 vulkan devices from the `vulkan-dozen` driver * style: indent * fix: decrease priority * fix: switch to `||`
1 parent 9681b44 commit 72f2d95

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4733,7 +4733,14 @@ static void ggml_vk_instance_init() {
47334733
vk::PhysicalDeviceIDProperties old_id;
47344734
old_props.pNext = &old_id;
47354735
devices[k].getProperties2(&old_props);
4736-
return std::equal(std::begin(old_id.deviceUUID), std::end(old_id.deviceUUID), std::begin(new_id.deviceUUID));
4736+
4737+
bool equals = std::equal(std::begin(old_id.deviceUUID), std::end(old_id.deviceUUID), std::begin(new_id.deviceUUID));
4738+
equals = equals || (
4739+
old_id.deviceLUIDValid && new_id.deviceLUIDValid &&
4740+
std::equal(std::begin(old_id.deviceLUID), std::end(old_id.deviceLUID), std::begin(new_id.deviceLUID))
4741+
);
4742+
4743+
return equals;
47374744
}
47384745
);
47394746
if (old_device == vk_instance.device_indices.end()) {
@@ -4771,6 +4778,7 @@ static void ggml_vk_instance_init() {
47714778
#endif
47724779
break;
47734780
}
4781+
driver_priorities[vk::DriverId::eMesaDozen] = 100;
47744782

47754783
if (driver_priorities.count(old_driver.driverID)) {
47764784
old_priority = driver_priorities[old_driver.driverID];

0 commit comments

Comments
 (0)