From: Georgi Gerganov Date: Tue, 21 Apr 2026 14:24:55 +0000 (+0300) Subject: metal : workaround macOS GPU interactivity watchdog (#22216) X-Git-Tag: upstream/0.0.10438~1567 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=7fc1c4ef78d72bf2753fe2cff04ae03846bfff62;p=pkg%2Fggml%2Fsources%2Fllama.cpp metal : workaround macOS GPU interactivity watchdog (#22216) --- diff --git a/ggml/src/ggml-metal/ggml-metal.cpp b/ggml/src/ggml-metal/ggml-metal.cpp index 4dbf8e6fe..6a836e459 100644 --- a/ggml/src/ggml-metal/ggml-metal.cpp +++ b/ggml/src/ggml-metal/ggml-metal.cpp @@ -918,6 +918,10 @@ ggml_backend_reg_t ggml_backend_metal_reg(void) { static std::vector devs; if (!initialized) { + // workaround macOS limitation (kIOGPUCommandBufferCallbackErrorImpactingInteractivity) until proper fix becomes possible + // ref: https://github.com/ggml-org/llama.cpp/issues/20141#issuecomment-4272947703 + setenv("AGX_RELAX_CDM_CTXSTORE_TIMEOUT", "1", true); + static ggml_backend_metal_reg_ptr reg_ctx(ggml_backend_metal_reg_init()); for (int i = 0; i < g_devices; ++i) {