whisper.cpp icon indicating copy to clipboard operation
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

Open odoremieux opened this issue 10 months ago • 4 comments

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

odoremieux avatar Apr 11 '24 07:04 odoremieux

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

tonytorm avatar Apr 22 '24 15:04 tonytorm

I have the same issue too.

allenyan513 avatar Apr 27 '24 13:04 allenyan513

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.

lawrenceakka avatar Jun 02 '24 10:06 lawrenceakka

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

kcoul avatar Jun 11 '24 23:06 kcoul