whisper.cpp
whisper.cpp copied to clipboard
Not working on Windows 11 Pro ARM64
I tried compiling and running whisper on Windows 11 Pro on ARM64, sadly it doesn't work.
When compiling using Visual Studio 2022 I used to following profile:
When reloading the CMAKELists.txt the console prints that it detected a x84_x64 system, which is wrong because CMAKE_SYSTEM_PROCESSOR
reports ARM64
, so I added that to the CMAKELists.txt
Building will now result in an error from: immintrin.h
: This header is specific to X86 and X64 targets
This file is included in ggml.c
files.
I tried disabling the include of this immintrin.h
file and enable the ARM_NEON includes. This builds a .DLL, however when trying to run this DDL it will give memory errors. Could you help me out getting this to work on ARM64?
Probably MSVC does not define the __ARM_NEON
macro which is used in ggml
to determine if we are building for ARM.
Try to figure out which macro is available and update the checks in ggml.h
and ggml.c
:
- https://github.com/ggerganov/whisper.cpp/blob/f254e787371091552f3e01623dfeca03fda9bc70/ggml.h#L186
- https://github.com/ggerganov/whisper.cpp/blob/f254e787371091552f3e01623dfeca03fda9bc70/ggml.c#L129
- https://github.com/ggerganov/whisper.cpp/blob/f254e787371091552f3e01623dfeca03fda9bc70/ggml.c#L366
- https://github.com/ggerganov/whisper.cpp/blob/f254e787371091552f3e01623dfeca03fda9bc70/ggml.c#L8553
Is there a command to list the available macros?
I just checked my DLL again, and I think it might actually work with my hack ^^
The transcription isn't right tho, but maybe it is the model file i.c.m. with my .wav file. I will try find the right macro
Here are some additional resources:
- https://learn.microsoft.com/en-us/cpp/build/reference/arch-arm64
- https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros
I think to build it properly, you need to add to CMakeLists.txt
the flag /arch:ARM64
(similar to how it is currently done for AVX2
). And then in the code, you have to check for _M_ARM64
instead of __ARM_NEON
.
But not 100% sure if that's all. Let us know if you make progress.
Yup, that made it compile without problems!
I don't like this output.. Only
,
's and the timestamp looks messed up? It also takes forever to transcript with the base model, while on my 64 bit windows machine its done within seconds
(Using the Windows 2023 DevKit)
Locally compiled Whisper.Net, same results, it even detects the language as HAW?? Never heard of that before haha. This model + .wav works fine on Windows 64 bit.
I think something must be wrong in the compiled .dll?
I can't get it to work :(
https://github.com/GewoonJaap/whisper.cpp/commit/c5df645f4c4426e000a3e205c8cae768a8ae7561
These are my changes. Locally I tried to change the arm_neon.h import to all kind of arm64 imports, but it keeps outputting ,
's
What could be going wrong here?
Same on win 10, I am using the released bin