]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
metal : workaround macOS GPU interactivity watchdog (#22216)
authorGeorgi Gerganov <redacted>
Tue, 21 Apr 2026 14:24:55 +0000 (17:24 +0300)
committerGitHub <redacted>
Tue, 21 Apr 2026 14:24:55 +0000 (17:24 +0300)
ggml/src/ggml-metal/ggml-metal.cpp

index 4dbf8e6fea915ec9cc46e80f69aeb6831cb84de8..6a836e459083e638bad42b0011dd7701306af4e2 100644 (file)
@@ -918,6 +918,10 @@ ggml_backend_reg_t ggml_backend_metal_reg(void) {
         static std::vector<ggml_backend_device_ptr> 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) {