ggerganov / ggml

Tensor library for machine learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation error with make on Linux Lite related to AVX.

FSSRepo opened this issue · comments

I am experiencing this error on Linux Lite using the latest version of GCC.

~/ggml/make
Consolidate compiler generated dependencies of target ggml
[ 25%] Building C object ggml/src/CMakeFiles/ggml.dir/ggml.c.o
In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:99,
                 from /home/steward/stable-diffusion.cpp/ggml/src/ggml.c:339:
/home/steward/stable-diffusion.cpp/ggml/src/ggml.c: In function ‘ggml_vec_dot_q4_0_q8_0’:
/usr/lib/gcc/x86_64-linux-gnu/11/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)
      | ^~~~~~~~~~~~~~~
/home/steward/stable-diffusion.cpp/ggml/src/ggml.c:2583:15: note: called from here
 2583 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:99,
                 from /home/steward/stable-diffusion.cpp/ggml/src/ggml.c:339:
/usr/lib/gcc/x86_64-linux-gnu/11/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)
      | ^~~~~~~~~~~~~~~
/home/steward/stable-diffusion.cpp/ggml/src/ggml.c:2583:15: note: called from here
 2583 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:99,
                 from /home/steward/stable-diffusion.cpp/ggml/src/ggml.c:339:
/usr/lib/gcc/x86_64-linux-gnu/11/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)
      | ^~~~~~~~~~~~~~~
/home/steward/stable-diffusion.cpp/ggml/src/ggml.c:2583:15: note: called from here
 2583 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:99,
                 from /home/steward/stable-diffusion.cpp/ggml/src/ggml.c:339:
/usr/lib/gcc/x86_64-linux-gnu/11/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)
      | ^~~~~~~~~~~~~~~
/home/steward/stable-diffusion.cpp/ggml/src/ggml.c:2583:15: note: called from here
 2583 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [ggml/src/CMakeFiles/ggml.dir/build.make:76: ggml/src/CMakeFiles/ggml.dir/ggml.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:159: ggml/src/CMakeFiles/ggml.dir/all] Error 2

gcc

gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

make

GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

uname a

uname -a
Linux steward-VirtualBox 5.15.0-82-generic #91-Ubuntu SMP Mon Aug 14 14:14:14 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

the same issue

gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2

add set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=znver1")

I can compile success