@@ -1513,7 +1513,7 @@ static void ggml_vk_load_shaders(vk_device& device) {
1513
1513
compiles.push_back (std::async (ggml_vk_create_pipeline_func, std::ref (device), std::ref (pipeline), name, spv_size, spv_data, entrypoint, parameter_count, push_constant_size, wg_denoms, specialization_constants, align, disable_robustness));
1514
1514
};
1515
1515
1516
- #if defined(VK_NV_cooperative_matrix2)
1516
+ #if defined(VK_NV_cooperative_matrix2) && defined(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
1517
1517
if (device->coopmat2 ) {
1518
1518
1519
1519
auto const &fa_wg_denoms = [&](uint32_t D, uint32_t clamp, ggml_type type, bool small_rows) -> std::array<uint32_t , 3 > {
@@ -1611,7 +1611,7 @@ static void ggml_vk_load_shaders(vk_device& device) {
1611
1611
#undef CREATE_MM
1612
1612
#undef CREATE_MM2
1613
1613
} else
1614
- #endif // defined(VK_NV_cooperative_matrix2)
1614
+ #endif // defined(VK_NV_cooperative_matrix2) && defined(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
1615
1615
if (device->coopmat_support ) {
1616
1616
// Create 6 variants, {s,m,l}x{unaligned,aligned}
1617
1617
#define CREATE_MM (PIPELINE_NAME, NAMELC, F16ACC, WG_DENOMS, WARPTILE, PUSHCONST, PARAMCOUNT, ID ) \
@@ -2153,7 +2153,7 @@ static vk_device ggml_vk_get_device(size_t idx) {
2153
2153
device->coopmat_support = device->coopmat_support && coopmat_features.cooperativeMatrix ;
2154
2154
2155
2155
if (coopmat2_support) {
2156
- #if defined(VK_NV_cooperative_matrix2)
2156
+ #if defined(VK_NV_cooperative_matrix2) && defined(GGML_VULKAN_COOPMAT2_GLSLC_SUPPORT)
2157
2157
if (coopmat2_features.cooperativeMatrixWorkgroupScope &&
2158
2158
coopmat2_features.cooperativeMatrixFlexibleDimensions &&
2159
2159
coopmat2_features.cooperativeMatrixReductions &&
@@ -2414,14 +2414,19 @@ static void ggml_vk_print_gpu_info(size_t idx) {
2414
2414
bool fp16_storage = false ;
2415
2415
bool fp16_compute = false ;
2416
2416
bool coopmat_support = false ;
2417
+ bool coopmat2_support = false ;
2417
2418
2418
2419
for (auto properties : ext_props) {
2419
2420
if (strcmp (" VK_KHR_16bit_storage" , properties.extensionName ) == 0 ) {
2420
2421
fp16_storage = true ;
2421
2422
} else if (strcmp (" VK_KHR_shader_float16_int8" , properties.extensionName ) == 0 ) {
2422
2423
fp16_compute = true ;
2423
- } else if (strcmp (" VK_KHR_cooperative_matrix" , properties.extensionName ) == 0 ) {
2424
+ } else if (strcmp (" VK_KHR_cooperative_matrix" , properties.extensionName ) == 0 &&
2425
+ !getenv (" GGML_VK_DISABLE_COOPMAT" )) {
2424
2426
coopmat_support = true ;
2427
+ } else if (strcmp (" VK_NV_cooperative_matrix2" , properties.extensionName ) == 0 &&
2428
+ !getenv (" GGML_VK_DISABLE_COOPMAT2" )) {
2429
+ coopmat2_support = true ;
2425
2430
}
2426
2431
}
2427
2432
@@ -2472,9 +2477,11 @@ static void ggml_vk_print_gpu_info(size_t idx) {
2472
2477
2473
2478
coopmat_support = coopmat_support && coopmat_features.cooperativeMatrix ;
2474
2479
2480
+ std::string matrix_cores = coopmat2_support ? " NV_coopmat2" : coopmat_support ? " KHR_coopmat" : " none" ;
2481
+
2475
2482
std::string device_name = props2.properties .deviceName .data ();
2476
- GGML_LOG_DEBUG (" ggml_vulkan: %zu = %s (%s) | uma: %d | fp16: %d | warp size: %zu | matrix cores: %d \n " ,
2477
- idx, device_name.c_str (), driver_props.driverName .data (), uma, fp16, subgroup_size, coopmat_support );
2483
+ GGML_LOG_DEBUG (" ggml_vulkan: %zu = %s (%s) | uma: %d | fp16: %d | warp size: %zu | matrix cores: %s \n " ,
2484
+ idx, device_name.c_str (), driver_props.driverName .data (), uma, fp16, subgroup_size, matrix_cores. c_str () );
2478
2485
2479
2486
if (props2.properties .deviceType == vk::PhysicalDeviceType::eCpu) {
2480
2487
GGML_LOG_DEBUG (" ggml_vulkan: Warning: Device type is CPU. This is probably not the device you want.\n " );
0 commit comments