-
Notifications
You must be signed in to change notification settings - Fork 931
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
ggml-metal.metal not found error in mac with M2 chip #895
Comments
Please describe a bit more detailed how you compiled the whisper.cpp and Buzz. Buzz needs to compile python bindings, those are specific to a particular git commit version "linked" to the buzz repo. As code in whisper.cpp repo changes you need to look at the version linked to Buzz. Instructions you used seem to be correct as you are referencing the appropriate whisper.cpp commit. Compilation of Buzz will take care of everything if you run it as detailed here https://github.com/chidiwilliams/buzz/blob/main/CONTRIBUTING.md#mac The Core ML support has to be added in Buzz Also see this ggerganov/whisper.cpp#1707 Also this may be helpful abdeladim-s/pywhispercpp#35 Someone solved similar problem If or more precisely when you get this working, please share the notes or comments on what was missing from currently documented steps, so we can add the missing parts for others. |
i have tried above solutions but it doesn't work, i think the problem is when i run the poetry install command I'm getting these errors but it writs the whisper_cpp.py file successfully at the end:
also the path i exported for ehisper.cpp folder is also not being used when i run the file and if i put ggml-metal.metal file in buzz folder and hard code the path to ggml-common.h file in line 3 it works but i think that's not how it's supposed to be |
i added below code to buzz.py file:
and now it is loading ggml-metal.metal file from the whisper.cpp folder but now it can't find ggml-common.h file even though it is present in same directory as metal file and error is at 3rd line of metal file:
if i hardcode the path to common.h file it works, but i don't want to do that i want it to load automatically so can i make use of the environment variable i exported in metal file to build the path automatically and if yes how?, |
hey anything that can help on this?? |
@Uday-P-Patel I am afraid my C++ knowledge is quite basic, so I am not sure if I can help much here. But let's see if we can find come hints from other people who have fixed this. As such this may be useful - ggerganov/whisper.cpp#2041 Also maybe Curious if any of this helps. |
im trying to run buzz locally with whisper.cpp models with coreML support and i want to make sure it uses M@ chip/GPU,
here is what i have done,
-cloned the repo in my mac
-followed the steps and made it running
-then i compiled whisper.cpp with these instructions: https://github.com/ggerganov/whisper.cpp/tree/c7b6988678779901d02ceba1a8212d2c9908956e?tab=readme-ov-file#core-ml-support
-and re built the buzz to make sure whisper_cpp.py is updated correctly
-also ran the whisper.cpp with coreML models with an audio file so that i can make sure that it uses M@ chip
but when i run buzz locally and press recors it gives this error:
whisper_backend_init: using Metal backend
ggml_metal_init: allocating
ggml_metal_init: found device: Apple M2 Pro
ggml_metal_init: picking default device: Apple M2 Pro
ggml_metal_init: default.metallib not found, loading from source
ggml_metal_init: GGML_METAL_PATH_RESOURCES = nil
ggml_metal_init: error: could not use bundle path to find ggml-metal.metal, falling back to trying cwd
ggml_metal_init: loading 'ggml-metal.metal'
ggml_metal_init: error: Error Domain=NSCocoaErrorDomain Code=260 "The file “ggml-metal.metal” couldn’t be opened because there is no such file." UserInfo={NSFilePath=ggml-metal.metal, NSUnderlyingError=0x600001890090 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
whisper_backend_init: ggml_backend_metal_init() failed
whisper_model_load: CPU total size = 77.11 MB
whisper_model_load: model size = 77.11 MB
whisper_backend_init: using Metal backend
ggml_metal_init: allocating
ggml_metal_init: found device: Apple M2 Pro
ggml_metal_init: picking default device: Apple M2 Pro
ggml_metal_init: default.metallib not found, loading from source
ggml_metal_init: GGML_METAL_PATH_RESOURCES = nil
ggml_metal_init: error: could not use bundle path to find ggml-metal.metal, falling back to trying cwd
ggml_metal_init: loading 'ggml-metal.metal'
ggml_metal_init: error: Error Domain=NSCocoaErrorDomain Code=260 "The file “ggml-metal.metal” couldn’t be opened because there is no such file." UserInfo={NSFilePath=ggml-metal.metal, NSUnderlyingError=0x600001898810 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
whisper_backend_init: ggml_backend_metal_init() failed
whisper_init_state: kv self size = 9.44 MB
whisper_init_state: kv cross size = 9.44 MB
whisper_init_state: kv pad size = 2.36 MB
whisper_init_state: compute buffer (conv) = 13.32 MB
whisper_init_state: compute buffer (encode) = 87.96 MB
whisper_init_state: compute buffer (cross) = 4.01 MB
whisper_init_state: compute buffer (decode) = 96.02 MB
and then it falls back to CPU and runs fine
i checked and the files are all present in the whisper.cpp folder in buzz
if anything cloud help it will be great
The text was updated successfully, but these errors were encountered: