Skip to content

Commit c10ed6c

Browse files
authored
vulkan: Disable coopmat/coopmat2/bfloat extensions if glslc doesn't support it (#13696)
1 parent a127ff1 commit c10ed6c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,23 +2804,29 @@ static vk_device ggml_vk_get_device(size_t idx) {
28042804
pipeline_robustness = true;
28052805
} else if (strcmp("VK_EXT_subgroup_size_control", properties.extensionName) == 0) {
28062806
device->subgroup_size_control = true;
2807+
#if defined(GGML_VULKAN_COOPMAT_GLSLC_SUPPORT)
28072808
} else if (strcmp("VK_KHR_cooperative_matrix", properties.extensionName) == 0 &&
28082809
!getenv("GGML_VK_DISABLE_COOPMAT")) {
28092810
device->coopmat_support = true;
28102811
device->coopmat_m = 0;
28112812
device->coopmat_n = 0;
28122813
device->coopmat_k = 0;
2814+
#endif
2815+
#if defined(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
28132816
} else if (strcmp("VK_NV_cooperative_matrix2", properties.extensionName) == 0 &&
28142817
!getenv("GGML_VK_DISABLE_COOPMAT2")) {
28152818
coopmat2_support = true;
2819+
#endif
28162820
#if defined(GGML_VULKAN_INTEGER_DOT_GLSLC_SUPPORT)
28172821
} else if (strcmp("VK_KHR_shader_integer_dot_product", properties.extensionName) == 0 &&
28182822
!getenv("GGML_VK_DISABLE_INTEGER_DOT_PRODUCT")) {
28192823
device->integer_dot_product = true;
28202824
#endif
2825+
#if defined(GGML_VULKAN_BFLOAT16_GLSLC_SUPPORT)
28212826
} else if (strcmp("VK_KHR_shader_bfloat16", properties.extensionName) == 0 &&
28222827
!getenv("GGML_VK_DISABLE_BFLOAT16")) {
28232828
bfloat16_support = true;
2829+
#endif
28242830
}
28252831
}
28262832

0 commit comments

Comments
 (0)