Commit 9ff0d7e90 for llama.cpp

commit 9ff0d7e90f0faaa7c16017e6dcf9cf91c50a100e
Author: Sreeram <sreeram.sivasubramony@amd.com>
Date:   Fri Oct 23 11:47:20 2026 -0700

    CUDA: fix build after chunked CUDA graphs (#30804) (#31053)

    * CUDA: fix build after chunked CUDA graphs (#30804)

    * Apply suggestion from @JohannesGaessler

    Co-authored-by: Johannes Gäßler <johannesg@5d6.de>

    * Fix newlines in common.cuh

    ---------

    Co-authored-by: Johannes Gäßler <johannesg@5d6.de>

diff --git a/ggml/src/ggml-cuda/common.cuh b/ggml/src/ggml-cuda/common.cuh
index 37d0d104c..6b36ca90b 100644
--- a/ggml/src/ggml-cuda/common.cuh
+++ b/ggml/src/ggml-cuda/common.cuh
@@ -1268,7 +1268,7 @@ struct ggml_cuda_graph {
             CUDA_CHECK(cudaGraphExecDestroy(instance));
         }
     }
-    // the ggml graph is captured as a series of CUDA graphs, so the GPU can run one chunk while the next is enqueued
+    // the ggml graph is captured as a series of CUDA graphs, so the GPU can run one chunk while the next is enqueued
     std::vector<cudaGraphExec_t> instances;
     size_t num_nodes = 0;
     std::vector<cudaGraphNode_t> nodes;
diff --git a/ggml/src/ggml-cuda/ggml-cuda.cu b/ggml/src/ggml-cuda/ggml-cuda.cu
index ff9e9a7ea..454d17d78 100644
--- a/ggml/src/ggml-cuda/ggml-cuda.cu
+++ b/ggml/src/ggml-cuda/ggml-cuda.cu
@@ -496,7 +496,7 @@ struct ggml_cuda_pool_leg : public ggml_cuda_pool {
 #ifdef USE_CUDA_GRAPH
         int n_captured = 0;
         for (const auto & [key, graph] : ctx.cuda_graphs) {
-            n_captured += graph->instance != nullptr;
+            n_captured += graph->instances.size();
         }
         if (n_captured > 0) {
             GGML_LOG_DEBUG(GGML_CUDA_NAME " pool[%d]: memory freed, %d captured CUDA graphs must be captured again\n", device, n_captured);