[GH-ISSUE #3656] error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch #2253

Closed
opened 2026-04-12 12:31:42 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @dpblnt on GitHub (Apr 15, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3656

What is the issue?

gmake[3]: Leaving directory '/mnt/storage/tmp/ollama/ollama/llm/build/linux/x86_64/cpu'
[  8%] Built target build_info
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/immintrin.h:109,
                 from /mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-impl.h:93,
                 from /mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:5:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h: In function ‘ggml_vec_dot_q4_0_q8_0’:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
/mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:3835:15: note: called from here
 3835 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
/mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:3835:15: note: called from here
 3835 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
/mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:3835:15: note: called from here
 3835 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
/mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:3835:15: note: called from here
 3835 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
gmake[3]: *** [CMakeFiles/ggml.dir/build.make:121: CMakeFiles/ggml.dir/ggml-quants.c.o] Error 1

What did you expect to see?

build

Steps to reproduce

go clean
git pull

export LAMA_NATIVE=on
export LLAMA_AVX=on
export LLAMA_AVX2=on
export LLAMA_F16C=on
export LLAMA_FMA=on
export LLAMA_VULKAN=1

export CMAKE_C_COMPILER=/usr/lib/llvm/17/bin/clang
export CMAKE_CXX_COMPILER=/usr/lib/llvm/17/bin/clang++

export CC=clang
export CXX=clang++
export CGO_CFLAGS="-g"
export CMAKE_C_COMPILER=clang
export CMAKE_CXX_COMPILER=clang++

go clean ./...
go generate ./...
go build .

Are there any recent changes that introduced the issue?

No response

OS

Linux

Architecture

No response

Platform

No response

Ollama version

a0b8a32eb4

GPU

AMD

GPU info

No response

CPU

AMD

Other software

No response

Originally created by @dpblnt on GitHub (Apr 15, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3656 ### What is the issue? ``` gmake[3]: Leaving directory '/mnt/storage/tmp/ollama/ollama/llm/build/linux/x86_64/cpu' [ 8%] Built target build_info In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/immintrin.h:109, from /mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-impl.h:93, from /mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:5: /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h: In function ‘ggml_vec_dot_q4_0_q8_0’: /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch 63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C) | ^~~~~~~~~~~~~~~ /mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:3835:15: note: called from here 3835 | acc = _mm256_fmadd_ps( d, q, acc ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch 63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C) | ^~~~~~~~~~~~~~~ /mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:3835:15: note: called from here 3835 | acc = _mm256_fmadd_ps( d, q, acc ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch 63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C) | ^~~~~~~~~~~~~~~ /mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:3835:15: note: called from here 3835 | acc = _mm256_fmadd_ps( d, q, acc ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch 63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C) | ^~~~~~~~~~~~~~~ /mnt/storage/tmp/ollama/ollama/llm/llama.cpp/ggml-quants.c:3835:15: note: called from here 3835 | acc = _mm256_fmadd_ps( d, q, acc ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ gmake[3]: *** [CMakeFiles/ggml.dir/build.make:121: CMakeFiles/ggml.dir/ggml-quants.c.o] Error 1 ``` ### What did you expect to see? build ### Steps to reproduce go clean git pull export LAMA_NATIVE=on export LLAMA_AVX=on export LLAMA_AVX2=on export LLAMA_F16C=on export LLAMA_FMA=on export LLAMA_VULKAN=1 export CMAKE_C_COMPILER=/usr/lib/llvm/17/bin/clang export CMAKE_CXX_COMPILER=/usr/lib/llvm/17/bin/clang++ export CC=clang export CXX=clang++ export CGO_CFLAGS="-g" export CMAKE_C_COMPILER=clang export CMAKE_CXX_COMPILER=clang++ go clean ./... go generate ./... go build . ### Are there any recent changes that introduced the issue? _No response_ ### OS Linux ### Architecture _No response_ ### Platform _No response_ ### Ollama version a0b8a32eb4a933f7ad3bf687892f05f85dd75fee ### GPU AMD ### GPU info _No response_ ### CPU AMD ### Other software _No response_
GiteaMirror added the bug label 2026-04-12 12:31:42 -05:00
Author
Owner

@jmorganca commented on GitHub (Apr 15, 2024):

Hi there. LLAMA_VULKAN hasn't been well tested and it seems you may be trying to access a cpu feature that isn't available. Would it be possible to try compiling without some of the LLAMA_ variables to see if it fixes this?

<!-- gh-comment-id:2057614652 --> @jmorganca commented on GitHub (Apr 15, 2024): Hi there. `LLAMA_VULKAN` hasn't been well tested and it seems you may be trying to access a cpu feature that isn't available. Would it be possible to try compiling without some of the LLAMA_ variables to see if it fixes this?
Author
Owner

@dpblnt commented on GitHub (Apr 16, 2024):

I have tried without the LLAMA variables, it's the same result.
I can build ggerganov and nomic-ai to see how vulkan works.

I can build ollama/llm/llama.cpp with clang and vulkan, with same parameters as above

ollama/llm/llama.cpp/b $ cmake  ..  -DLLAMA_CCACHE=OFF  -DLLAMA_NATIVE=on -DLLAMA_AVX=on -DLLAMA_AVX2=on -DLLAMA_F16C=on -DLLAMA_FMA=on -DLLAMA_VULKAN=1

fails

ggml_vulkan: Found 1 Vulkan devices:
Vulkan0: AMD Radeon R7 200 Series (RADV OLAND) | uma: 0 | fp16: 0 | warp size: 64
Floating point exception

builds without vulkan

ollama/llm/llama.cpp/novulkan $ cmake  ..  -DLLAMA_CCACHE=OFF  -DLLAMA_NATIVE=on -DLLAMA_AVX=on -DLLAMA_AVX2=on -DLLAMA_F16C=on -DLLAMA_FMA=on

and works.
builds with gcc with vulkan

ollama/llm/llama.cpp/gcc_vulkan $ cmake  ..  -DLLAMA_CCACHE=OFF  -DLLAMA_NATIVE=on -DLLAMA_AVX=on -DLLAMA_AVX2=on -DLLAMA_F16C=on -DLLAMA_FMA=on -DLLAMA_VULKAN=1

and fails

ggml_vulkan: Found 1 Vulkan devices:
Vulkan0: AMD Radeon R7 200 Series (RADV OLAND) | uma: 0 | fp16: 0 | warp size: 64
Floating point exception
<!-- gh-comment-id:2058285874 --> @dpblnt commented on GitHub (Apr 16, 2024): I have tried without the LLAMA variables, it's the same result. I can build [ggerganov](https://github.com/ggerganov/llama.cpp) and [nomic-ai](https://github.com/nomic-ai/llama.cpp.git) to see how vulkan works. I can build ollama/llm/llama.cpp with clang and vulkan, with same parameters as above ``` ollama/llm/llama.cpp/b $ cmake .. -DLLAMA_CCACHE=OFF -DLLAMA_NATIVE=on -DLLAMA_AVX=on -DLLAMA_AVX2=on -DLLAMA_F16C=on -DLLAMA_FMA=on -DLLAMA_VULKAN=1 ``` fails ``` ggml_vulkan: Found 1 Vulkan devices: Vulkan0: AMD Radeon R7 200 Series (RADV OLAND) | uma: 0 | fp16: 0 | warp size: 64 Floating point exception ``` builds without vulkan ``` ollama/llm/llama.cpp/novulkan $ cmake .. -DLLAMA_CCACHE=OFF -DLLAMA_NATIVE=on -DLLAMA_AVX=on -DLLAMA_AVX2=on -DLLAMA_F16C=on -DLLAMA_FMA=on ``` and works. builds with gcc with vulkan ``` ollama/llm/llama.cpp/gcc_vulkan $ cmake .. -DLLAMA_CCACHE=OFF -DLLAMA_NATIVE=on -DLLAMA_AVX=on -DLLAMA_AVX2=on -DLLAMA_F16C=on -DLLAMA_FMA=on -DLLAMA_VULKAN=1 ``` and fails ``` ggml_vulkan: Found 1 Vulkan devices: Vulkan0: AMD Radeon R7 200 Series (RADV OLAND) | uma: 0 | fp16: 0 | warp size: 64 Floating point exception ```
Author
Owner

@dpblnt commented on GitHub (Apr 16, 2024):

building ollama with no LLAMA_ variables

go clean ./...
go generate   ./... 
go build  .

ignores CC=clang and CXX=clang++

+ COMMON_CMAKE_DEFS='-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off'

fails like before

<!-- gh-comment-id:2058313083 --> @dpblnt commented on GitHub (Apr 16, 2024): building ollama with no LLAMA_ variables ``` go clean ./... go generate ./... go build . ``` ignores CC=clang and CXX=clang++ ``` + COMMON_CMAKE_DEFS='-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off' ``` fails like before
Author
Owner

@dpblnt commented on GitHub (Apr 16, 2024):

I noticed even without the vulkan flag it still tried to build CMakeFiles/ggml.dir/ggml-vulkan.cpp.o where it failed.
With a clean clone it works (without vulklan).

<!-- gh-comment-id:2058347147 --> @dpblnt commented on GitHub (Apr 16, 2024): I noticed even without the vulkan flag it still tried to build CMakeFiles/ggml.dir/ggml-vulkan.cpp.o where it failed. With a clean clone it works (without vulklan).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#2253