From 1bc7c581d847e25ed626c3fe83e1503a304934d2 Mon Sep 17 00:00:00 2001 From: Lumpiasty Date: Tue, 21 Jul 2026 17:06:16 +0200 Subject: [PATCH] ggml-vulkan: don't assert compute_ctx empty before perf timestamp Pinned async host uploads can record into compute_ctx before graph compute, so the perf logger's opening timestamp must append after them instead of asserting the context is expired. Without this, profiling (GGML_VK_PERF_LOGGER) crashes whenever host-register pinning is on. Assisted-by: Claude --- ggml/src/ggml-vulkan/ggml-vulkan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index f7bcb5afc..9aa7d9883 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -16685,7 +16685,7 @@ static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cg std::fill(ctx->query_nodes.begin(), ctx->query_nodes.end(), nullptr); std::fill(ctx->query_node_idx.begin(), ctx->query_node_idx.end(), 0); - GGML_ASSERT(ctx->compute_ctx.expired()); + // compute_ctx may hold async host uploads recorded before the graph; append the timestamp after them compute_ctx = ggml_vk_get_compute_ctx(ctx); ctx->query_idx = 0; compute_ctx->s->buffer->buf.writeTimestamp(vk::PipelineStageFlagBits::eAllCommands, ctx->query_pool, ctx->query_idx++);