From 69356fd6251418cf19dc73bcd0bdc114f02bffc6 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Thu, 4 Sep 2025 13:30:39 +0100 Subject: [PATCH] vulkan: enumerate all non-CPU devices always, instead of only when missing a discrete GPU Previously, integrated GPUs were only enumerated as a fallback when no discrete GPUs were found. This change always enumerates all non-CPU Vulkan devices, allowing users to see and select from both integrated and discrete GPUs when both are present. Users retain full control via GGML_VK_VISIBLE_DEVICES environment variable. --- ggml/src/ggml-vulkan/ggml-vulkan.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index cd1c66ba7b4..a50e983805b 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -4462,12 +4462,10 @@ static void ggml_vk_instance_init() { // If no dedicated GPUs found, fall back to the first non-CPU device. // If only CPU devices are available, return without devices. - if (vk_instance.device_indices.empty()) { - for (size_t i = 0; i < devices.size(); i++) { - if (devices[i].getProperties().deviceType != vk::PhysicalDeviceType::eCpu) { - vk_instance.device_indices.push_back(i); - break; - } + for (size_t i = 0; i < devices.size(); i++) { + if (devices[i].getProperties().deviceType != vk::PhysicalDeviceType::eCpu) { + vk_instance.device_indices.push_back(i); + break; } }