Skip to content
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

whisper_init_state: ggml_metal_init() failed #1367

Closed
ToSeven opened this issue Oct 14, 2023 · 3 comments
Closed

whisper_init_state: ggml_metal_init() failed #1367

ToSeven opened this issue Oct 14, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ToSeven
Copy link

ToSeven commented Oct 14, 2023

./stream -m models/ggml-base.en.bin
init: found 3 capture devices:
init: - Capture device #0: 'MacBook Pro麦克风'
init: - Capture device #1: 'Infoflow Audio Device'
init: - Capture device #2: 'ZoomAudioDevice'
init: attempt to open default capture device ...
init: obtained spec for input device (SDL Id = 2):
init: - sample rate: 16000
init: - format: 33056 (required: 33056)
init: - channels: 1 (required: 1)
init: - samples per frame: 1024
whisper_init_from_file_no_state: loading model from 'models/ggml-base.en.bin'
whisper_model_load: loading model
whisper_model_load: n_vocab = 51864
whisper_model_load: n_audio_ctx = 1500
whisper_model_load: n_audio_state = 512
whisper_model_load: n_audio_head = 8
whisper_model_load: n_audio_layer = 6
whisper_model_load: n_text_ctx = 448
whisper_model_load: n_text_state = 512
whisper_model_load: n_text_head = 8
whisper_model_load: n_text_layer = 6
whisper_model_load: n_mels = 80
whisper_model_load: ftype = 1
whisper_model_load: qntvr = 0
whisper_model_load: type = 2
whisper_model_load: adding 1607 extra tokens
whisper_model_load: model ctx = 140.66 MB
whisper_model_load: model size = 140.54 MB
whisper_init_state: kv self size = 5.25 MB
whisper_init_state: kv cross size = 17.58 MB
whisper_init_state: compute buffer (conv) = 14.10 MB
whisper_init_state: compute buffer (encode) = 81.85 MB
whisper_init_state: compute buffer (cross) = 4.40 MB
whisper_init_state: compute buffer (decode) = 24.61 MB
ggml_metal_init: allocating
ggml_metal_init: found device: Intel(R) Iris(TM) Plus Graphics 655
ggml_metal_init: picking default device: Intel(R) Iris(TM) Plus Graphics 655
ggml_metal_init: loading '/Volumes/extapple/projects/whisper.cpp/ggml-metal.metal'
ggml_metal_init: loaded kernel_add 0x7fc89c80d670 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_add_row 0x7fc89cd04c10 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_mul 0x7fc89cd05640 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_mul_row 0x7fc89cd05a10 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_scale 0x7fc89bf06be0 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_silu 0x7fc89bf072e0 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_relu 0x7fc89bf07b30 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_gelu 0x7fc89ca04990 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_soft_max 0x7fc89ce040c0 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_soft_max_4 0x7fc89cb04ab0 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_diag_mask_inf 0x7fc89cb05280 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_diag_mask_inf_8 0x7fc89cb059e0 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_f32 0x7fc89cb06010 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_f16 0x7fc89cb06700 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_q4_0 0x7fc89ce047c0 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_q4_1 0x7fc89ce05470 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_q8_0 0x7fc89ce05b60 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_q2_K 0x7fc89ce06250 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_q3_K 0x7fc89c80e3e0 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_q4_K 0x7fc89ce067a0 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_q5_K 0x7fc89ce06e90 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_get_rows_q6_K 0x7fc89ca0bc60 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_rms_norm 0x7fc89ca0d820 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_norm 0x7fc89ca0de00 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_mul_mat_f32_f32 0x7fc89c90a980 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_mul_mat_f16_f32 0x7fc89bf080c0 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_mul_mat_f16_f32_1row 0x7fc89bf08610 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_mul_mat_f16_f32_l4 0x7fc89bf08ba0 | th_max = 1024 | th_width = 32
ggml_metal_init: loaded kernel_mul_mat_q4_0_f32 0x7fc89cd05f90 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_mul_mat_q4_1_f32 0x7fc89cd06520 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_mul_mat_q8_0_f32 0x7fc89c80f150 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_mul_mat_q2_K_f32 0x7fc89c80f6e0 | th_max = 448 | th_width = 8
ggml_metal_init: loaded kernel_mul_mat_q3_K_f32 0x7fc89c80fad0 | th_max = 448 | th_width = 8
ggml_metal_init: loaded kernel_mul_mat_q4_K_f32 0x7fc89c90b270 | th_max = 448 | th_width = 8
ggml_metal_init: loaded kernel_mul_mat_q5_K_f32 0x7fc89c90b800 | th_max = 448 | th_width = 8
ggml_metal_init: loaded kernel_mul_mat_q6_K_f32 0x7fc89c90bd90 | th_max = 896 | th_width = 16
ggml_metal_init: loaded kernel_mul_mm_f32_f32 0x0 | th_max = 0 | th_width = 0
ggml_metal_init: load pipeline error: Error Domain=CompilerError Code=2 "AIR builtin function was called but no definition was found." UserInfo={NSLocalizedDescription=AIR builtin function was called but no definition was found.}
whisper_init_state: ggml_metal_init() failed

zsh: segmentation fault ./stream -m models/ggml-base.en.bin

@bobqianic
Copy link
Collaborator

bobqianic commented Oct 15, 2023

Are you using Intel based Macbook Pro?

If so, disable Metal can solve this. See #3129 for more details

@bobqianic bobqianic added the bug Something isn't working label Oct 15, 2023
@fbernhard
Copy link

For others reading @bobqianic 's comment. The environment variable to disable Metal is called WHISPER_NO_METAL:

make clean
WHISPER_NO_METAL=1 make
WHISPER_NO_METAL=1 make base

@ToSeven
Copy link
Author

ToSeven commented Oct 19, 2023

got it. Thx all!

@ToSeven ToSeven closed this as completed Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants