From 316530e9cf643f0e24220a014b3f219b4c688d75 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Tue, 3 Feb 2026 19:00:50 +0800 Subject: [PATCH] fix cuda graph spams --- ggml/src/ggml-cuda/common.cuh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ggml/src/ggml-cuda/common.cuh b/ggml/src/ggml-cuda/common.cuh index e82777c35..1e8b50321 100644 --- a/ggml/src/ggml-cuda/common.cuh +++ b/ggml/src/ggml-cuda/common.cuh @@ -1140,7 +1140,7 @@ struct ggml_cuda_graph_node_properties { }; static_assert(std::is_trivial::value, "ggml_cuda_graph_node_properties must be trivial"); - +static bool cugraph_warned_rec = false; struct ggml_cuda_graph { #ifdef USE_CUDA_GRAPH ~ggml_cuda_graph() { @@ -1172,8 +1172,12 @@ struct ggml_cuda_graph { } else { number_consecutive_updates = 0; } - if (number_consecutive_updates >= 4 && !disable_due_to_too_many_updates) { - GGML_LOG_DEBUG("%s: disabling CUDA graphs due to too many consecutive updates\n", __func__); + if (number_consecutive_updates >= 4) { + if(!cugraph_warned_rec) + { + cugraph_warned_rec = true; + GGML_LOG_DEBUG("%s: disabling CUDA graphs due to too many consecutive updates\n", __func__); + } disable_due_to_too_many_updates = true; } }