Skip to content

Commit c29cc57

Browse files
ggerganovarthw
authored andcommitted
metal : workaround macOS GPU interactivity watchdog (ggml-org#22216)
1 parent edbf29a commit c29cc57

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ggml/src/ggml-metal/ggml-metal.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,10 @@ ggml_backend_reg_t ggml_backend_metal_reg(void) {
918918
static std::vector<ggml_backend_device_ptr> devs;
919919

920920
if (!initialized) {
921+
// workaround macOS limitation (kIOGPUCommandBufferCallbackErrorImpactingInteractivity) until proper fix becomes possible
922+
// ref: https://github.com/ggml-org/llama.cpp/issues/20141#issuecomment-4272947703
923+
setenv("AGX_RELAX_CDM_CTXSTORE_TIMEOUT", "1", true);
924+
921925
static ggml_backend_metal_reg_ptr reg_ctx(ggml_backend_metal_reg_init());
922926

923927
for (int i = 0; i < g_devices; ++i) {

0 commit comments

Comments
 (0)