]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml:fix finding transfer queue family index error (llama/6094)
authorGainLee <redacted>
Sun, 17 Mar 2024 17:12:22 +0000 (01:12 +0800)
committerGeorgi Gerganov <redacted>
Wed, 27 Mar 2024 11:20:00 +0000 (13:20 +0200)
Co-authored-by: GainLee <redacted>
src/ggml-vulkan.cpp

index 7cce616ba714fd6ca5ceb591365fcce32fe1f1f7..698b31496f417e63609be25e1d1e26551b4cde00 100644 (file)
@@ -710,6 +710,12 @@ static uint32_t ggml_vk_find_queue_family_index(std::vector<vk::QueueFamilyPrope
         }
     }
 
+    // All commands that are allowed on a queue that supports transfer operations are also allowed on a queue that supports either graphics or compute operations.
+    // Thus, if the capabilities of a queue family include VK_QUEUE_GRAPHICS_BIT or VK_QUEUE_COMPUTE_BIT, then reporting the VK_QUEUE_TRANSFER_BIT capability separately for that queue family is optional.
+    if (compute_index >= 0) {
+        return compute_index;
+    }
+
     std::cerr << "ggml_vulkan: No suitable queue family index found." << std::endl;
 
     for(auto &q_family : queue_family_props) {