]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
metal: handle command buffer failures gracefully in synchronize (llama/20306)
authorJulian Pscheid <redacted>
Tue, 10 Mar 2026 06:32:24 +0000 (23:32 -0700)
committerGeorgi Gerganov <redacted>
Mon, 16 Mar 2026 11:10:15 +0000 (13:10 +0200)
commitcabe3d95f4403994cc8e6e6fbb58c12e10fb9b88
treefec70c5652c327422df59430ca73f9d65e001ea0
parentae21974f4f3ded7c06f97804527009612a0be948
metal: handle command buffer failures gracefully in synchronize (llama/20306)

Replace GGML_ABORT("fatal error") in ggml_metal_synchronize() with
error flag + return. This aligns synchronize error handling with
graph_compute, which already returns GGML_STATUS_FAILED for the same
condition.

When a command buffer fails (e.g., iOS GPU access revocation during
backgrounding, macOS eGPU disconnect, OOM), the backend enters an
error state instead of killing the host process. Subsequent
graph_compute calls return GGML_STATUS_FAILED immediately. Recovery
requires recreating the backend.

Failed extra command buffers are properly released on the error path
to avoid Metal object leaks.
ggml/src/ggml-metal/ggml-metal-context.m