sandrohanea / whisper.net

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

Illegal Instruction when AVX is not available on the Host #110

Open piotr-k-k opened 9 months ago

piotr-k-k commented 9 months ago

Hi, unfortunatelly I get unhandled exception trying run Whisper.net.Demo and I can't deal with it. Unhandled exception at 0x00007FFB6C6B3441 (whisper.dll) in Whisper.net.Demo.exe: 0xC000001D: Illegal Instruction. at line NativeMethods.whisper_full_with_state(currentWhisperContext, state, whisperParams, (IntPtr)pData, samples.Length); VS2022, .NET 7, Whisper 1.4.7 Any suggestions? Thanks

sandrohanea commented 9 months ago

Hello @piotr-k-k , Do you have any changes to Whisper.net.Demo?

Are you using some specific wav file that you can share in order to reproduce the issue?

Also, can you, please, try some examples from the "Examples" folder? e.g. https://github.com/sandrohanea/whisper.net/tree/main/examples/Simple

piotr-k-k commented 9 months ago

Hello @sandrohanea, thank you for reply, no I didn't change anything and I used default kennedy.wav. I tested example Simple as well as my own test application, all with the same result.

sandrohanea commented 9 months ago

I still couldn't manage to reproduce the error. Can you, please, clarify the OS version and architecture(e.g. x64, arm64, x86) that you're using?

piotr-k-k commented 9 months ago

I used Windows 10 x64, today later or tomorrow maybe I will try other system and hardware.

sandrohanea commented 9 months ago

that is one of the systems that I'm using, and can confirm that it should work (just tested it). Can you maybe try to re-install https://aka.ms/vs/17/release/vc_redist.x64.exe Maybe for some reason you have some corrupted vc redistributable?

sandrohanea commented 9 months ago

Another possible issue might be similar with: https://stackoverflow.com/questions/59584105/illegal-instruction-from-vs-c-on-windows

Which CPU are you using?

piotr-k-k commented 9 months ago

Now I don't know what exactly CPU I use, I think it's some Intel Xeon, will check tomorrow. Thanks for tips, tomorrow I will continue deal with it.

piotr-k-k commented 9 months ago

I dealt with this problem by rebuilding whisper.cpp with disabled AVX2, so with set WHISPER_NO_AVX2 variable.

sandrohanea commented 9 months ago

Thanks for confirming @piotr-k-k , This might be address with a future runtime (e.g. Whisper.net.Runtime.NoAVX) which will disable AVX statically. However, the best way would be I think to do it similarly with ffmpeg (to use it only if it is available and to have runtime fallback => but that will require changes in whisper.cpp)