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

Get SIGILL on Intel(R) Core(TM) i5-2520M (Thinkpad X220) #828

Open
petterreinholdtsen opened this issue Apr 28, 2023 · 4 comments
Open

Get SIGILL on Intel(R) Core(TM) i5-2520M (Thinkpad X220) #828

petterreinholdtsen opened this issue Apr 28, 2023 · 4 comments

Comments

@petterreinholdtsen
Copy link
Contributor

I tried running whisper.cpp on a Thinkpad X220 today, and the program crash with SIGILL.

Is there some inline assembly assuming a newer CPU?

% gdb bin/main
[...]
(gdb) run -m model-medium/ggml-model.bin ~/stemmetest-oda-2023-04-16.wav
Starting program: /home/user/whisper.cpp/build/bin/main -m model-medium/ggml-model.bin ~/stemmetest-oda-2023-04-16.wav
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
whisper_init_from_file_no_state: loading model from 'model-medium/ggml-model.bin'
whisper_model_load: loading model
whisper_model_load: n_vocab       = 51865
whisper_model_load: n_audio_ctx   = 1500
whisper_model_load: n_audio_state = 1024
whisper_model_load: n_audio_head  = 16
whisper_model_load: n_audio_layer = 24
whisper_model_load: n_text_ctx    = 448
whisper_model_load: n_text_state  = 1024
whisper_model_load: n_text_head   = 16
whisper_model_load: n_text_layer  = 24
whisper_model_load: n_mels        = 80
whisper_model_load: f16           = 1
whisper_model_load: type          = 4
whisper_model_load: mem required  = 1725.00 MB (+   43.00 MB per decoder)
whisper_model_load: adding 1608 extra tokens
whisper_model_load: model ctx     = 1462.35 MB

Program received signal SIGILL, Illegal instruction.
0x00007ffff7ec6d3a in ggml_init () from /home/user/whisper.cpp/build/libwhisper.so
(gdb) x/i $pc
=> 0x7ffff7ec6d3a <ggml_init+362>:      vcvtph2ps %xmm1,%xmm1
(gdb)
@petterreinholdtsen
Copy link
Contributor Author

I adjusted the build to include debug symbols in the binary, and got this backtrace:

Program received signal SIGILL, Illegal instruction.
b0x00007ffff7cc8b9b in _cvtsh_ss (__S=0)
    at /usr/lib/gcc/x86_64-linux-gnu/12/include/f16cintrin.h:41
41        __v4sf __A = __builtin_ia32_vcvtph2ps (__H);
(gdb) bt
#0  0x00007ffff7cc8b9b in _cvtsh_ss (__S=0)
    at /usr/lib/gcc/x86_64-linux-gnu/12/include/f16cintrin.h:41
#1  ggml_init (params=...) at /home/user/whisper.cpp/ggml.c:3020
#2  0x00007ffff7ce2fa6 in whisper_model_load (loader=0x7fffffffdf60, wctx=...)
    at /home/user/whisper.cpp/whisper.cpp:1050
#3  0x00007ffff7cebd44 in whisper_init_no_state (loader=0x7fffffffdf60)
    at /home/user/whisper.cpp/whisper.cpp:2683
#4  0x00007ffff7ceba7f in whisper_init_from_file_no_state (
    path_model=0x55555562edc0 "model-medium/ggml-model.bin")
    at /home/user/whisper.cpp/whisper.cpp:2633
#5  0x00007ffff7cebde2 in whisper_init_from_file (
    path_model=0x55555562edc0 "model-medium/ggml-model.bin")
    at /home/user/whisper.cpp/whisper.cpp:2696
#6  0x00005555555baec9 in main (argc=4, argv=0x7fffffffe3b8)
    at /home/user/whisper.cpp/examples/main/main.cpp:706
(gdb)

@petterreinholdtsen
Copy link
Contributor Author

I've been told https://wiki.debian.org/InstructionSelection contain some ideas how to fix this.

@papperlapapp
Copy link

Incidentally, I got the exact same error on an Intel(R) Core(TM) i7-3770 (using gcc 12.2.1).

However, after running make clean and make again, the error vanished. So maybe some leftovers from previous compiles?

@petterreinholdtsen
Copy link
Contributor Author

petterreinholdtsen commented Apr 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants