ggerganov / whisper.cpp

Port of OpenAI's Whisper model in C/C++
MIT License
34.77k stars 3.55k forks source link

Silent crash on Windows #2175

Open thewh1teagle opened 4 months ago

thewh1teagle commented 4 months ago

When trying to transcribe audio files using version 1.6.0 on Windows I get the following errors: (Tried multiple different files)

Happens on CPU which supports f16c instruction

command line output ```console C:\Users\User\Downloads\whisper-bin-x64>main.exe -m "%localappdata%\github.com.thewh1teagle.vibe\ggml-medium.bin" -f "samples_single.wav" whisper_init_from_file_with_params_no_state: loading model from 'C:\Users\User\AppData\Local\github.com.thewh1teagle.vibe\ggml-medium.bin' whisper_init_with_params_no_state: use gpu = 1 whisper_init_with_params_no_state: flash attn = 0 whisper_init_with_params_no_state: gpu_device = 0 whisper_init_with_params_no_state: dtw = 0 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: ftype = 1 whisper_model_load: qntvr = 0 whisper_model_load: type = 4 (medium) ```
Event viewer ```console Faulting application name: main.exe, version: 0.0.0.0, time stamp: 0x6644b82c Faulting module name: whisper.dll, version: 0.0.0.0, time stamp: 0x6644b81e Exception code: 0xc000001d Fault offset: 0x00000000000a0d24 Faulting process id: 0x0x2164 Faulting application start time: 0x0x1DAAC4BE362C819 Faulting application path: C:\Users\User\Downloads\whisper-bin-x64\main.exe Faulting module path: C:\Users\User\Downloads\whisper-bin-x64\whisper.dll Report Id: 16c30353-9eb1-4ef6-ab6c-d32baf747669 Faulting package full name: Faulting package-relative application ID: ```
System Info ```console USER@USER-PC -------------- OS: Windows 11 Build: 23H2 (22631) CPU: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz GPU: NVIDIA GeForce RTX 3060 Memory: 10078 MB / 16336 MB (61% in use) Disk: C:\ 228.05 GB (160.44 GB free) ```

Related: https://github.com/thewh1teagle/vibe/issues/79, https://github.com/ggerganov/whisper.cpp/discussions/367, https://github.com/ggerganov/whisper.cpp/issues/828#issuecomment-1529106461 https://github.com/ggerganov/whisper.cpp/issues/860#issuecomment-1533354535

thewh1teagle commented 4 months ago

Update: It happend because of unsupported cpu instructions these are the supported instructions on the cpu:

AVX: true
AVX2: false
AVX512: false
AVX512-VBMI: false
AVX512-VNNI: false
FMA: false
F16C: true

Once I disabled AVX2 and FMA, it worked!

I believe that whisper.cpp should check if the instructions enabled, and if they are supported by the cpu, and will raise it's own error instead of crashing