whisper.cpp
whisper.cpp copied to clipboard
ggml_metal_init: error: Error Domain=MTLLibraryErrorDomain Code=3 "program_source:3:10: fatal error: 'ggml-common.h' file not found
When running the latest code, I get : whisper_backend_init: ggml_backend_metal_init() failed whisper_model_load: CPU total size = 487.01 MB whisper_model_load: model size = 487.01 MB whisper_backend_init: using Metal backend ggml_metal_init: allocating ggml_metal_init: found device: Apple M1 Max ggml_metal_init: picking default device: Apple M1 Max ggml_metal_init: default.metallib not found, loading from source ggml_metal_init: GGML_METAL_PATH_RESOURCES = nil ggml_metal_init: loading '/Users/xxxxxx/Dev/whisper.cpp/ggml-metal.metal' ggml_metal_init: error: Error Domain=MTLLibraryErrorDomain Code=3 "program_source:3:10: fatal error: 'ggml-common.h' file not found #include "ggml-common.h" ^~~~~~~~~~~~~~~ " UserInfo={NSLocalizedDescription=program_source:3:10: fatal error: 'ggml-common.h' file not found #include "ggml-common.h" ^~~~~~~~~~~~~~~ } whisper_backend_init: ggml_backend_metal_init() failed
having same issue, workaround was to hardcode the path in the .metal file which is really not a workaround, came looking for the same issue, hopefully will be sorted soon
I have the same issue too.
I am getting this error when trying to make libwhisper.so -j
on MacBook Pro M1. See also the similar issue in llama.cpp. The same fix works for me.
Reposting the commands for the link above here: (convert to .metallib and ensure this file is visible to your binary)
xcrun -sdk macosx metal -O3 -c ggml-metal.metal -o ggml-metal.air
xcrun -sdk macosx metallib ggml-metal.air -o default.metallib