From 0e1a75fd8ab227cc24858673eaa8c4bb1c44455b Mon Sep 17 00:00:00 2001 From: "Michal J. Gajda" Date: Tue, 21 Apr 2026 13:29:47 +0200 Subject: [PATCH] Manager: prefer compute-only queue family and set priority to 0.0f On iGPUs (e.g. AMD Radeon 890M) the first queue family reports both compute and graphics, so the naive linear scan binds Kompute to the graphics ring and long compute dispatches freeze the desktop. Try a compute-only family first; fall back to the old behaviour if none exists. Also lower the queue priority from 1.0f to 0.0f so shared families don't starve interactive workloads. Fixes #458. --- src/Manager.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Manager.cpp b/src/Manager.cpp index b5facd0c..cfcfd8a7 100644 --- a/src/Manager.cpp +++ b/src/Manager.cpp @@ -380,16 +380,14 @@ Manager::createDevice(const std::vector& familyQueueIndices, uint32_t computeQueueFamilyIndex = 0; bool computeQueueSupported = false; + // Pick the first compute-capable family, preferring one without + // graphics so long dispatches don't stall the desktop on iGPUs. for (uint32_t i = 0; i < allQueueFamilyProperties.size(); i++) { - vk::QueueFamilyProperties queueFamilyProperties = - allQueueFamilyProperties[i]; - - if (queueFamilyProperties.queueFlags & - vk::QueueFlagBits::eCompute) { - computeQueueFamilyIndex = i; - computeQueueSupported = true; - break; - } + auto flags = allQueueFamilyProperties[i].queueFlags; + if (!(flags & vk::QueueFlagBits::eCompute)) continue; + computeQueueFamilyIndex = i; + computeQueueSupported = true; + if (!(flags & vk::QueueFlagBits::eGraphics)) break; } if (!computeQueueSupported) { @@ -421,7 +419,7 @@ Manager::createDevice(const std::vector& familyQueueIndices, std::unordered_map> familyQueuePriorities; for (const auto& value : this->mComputeQueueFamilyIndices) { familyQueueCounts[value]++; - familyQueuePriorities[value].push_back(1.0f); + familyQueuePriorities[value].push_back(0.0f); } std::unordered_map familyQueueIndexCount;