sandrohanea / whisper.net

Whisper.net. Speech to text made simple using Whisper Models
MIT License
505 stars 77 forks source link

Illegal Instruction - 1 #187

Closed alahane-techtel closed 2 months ago

alahane-techtel commented 2 months ago

For us, the whisper.net is working on most of the machines. But however, couple of machines are not able to run it. We get Illegal Instruction error. This error, however, I think, is little different than the one here: https://github.com/sandrohanea/whisper.net/issues/116

We have all windows machines. We are facing it on following machines: image

The CPU supports AVX

Following is the output when we run the simple example from this repo (https://github.com/sandrohanea/whisper.net/tree/main/examples/Simple):

Info: whisper_init_from_file_with_params_no_state: loading model from 'ggml-base.bin' Info: whisper_model_load: loading model Info: whisper_model_load: n_vocab = 51865 Info: whisper_model_load: n_audio_ctx = 1500 Info: whisper_model_load: n_audio_state = 512 Info: whisper_model_load: n_audio_head = 8 Info: whisper_model_load: n_audio_layer = 6 Info: whisper_model_load: n_text_ctx = 448 Info: whisper_model_load: n_text_state = 512 Info: whisper_model_load: n_text_head = 8 Info: whisper_model_load: n_text_layer = 6 Info: whisper_model_load: n_mels = 80 Info: whisper_model_load: ftype = 1 Info: whisper_model_load: qntvr = 0 Info: whisper_model_load: type = 2 (base) Info: whisper_model_load: adding 1608 extra tokens Info: whisper_model_load: n_langs = 99 Info: whisper_model_load: CPU buffer size = 156.67 MB Info: whisper_model_load: model size = 156.58 MB Info: whisper_init_state: kv self size = 16.52 MB Info: whisper_init_state: kv cross size = 18.43 MB Info: whisper_init_state: compute buffer (conv) = 14.79 MB Info: whisper_init_state: compute buffer (encode) = 85.93 MB Info: whisper_init_state: compute buffer (cross) = 4.71 MB Info: whisper_init_state: compute buffer (decode) = 96.42 MB

C:\Users----\Source\Repos\whisper.net\examples\Simple\bin\Debug\net8.0\Simple.exe (process 18036) exited with code -1073741795. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.

When checked the debug log in visual studio, we see an illegal instruction exception:

'Simple.exe' (CoreCLR: DefaultDomain): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Private.CoreLib.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Users\inflo\Source\Repos\whisper.net\examples\Simple\bin\Debug\net8.0\Simple.dll'. Symbols loaded. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Runtime.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'c:\program files\microsoft visual studio\2022\community\common7\ide\commonextensions\microsoft\hotreload\Microsoft.Extensions.DotNetDeltaApplier.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.IO.Pipes.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Linq.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Collections.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Console.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Threading.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Runtime.InteropServices.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Threading.Overlapped.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Security.AccessControl.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Security.Principal.Windows.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Security.Claims.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Runtime.Loader.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Users\inflo\Source\Repos\whisper.net\examples\Simple\bin\Debug\net8.0\Whisper.net.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Collections.Concurrent.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\Microsoft.Win32.Primitives.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Text.Encoding.Extensions.dll'. 'Simple.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.4\System.Memory.dll'. The program '[18036] Simple.exe' has exited with code 3221225501 (0xc000001d) 'Illegal Instruction'.

Can someone please suggest what might be wrong here?

alahane-techtel commented 2 months ago

I think somehow AVX2 is not available on these 2 machines even though the CPU spec says it does support AVX2. Will try to build the whisper.cpp with AVX2 disabled.