Skip to content

Commit 5a69c97

Browse files
authored
vulkan: check coopmat2 features before reporting support (#24186)
1 parent 5343f45 commit 5a69c97

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6349,6 +6349,15 @@ static void ggml_vk_print_gpu_info(size_t idx) {
63496349
}
63506350
#endif
63516351

6352+
#if defined(VK_NV_cooperative_matrix2)
6353+
VkPhysicalDeviceCooperativeMatrix2FeaturesNV coopmat2_features {};
6354+
coopmat2_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_2_FEATURES_NV;
6355+
if (coopmat2_support) {
6356+
last_struct->pNext = (VkBaseOutStructure *)&coopmat2_features;
6357+
last_struct = (VkBaseOutStructure *)&coopmat2_features;
6358+
}
6359+
#endif
6360+
63526361
VkPhysicalDeviceCooperativeMatrixDecodeVectorFeaturesNV coopmat2_decode_vector_features {};
63536362
coopmat2_decode_vector_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_DECODE_VECTOR_FEATURES_NV;
63546363
if (coopmat2_decode_vector_support) {
@@ -6380,6 +6389,19 @@ static void ggml_vk_print_gpu_info(size_t idx) {
63806389
#endif
63816390
&& ggml_vk_khr_cooperative_matrix_support(props2.properties, driver_props, device_architecture);
63826391

6392+
#if defined(VK_NV_cooperative_matrix2) && defined(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
6393+
coopmat2_support = coopmat2_support &&
6394+
coopmat2_features.cooperativeMatrixWorkgroupScope &&
6395+
coopmat2_features.cooperativeMatrixFlexibleDimensions &&
6396+
coopmat2_features.cooperativeMatrixReductions &&
6397+
coopmat2_features.cooperativeMatrixConversions &&
6398+
coopmat2_features.cooperativeMatrixPerElementOperations &&
6399+
coopmat2_features.cooperativeMatrixTensorAddressing &&
6400+
coopmat2_features.cooperativeMatrixBlockLoads;
6401+
#else
6402+
coopmat2_support = false;
6403+
#endif
6404+
63836405
coopmat2_decode_vector_support = coopmat2_decode_vector_support && coopmat2_decode_vector_features.cooperativeMatrixDecodeVector;
63846406
#if !defined(GGML_VULKAN_COOPMAT2_DECODE_VECTOR_GLSLC_SUPPORT)
63856407
coopmat2_decode_vector_support = false;

0 commit comments

Comments
 (0)