Skip to content
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

Thread 1 "main" received signal SIGILL, Illegal instruction. #12

Closed
biemster opened this issue Oct 1, 2022 · 4 comments
Closed

Thread 1 "main" received signal SIGILL, Illegal instruction. #12

biemster opened this issue Oct 1, 2022 · 4 comments
Labels
build Build related issues

Comments

@biemster
Copy link

biemster commented Oct 1, 2022

Seemed to come from here:

0x00005555555586fb in _mm256_fmadd_ps (__C=..., __B=..., __A=...) at /usr/lib/gcc/x86_64-linux-gnu/7/include/fmaintrin.h:65
65	  return (__m256)__builtin_ia32_vfmaddps256 ((__v8sf)__A, (__v8sf)__B,

with backtrace

(gdb) bt
#0  0x00005555555586fb in _mm256_fmadd_ps (__C=..., __B=..., __A=...) at /usr/lib/gcc/x86_64-linux-gnu/7/include/fmaintrin.h:65
#1  ggml_vec_dot_f16 (n=96, s=0x7ffffffe4e54, x=0x7fff646b6ee0, y=0x7fff64746ee0) at ggml.c:375
#2  0x0000555555564766 in ggml_compute_forward_conv_1d_1s_f16_f32 (params=0x7ffffffe51c0, src0=0x7fff9025f0f0, src1=0x7fff65482030, dst=0x7fff6556c6f0) at ggml.c:4668
#3  0x0000555555564f40 in ggml_compute_forward_conv_1d_1s (params=0x7ffffffe51c0, src0=0x7fff9025f0f0, src1=0x7fff65482030, dst=0x7fff6556c6f0) at ggml.c:4806
#4  0x0000555555568707 in ggml_compute_forward (params=0x7ffffffe51c0, tensor=0x7fff6556c6f0) at ggml.c:5809
#5  0x000055555556a6ec in ggml_graph_compute (ctx=0x5555557f3b48 <g_state+104>, cgraph=0x7ffffffe5340) at ggml.c:6611
#6  0x0000555555580cb2 in whisper_encode (model=..., n_threads=4, mel_offset=0, mel_inp=..., features=std::vector of length 0, capacity 0) at main.cpp:1353
#7  0x0000555555584664 in main (argc=5, argv=0x7fffffffdb78) at main.cpp:2225

On Ubuntu 18.04, gcc 7.5.0, on an Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz

@biemster
Copy link
Author

biemster commented Oct 1, 2022

It seems my CPU does not support FMA, whatever that is :(
There might be a workaround described here: https://stackoverflow.com/a/42854597/11545161
I'm going to try that. Or throw this machine out the window

@biemster
Copy link
Author

biemster commented Oct 1, 2022

I see now you did some changes in the rpi4 branch in this area, since that also does not seem to have FMA, I'm going to have a look there too. I seem to be a bit too trigger happy on opening new issues today, sorry for the noise.

@ggerganov
Copy link
Owner

Yes, currently on x86 architectures your CPU must support the FMA and F16C instruction sets. You can check if your CPU supports it with this command:

tail /proc/cpuinfo | grep flags

The flags avx2, fma and f16c should be listed there.

The rpi4 branch is for Arm architecture, so it won't work on your Intel CPU.

The workaround you can try is to remove the -mavx -mavx2 -mfma -mf16c flags from the Makefile and rebuild. ggml should fallback to non-SIMD implementation which is much slower, but it should at least work on every machine.

@WilliamTambellini
Copy link
Contributor

Using/linking with
https://github.com/oneapi-src/oneDNN
should resolve these kind of issues.

@ggerganov ggerganov added the build Build related issues label Oct 5, 2022
bygreencn pushed a commit to bygreencn/whisper.cpp that referenced this issue Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build related issues
Projects
None yet
Development

No branches or pull requests

3 participants