From d88d722fc1f40ea953cbc7329e0beb0df0fb4465 Mon Sep 17 00:00:00 2001 From: Ruben Ortlam Date: Thu, 9 Apr 2026 12:32:08 +0200 Subject: [PATCH] state --- ggml/src/ggml-vulkan/ggml-vulkan.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index d44db3f05..02501a243 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -13406,6 +13406,12 @@ static void ggml_vk_graph_cleanup(ggml_backend_vk_context * ctx) { GGML_LOG_DEBUG("ggml_vulkan: graph_cleanup(%s) binary_semaphore_idx=%zu\n", ctx->name.c_str(), ctx->binary_semaphore_idx); + // Destroy binary semaphores rather than pooling — drivers may hold + // imported sync_fd handles until the semaphore is destroyed. + for (size_t i = 0; i < ctx->gc.semaphores.size(); i++) { + ctx->device->device.destroySemaphore(ctx->gc.semaphores[i].s); + } + ctx->gc.semaphores.clear(); ctx->binary_semaphore_idx = 0; for (auto& [peer, staging] : ctx->device->peer_staging) {