]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Workaround for subgroup arithmetic failing on MoltenVK with AMD GPUs (issue 15846...
authorlksj92hs <redacted>
Tue, 9 Sep 2025 12:01:15 +0000 (15:01 +0300)
committerGitHub <redacted>
Tue, 9 Sep 2025 12:01:15 +0000 (14:01 +0200)
ggml/src/ggml-vulkan/ggml-vulkan.cpp

index f0fa9e668c1d2ce2625d321e3a789cbadfe837c9..6f130d47f2c921d28a62647cdd80aecc70ce1503 100644 (file)
@@ -3736,6 +3736,12 @@ static vk_device ggml_vk_get_device(size_t idx) {
 
         device->subgroup_arithmetic = (vk11_props.subgroupSupportedStages & vk::ShaderStageFlagBits::eCompute) &&
                                       (vk11_props.subgroupSupportedOperations & vk::SubgroupFeatureFlagBits::eArithmetic);
+#ifdef __APPLE__
+        // Workaround for subgroup arithmetic failing on MoltenVK with AMD GPUs (issue 15846)
+        if (device->vendor_id == VK_VENDOR_ID_AMD) {
+            device->subgroup_arithmetic = false;
+        }
+#endif
         device->subgroup_shuffle = (vk11_props.subgroupSupportedStages & vk::ShaderStageFlagBits::eCompute) &&
                                    (vk11_props.subgroupSupportedOperations & vk::SubgroupFeatureFlagBits::eShuffle);
         device->subgroup_clustered = (vk11_props.subgroupSupportedStages & vk::ShaderStageFlagBits::eCompute) &&