CUDA Graph updates report success but retain stale cluster dimensions on driver 580.159.03

Summary

With libcuda.so.580.159.03, updating an already-launched graph executable from mandatory cluster dimensions (2,1,1) to (2,2,1) reports success, but subsequent launches still use (2,1,1). This reproduces on both H200 and B300. Updating before the first source launch passes.

The reproducer below records %cluster_nctaid.y for all 144 blocks. It uses one stream and no cuBLAS, frameworks, preferred-cluster attributes, or inter-block synchronization.

Environment and results

Ubuntu 22.04 CUDA development containers; one GPU per test; MIG disabled; statically linked CUDA runtime. The host kernel driver remained 580.159.03. Version 595.58.03 was loaded through NVIDIA’s forward-compatibility library; loaded library paths were verified independently of nvidia-smi.

GPU CUDA compiler Loaded libcuda Result after source launch
H200 13.0.88 580.159.03 Stale y=1; 144/144 mismatches
B300 13.0.48 580.159.03 Stale y=1; 144/144 mismatches
H200 13.2.78 595.58.03 Correct y=2
B300 13.2.78 595.58.03 Correct y=2
B300 13.2.78 580.159.03 Stale y=1; diagnostic comparison only

On B300, switching the loaded driver makes the same CUDA 13.2 binary fail on 580 and pass on 595. CUDA 13.2 requires driver >=595.45.04, so its 580 result is only diagnostic. A separate preferred-cluster reproducer built with CUDA 13.0.88 shows the same fail/pass split with an identical binary, supporting a user-space driver cause.

Minimal reproducer

Filename: cuda_graph_regular_cluster_update.cu

#include <cuda_runtime.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>

static void check(cudaError_t status) {
  if (status != cudaSuccess) {
    std::fprintf(stderr, "CUDA error: %s\n", cudaGetErrorString(status));
    std::exit(2);
  }
}

__global__ void probe(unsigned int *output) {
  if (threadIdx.x == 0) {
    unsigned int y;
    asm volatile("mov.u32 %0, %%cluster_nctaid.y;" : "=r"(y));
    output[blockIdx.y * gridDim.x + blockIdx.x] = y;
  }
}

static cudaGraph_t capture(cudaStream_t stream, unsigned int *output, unsigned int y) {
  cudaLaunchAttribute attr = {};
  attr.id = cudaLaunchAttributeClusterDimension;
  attr.val.clusterDim = {2, y, 1};
  cudaLaunchConfig_t config = {};
  config.gridDim = dim3(4, 36, 1);
  config.blockDim = dim3(256, 1, 1);
  config.stream = stream;
  config.attrs = &attr;
  config.numAttrs = 1;
  check(cudaStreamBeginCapture(stream, cudaStreamCaptureModeGlobal));
  check(cudaLaunchKernelEx(&config, probe, output));
  cudaGraph_t graph;
  check(cudaStreamEndCapture(stream, &graph));
  return graph;
}

static bool replay(const char *name, cudaGraphExec_t exec, cudaStream_t stream,
                   unsigned int *output, unsigned int expected) {
  unsigned int values[144], wrong = 0;
  check(cudaMemsetAsync(output, 0, sizeof(values), stream));
  check(cudaGraphLaunch(exec, stream));
  check(cudaMemcpyAsync(values, output, sizeof(values), cudaMemcpyDeviceToHost, stream));
  check(cudaStreamSynchronize(stream));
  for (unsigned int value : values) wrong += value != expected;
  std::printf("%s: expected_y=%u first_y=%u mismatches=%u/144\n",
              name, expected, values[0], wrong);
  std::fflush(stdout);
  return wrong == 0;
}

int main(int argc, char **argv) {
  bool skip = argc == 2 && std::strcmp(argv[1], "--skip-source-launch") == 0;
  if (argc > 2 || (argc == 2 && !skip)) return 2;
  int driver, toolkit;
  check(cudaDriverGetVersion(&driver));
  check(cudaRuntimeGetVersion(&toolkit));
  std::printf("driver_api=%d compiled_toolkit=%d\n", driver, toolkit);
  cudaStream_t stream;
  unsigned int *output;
  check(cudaStreamCreate(&stream));
  check(cudaMalloc(&output, 144 * sizeof(*output)));
  cudaGraph_t source = capture(stream, output, 1), target = capture(stream, output, 2);
  cudaGraphExec_t source_exec, target_exec;
  check(cudaGraphInstantiate(&source_exec, source, 0));
  check(cudaGraphInstantiate(&target_exec, target, 0));
  bool controls_ok = true;
  if (!skip) controls_ok &= replay("source_fresh", source_exec, stream, output, 1);
  controls_ok &= replay("target_fresh", target_exec, stream, output, 2);
  if (!controls_ok) return 3;
  cudaGraphExecUpdateResultInfo info = {};
  cudaError_t status = cudaGraphExecUpdate(source_exec, target, &info);
  std::printf("update: status=%d result=%d\n", status, info.result);
  if (status != cudaSuccess || info.result != cudaGraphExecUpdateSuccess) return 2;
  bool ok = replay("target_updated", source_exec, stream, output, 2);
  check(cudaGraphExecDestroy(source_exec));
  check(cudaGraphExecDestroy(target_exec));
  check(cudaGraphDestroy(source));
  check(cudaGraphDestroy(target));
  check(cudaFree(output));
  check(cudaStreamDestroy(stream));
  std::puts(ok ? "PASS" : "FAIL: successful update retained wrong regular cluster size");
  return ok ? 0 : 1;
}

Both cluster configurations divide the unchanged grid (4,36,1). Fresh source and target executables are checked before the update; each replay ends with cudaStreamSynchronize.

Build and run

Use CUDA 13.0 with loaded libcuda.so.580.159.03 to reproduce. Build for H200:

nvcc -std=c++17 -O2 -arch=sm_90 --cudart=static \
  cuda_graph_regular_cluster_update.cu -o cluster_update_repro
./cluster_update_repro
./cluster_update_repro --skip-source-launch

For B300, replace -arch=sm_90 with -arch=sm_103. The first invocation launches the source before updating; the second skips that launch.

Actual behavior

H200, CUDA 13.0.88, loaded libcuda.so.580.159.03:

$ ./cluster_update_repro
driver_api=13000 compiled_toolkit=13000
source_fresh: expected_y=1 first_y=1 mismatches=0/144
target_fresh: expected_y=2 first_y=2 mismatches=0/144
update: status=0 result=0
target_updated: expected_y=2 first_y=1 mismatches=144/144
FAIL: successful update retained wrong regular cluster size
$ echo $?
1

The failure occurred on every tested run that launched the source first. B300 produces the same mismatch count. The control passes on both GPUs:

$ ./cluster_update_repro --skip-source-launch
driver_api=13000 compiled_toolkit=13000
target_fresh: expected_y=2 first_y=2 mismatches=0/144
update: status=0 result=0
target_updated: expected_y=2 first_y=2 mismatches=0/144
PASS
$ echo $?
0

With CUDA 13.2 and loaded libcuda.so.595.58.03, both invocations report y=2 with zero mismatches and exit 0.

Expected behavior

A successful update should apply the target’s mandatory cluster dimensions. If this change is unsupported, the API should reject it, for example with cudaGraphExecUpdateErrorAttributesChanged, rather than report success and retain stale dimensions. See the graph-update API documentation.

Additional checks and workaround

Separate tests also reproduce after cudaGraphUpload plus synchronization, without a source kernel launch, and through the driver API cuGraphExecUpdate. Instantiating a fresh executable for the target configuration avoids the failure.

SGLang PR #37657 reports a related stale preferred-cluster update causing a cuBLASLt kernel to hang. This reproducer demonstrates incorrect mandatory cluster dimensions without cuBLAS or a hang; it exits with a numerical mismatch.

Diagnostics

Build and run standard error were empty. The complete source and relevant output are inline; no attachments are required to run the test. A full nvidia-bug-report.log.gz has not been collected.

Questions for NVIDIA

Is this a known driver defect, and what is its bug ID and first fixed version? The test passes with 595.58.03; is there also an R580 maintenance release containing the fix?