Compile bug: error: call to undeclared function '_mm512_storeu_si512'; in ggml.c (icx/clang in MSVC compat mode)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- build-system
Research direction
Start with the AVX512BF16 conditional in ggml/src/ggml.c around the reported intrinsic declarations and compare how compiler modes include immintrin.h. Reproduce the Windows IntelLLVM clang-cl build using the supplied flags, then check the BF16 conversion path. Done when the build succeeds in MSVC-compatible clang mode and the existing supported compiler paths remain valid.
Written by the indexing model from the issue text.
Description
Git commit
3cf03257f219afbe7334045ff7c6a06ac68c627d
Operating systems
Windows
GGML backends
SYCL
Problem description & steps to reproduce
I'm trying to compile Strata using -march=znver4 on a Zen 4 CPU (Ryzen 7600). It has this project as a dependency, currently using the specified pinned revision.
The issue is BF16 support (AVX512BF16) while icx/clang is running in MSVC-compatible modes. In this case the following code fails because _MSC_VER is set but the relevant intrinsic isn't defined:
// Needed for ggml_fp32_to_bf16_row()
#if defined(__AVX512BF16__)
#if defined(_MSC_VER)
#define m512i(p) p
#else
#include <immintrin.h>
#define m512i(p) (__m512i)(p)
#endif // defined(_MSC_VER)
#endif // defined(__AVX512BF16__)
You might need something like #if defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) instead.
First Bad Commit
No response
Compile command
cmake -B build-sycl -S . -G Ninja -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_SYCL=ON -DSTRATA_SYCL_AOT=bmg-g21 -DSTRATA_SYCL_PARITY=OFF -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL -DCMAKE_CXX_FLAGS="/EHsc -Qunused-arguments -Qmkl=sequential /clang:-O3 /clang:-march=znver4" -DCMAKE_C_FLAGS="-Qunused-arguments -Qmkl=sequential /clang:-O3 /clang:-march=znver4" -DCMAKE_EXE_LINKER_FLAGS="-Qmkl=sequential"
cmake --build build-sycl --target strata
With /clang:-mno-avx512bf16 or /clang:-includeimmintrin.h set in -DCMAKE_CXX_FLAGS and -DCMAKE_C_FLAGS, the error does not occur.
Relevant log output
-- The CXX compiler identification is IntelLLVM 2026.1.0 with MSVC-like command-line
-- Check for working C compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/bin/icx.exe - skipped
-- The ASM compiler identification is IntelLLVM
-- Found assembler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/bin/icx.exe
-- Adding CPU backend variant ggml-cpu: /arch:AVX512 GGML_AVX512
-- ggml version: 0.24.0
-- ggml commit: 3cf03257f
[1/134] Building C object ggml\src\CMakeFiles\ggml-base.dir\ggml.c.obj
FAILED: [code=1] ggml/src/CMakeFiles/ggml-base.dir/ggml.c.obj
C:\PROGRA~2\Intel\oneAPI\compiler\latest\bin\icx.exe /nologo -DGGML_SCHED_MAX_COPIES=4 -DSTRATA_Q6K_EXPERTS=1 -DSTRATA_VERSION=\"0.1.49.2\" -DSTRATA_XMX_SG16=1 -D_CRT_SECURE_NO_WARNINGS -D_XOPEN_SOURCE=600 -IC:\Users\GreenReaper\strata\build-sycl\_deps\strata_llamacpp-src\ggml\src\. -IC:\Users\GreenReaper\strata\build-sycl\ggml\src -IC:\Users\GreenReaper\strata\build-sycl\_deps\strata_llamacpp-src\ggml\src\..\include -Qunused-arguments -Qmkl=sequential /clang:-O3 /clang:-march=znver4 /O2 /Ob2 /DNDEBUG -Qstd:c11 -MD -fp-model=precise -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated-declarations /wd4005 /wd4244 /wd4267 /wd4305 /wd4566 /wd4996 /wd4702 /utf-8 -QMD -QMT ggml\src\CMakeFiles\ggml-base.dir\ggml.c.obj -QMF ggml\src\CMakeFiles\ggml-base.dir\ggml.c.obj.d /Foggml\src\CMakeFiles\ggml-base.dir\ggml.c.obj /Fdggml\src\CMakeFiles\ggml-base.dir\ggml-base.pdb -c C:\Users\GreenReaper\strata\build-sycl\_deps\strata_llamacpp-src\ggml\src\ggml.c
icx: warning: unknown argument ignored in clang-cl: '-fp-model=precise' [-Wunknown-argument]
C:\Users\GreenReaper\strata\build-sycl\_deps\strata_llamacpp-src\ggml\src\ggml.c(500,9): error: call to undeclared function '_mm512_storeu_si512'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
500 | _mm512_storeu_si512(
| ^
C:\Users\GreenReaper\strata\build-sycl\_deps\strata_llamacpp-src\ggml\src\ggml.c(501,14): error: use of undeclared identifier '__m512i'
501 | (__m512i *)(y + i),
| ^~~~~~~
C:\Users\GreenReaper\strata\build-sycl\_deps\strata_llamacpp-src\ggml\src\ggml.c(501,23): error: expected expression
501 | (__m512i *)(y + i),
| ^
C:\Users\GreenReaper\strata\build-sycl\_deps\strata_llamacpp-src\ggml\src\ggml.c(502,19): error: call to undeclared function '_mm512_cvtne2ps_pbh'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
502 | m512i(_mm512_cvtne2ps_pbh(_mm512_loadu_ps(x + i + 16),
| ^
C:\Users\GreenReaper\strata\build-sycl\_deps\strata_llamacpp-src\ggml\src\ggml.c(502,39): error: call to undeclared function '_mm512_loadu_ps'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
502 | m512i(_mm512_cvtne2ps_pbh(_mm512_loadu_ps(x + i + 16),
| ^
5 errors generated.
- Dominant language
- C++
- Stars
- 133k
- Forks
- 24.9k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 486
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ggml-org/llama.cpp
-
bug-unconfirmed
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug-unconfirmed
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Compile bug: Errors on glibc < 2.34Possibly taken @o7si claimed this 1 day ago. Openbug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Eval bug: Vulkan: count_experts.comp zero_skipped_rows() loops over every id in every threadPossibly taken @SG-Amadeus claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ggml-org/llama.cpp#31163 · 3 comments ·
Maintainers usually reply within 1 day
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
All issues in ggml-org/llama.cpp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
elf-alchemist/elfbsp#113 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
patrick-hudson/put.gd-desktop#979 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Dao-AILab/flash-attention#3097 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Niko1221/Strata#4779 · 2 comments ·
Maintainers usually reply within 3 days