Skip to content

Compile bug: MinGW32_64 Vulkan Shader #13419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DickyQi opened this issue May 10, 2025 · 6 comments
Closed

Compile bug: MinGW32_64 Vulkan Shader #13419

DickyQi opened this issue May 10, 2025 · 6 comments

Comments

@DickyQi
Copy link

DickyQi commented May 10, 2025

Git commit

611aa91

Operating systems

Windows

GGML backends

Vulkan

Problem description & steps to reproduce

vscode build for Windows, base on msys2+mingw

mingw-w64-x86_64-vulkan-headers 1.4.313.0-1
mingw-w64-x86_64-vulkan-loader 1.4.313.0-1
mingw-w64-x86_64-spirv-cross 11.4.313.0-1
mingw-w64-x86_64-spirv-headers 2
1.4.313.0-1
mingw-w64-x86_64-spirv-tools 3~1.4.313.0-1
mingw-w64-x86_64-glslang 15.2.0-2
mingw-w64-x86_64-clang 20.1.3-1
mingw-w64-x86_64-clang-libs 20.1.3-1
mingw-w64-x86_64-cmake 4.0.2-1

First Bad Commit

No response

Compile command

cmake ..

Relevant log output

[build] cannot compile get_rows_iq1_m_f32
[build] 
[build] C:/msys64/mingw64/bin/glslc.exe -fshader-stage=compute --target-env=vulkan1.2 -O "ggml/src/ggml-vulkan/vulkan-shaders/get_rows_quant.comp" -o "build_win/ggml/src/ggml-vulkan/vulkan-shaders.spv/get_rows_iq1_m_f32.spv" -DB_TYPE=int -DDATA_A_IQ1_M=1 -DD_TYPE=float -DFLOAT_TYPE=float 
[build] 
[build] shaderc: internal error: compilation succeeded but failed to optimize: [VUID-StandaloneSpirv-None-10684] Invalid explicit layout decorations on type for operand '1230[%1230]'
[build]   %scales = OpVariable %_ptr_Function__arr_ushort_uint_4 Function
[build] 
[build] 
[build] 
[build] cannot compile get_rows_iq1_m
[build] 
[build] C:/msys64/mingw64/bin/glslc.exe -fshader-stage=compute --target-env=vulkan1.2 -O "ggml/src/ggml-vulkan/vulkan-shaders/get_rows_quant.comp" -o "build_win/ggml/src/ggml-vulkan/vulkan-shaders.spv/get_rows_iq1_m.spv" -DB_TYPE=int -DDATA_A_IQ1_M=1 -DD_TYPE=float16_t -DFLOAT_TYPE=float 
[build] 
[build] shaderc: internal error: compilation succeeded but failed to optimize: [VUID-StandaloneSpirv-None-10684] Invalid explicit layout decorations on type for operand '1230[%1230]'
[build]   %scales = OpVariable %_ptr_Function__arr_ushort_uint_4 Function
[build] 
[build] 
[build] 

[build] ggml\src\ggml-vulkan\ggml-vulkan.cpp:2471:103: error: use of undeclared identifier 'get_rows_iq1_m_len'; did you mean 'get_rows_iq1_s_len'?
[build]  2471 |     ggml_vk_create_pipeline(device, device->pipeline_get_rows[GGML_TYPE_IQ1_M],   "get_rows_iq1_m",   get_rows_iq1_m_len,   get_rows_iq1_m_data,   "main", 3, sizeof(vk_op_binary_push_constants), {1024, 1, 1}, {}, 1);
[build]       |                                                                                                       ^~~~~~~~~~~~~~~~~~
[build]       |                                                                                                       get_rows_iq1_s_len
[build] ggml/src/ggml-vulkan/ggml-vulkan-shaders.hpp:388:16: note: 'get_rows_iq1_s_len' declared here
[build]   388 | const uint64_t get_rows_iq1_s_len = 25676;

[build] ggml\src\ggml-vulkan\ggml-vulkan.cpp:2471:125: error: use of undeclared identifier 'get_rows_iq1_m_data'; did you mean 'get_rows_iq1_s_data'?
[build]  2471 |     ggml_vk_create_pipeline(device, device->pipeline_get_rows[GGML_TYPE_IQ1_M],   "get_rows_iq1_m",   get_rows_iq1_m_len,   get_rows_iq1_m_data,   "main", 3, sizeof(vk_op_binary_push_constants), {1024, 1, 1}, {}, 1);
[build]       |                                                                                                                             ^~~~~~~~~~~~~~~~~~~
[build]       |                                                                                                                             get_rows_iq1_s_data
[build] ggml/src/ggml-vulkan/ggml-vulkan-shaders.hpp:387:22: note: 'get_rows_iq1_s_data' declared here
[build]   387 | extern unsigned char get_rows_iq1_s_data[25676];
[build]       |                      ^

[build] ggml\src\ggml-vulkan\ggml-vulkan.cpp:2489:111: error: use of undeclared identifier 'get_rows_iq1_m_f32_len'; did you mean 'get_rows_iq1_s_f32_len'?
[build]  2489 |     ggml_vk_create_pipeline(device, device->pipeline_get_rows_f32[GGML_TYPE_IQ1_M],   "get_rows_iq1_m_f32",   get_rows_iq1_m_f32_len,   get_rows_iq1_m_f32_data,   "main", 3, sizeof(vk_op_binary_push_constants), {1024, 1, 1}, {}, 1);
[build]       |                                                                                                               ^~~~~~~~~~~~~~~~~~~~~~
[build]       |                                                                                                               get_rows_iq1_s_f32_len
[build] ggml/src/ggml-vulkan/ggml-vulkan-shaders.hpp:391:16: note: 'get_rows_iq1_s_f32_len' declared here
[build]   391 | const uint64_t get_rows_iq1_s_f32_len = 25660;
[build]       |                ^

[build] ggml\src\ggml-vulkan\ggml-vulkan.cpp:2489:137: error: use of undeclared identifier 'get_rows_iq1_m_f32_data'; did you mean 'get_rows_iq1_s_f32_data'?
[build]  2489 |     ggml_vk_create_pipeline(device, device->pipeline_get_rows_f32[GGML_TYPE_IQ1_M],   "get_rows_iq1_m_f32",   get_rows_iq1_m_f32_len,   get_rows_iq1_m_f32_data,   "main", 3, sizeof(vk_op_binary_push_constants), {1024, 1, 1}, {}, 1);
[build]       |                                                                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~
[build]       |                                                                                                                                         get_rows_iq1_s_f32_data
[build] ggml/src/ggml-vulkan/ggml-vulkan-shaders.hpp:390:22: note: 'get_rows_iq1_s_f32_data' declared here
[build]   390 | extern unsigned char get_rows_iq1_s_f32_data[25660];
[build]       |                      ^
@0cc4m
Copy link
Collaborator

0cc4m commented May 10, 2025

This is an issue with glslc, is there a way for you to update that?

@lazka
Copy link

lazka commented May 10, 2025

I'm seeing the same error with the latest glslc release from shaderc v2025.2

$ glslc  --version
2025.2
3~1.4.313.0
15.2.0

Target: SPIR-V 1.0

@jeffbolznv
Copy link
Collaborator

I think this is the issue I fixed in KhronosGroup/glslang#3911. Can you try with one of the latest builds from https://github.com/google/shaderc/?tab=readme-ov-file#downloads?

@lazka
Copy link

lazka commented May 10, 2025

Thanks! I can confirm that updating glslang to 15.3.0 and then rebuilding shaderc fixes things.

lazka added a commit to lazka/MINGW-packages that referenced this issue May 10, 2025
lazka added a commit to msys2/MINGW-packages that referenced this issue May 10, 2025
@celan69
Copy link

celan69 commented May 10, 2025

Can independently confirm that the fix by @jeffbolznv and its integration into the MSYS2 packages by @lazka work! Thank you guys for your quick resolution of this issue!

@DickyQi
Copy link
Author

DickyQi commented May 11, 2025

fixed it since update gosling👍

@DickyQi DickyQi closed this as completed May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants