NCCL initialization fails under nsys injection on GB300 aarch64/MNNVL: CUDA error 400 at cuMemImportFromShareableHandle

Hi Nsight Systems team,

We are investigating a NCCL communicator initialization failure when launching a two-node GB300 application under Nsight Systems injection. The failure occurs with deferred collection, before any nsys start.

We have also reported this to the NCCL team: [Issue]: NCCL init fails under Nsight Systems on GB300 aarch64/MNNVL (2.30.7 stack; CUDA error 400) · Issue #2502 · NVIDIA/nccl · GitHub

Environment

  • Two GB300 nodes, four GPUs per node, eight ranks total.

  • Grace-Blackwell, Linux aarch64, containerized deployment.

  • Cross-node NVLink via MNNVL; IMEX daemon reported READY.

  • NVIDIA driver: 580.159.03.

  • Application: Kimi-K3 served by SGLang, TP8.

Application stack PyTorch Reported NCCL version Result under Nsight injection
SGLang 0.5.22 image 2.14.1+cu130 2.30.7 NCCL initialization fails
SGLang 0.5.21 image 2.13.0+cu130 2.29.7 Full capture succeeds and produces a usable report

Both Nsight Systems versions below reproduce the failure on the newer stack:

  • 2026.4.1.191, bundled with the image.

  • 2026.5.1.161, aarch64 CLI package nsight-systems-cli-2026.5.1_2026.5.1.161-1_arm64.deb.

The newer application stack can initialize without Nsight injection. However, the comparison between the two images changes PyTorch and other dependencies as well as NCCL, so we have not isolated an NCCL-only regression.

Failure

Launching the distributed service under nsys launch with deferred collection produces:

transport/p2p.cc:293 (ncclP2pImportShareableBuffer) NCCL WARN
    Cuda failure 400 'invalid resource handle'
transport/p2p.cc:382 (p2pMap) -> 1
transport.cc:246 (ncclTransportP2pSetup) -> 1
RuntimeError: NCCL error: unhandled cuda error

In the public NCCL v2.30.7-1 source, the reported line corresponds to:

CUCHECK(cuMemImportFromShareableHandle(&handle, cuDesc, type));

Source: nccl/src/transport/p2p.cc at v2.30.7-1 · NVIDIA/nccl · GitHub

NCCL’s MNNVL initialization selects FABRIC handles, making this import path a candidate for investigation. We have not captured the actual handle arguments at failure or established whether the fault lies in NCCL, Nsight/CUPTI, the CUDA driver, or another stack difference.

Controls and attempted settings

  • A single-node, four-GPU all-reduce toy under injection does not reproduce the failure.

  • A two-process PyTorch CUDA-IPC toy passes both without injection and under injection on the newer stack.

  • Attempts with NCCL_CUMEM_ENABLE=0, NCCL_P2P_DISABLE=1, or NCCL_NVLS_ENABLE=0 did not avoid failure in our runs.

The NCCL_CUMEM_ENABLE=0 attempt reportedly produced the same source-line warning. This conflicts with the public source’s branch behavior, so effective per-rank settings and runtime-loaded library paths need revalidation. We are not treating that result as proof that the setting is ignored.

NCCL 2.29.7 already contains the same shareable-handle import branch; we are not claiming that FABRIC import was newly introduced in 2.30.

Additional profiler-session symptom

In some other runs, the application initialized, but the deferred profiler session became unavailable after CUDA/NCCL initialization. Later collection/finalization reported “No deferred collections to finalize.”

We do not yet know whether this has the same root cause as the explicit import failure.

Questions

Is this a known interaction involving Nsight Systems injection and NCCL/MNNVL initialization on GB300 aarch64?

Are there recommended trace options, diagnostic logs, or diagnostic builds to distinguish CUDA tracing/injection behavior from NCCL or driver initialization?

The failure is currently reproduced with the full two-node service; a standalone reproducer is not available yet. Would a two-node nccl-tests reproducer or a direct CUDA FABRIC export/import test be more useful?

The linked NCCL issue contains the current environment matrix and source references. Happy to run targeted diagnostics and provide additional results. Thanks!

Can you tell me what was the exact nsys command that you were using?

@tilsche can you take a look at this?

Thanks for looking into this. The following commands were extracted from our service deployment and collection scripts. IP addresses, model paths, output paths, and session names are redacted.

The deployment uses two GB300 nodes with 4 GPUs per node, 8 GPUs total, running Linux aarch64 with MNNVL/IMEX.

We run the following inside the application container on each node. NODE_RANK is 0 on the head node and 1 on the second node; both use the head node’s address for rendezvous.

export NCCL_MNNVL_ENABLE=1
export NCCL_CUMEM_ENABLE=1
export NCCL_GRAPH_MIXING_SUPPORT=1

export NCCL_SOCKET_IFNAME=eth9
export GLOO_SOCKET_IFNAME=eth9
export NCCL_IB_HCA=mlx5_bond_0,mlx5_bond_1,mlx5_bond_2,mlx5_bond_3
export NCCL_IB_GID_INDEX=3
export NCCL_IB_DISABLE=0

export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SGLANG_ENABLE_TP_MEMORY_INBALANCE_CHECK=0

nsys launch \
  --session-new="$SESSION" \
  --trace=cuda,nvtx \
  --cuda-graph-trace=node:nvtx-precapture \
  python -m sglang.launch_server \
  --trust-remote-code \
  --model-path "$MODEL_PATH" \
  --disaggregation-mode decode \
  --disaggregation-transfer-backend fake \
  --disaggregation-decode-extra-slots 16 \
  --nnodes 2 \
  --node-rank "$NODE_RANK" \
  --dist-init-addr "${NODE_A_IP}:20000" \
  --tp-size 8 \
  --dcp-size 8 \
  --dcp-comm-backend fi_a2a \
  --disable-custom-all-reduce \
  --disable-radix-cache \
  --host 0.0.0.0 \
  --port 30000 \
  --watchdog-timeout 1000000 \
  --log-level info \
  --enable-metrics \
  --model-loader-extra-config '{"enable_multithread_load":true,"num_threads":8}' \
  --tokenizer-worker-num 32 \
  --detokenizer-worker-num 32 \
  --max-running-requests 112 \
  --mem-fraction-static 0.94 \
  --mamba-full-memory-ratio 1.03 \
  --flashinfer-autotune-skip-ops trtllm_batch_decode_mla \
  --enable-layerwise-nvtx-marker \
  --cuda-graph-bs-decode \
    1 2 3 4 5 6 7 8 10 12 14 16 18 20 22 24 26 28 30 32 \
    40 44 48 52 56 60 64 72 80 88 96 104 112

The script also sets a deployment-specific PYTHONPATH, omitted here. The model is Kimi-K3. We also observed initialization failure with --dcp-comm-backend a2a.

After the service becomes healthy and reaches steady decode load, the collection script runs the following on each node:

nsys start \
  --session="$SESSION" \
  --sample=none \
  --cpuctxsw=none \
  --discard-environment=true \
  -o "$OUTPUT_DIR/report_$NODE_RANK"

# Approximately 7 seconds later:
nsys stop --session="$SESSION"

For the explicit NCCL initialization failure, the error occurs during the nsys launch phase, before any nsys start command is issued:

transport/p2p.cc:293 (ncclP2pImportShareableBuffer) NCCL WARN
    Cuda failure 400 'invalid resource handle'
transport/p2p.cc:382 (p2pMap) -> 1
transport.cc:246 (ncclTransportP2pSetup) -> 1
RuntimeError: NCCL error: unhandled cuda error

Our recorded stack comparison is:

Application stack PyTorch Reported NCCL Result
SGLang 0.5.22 2.14.1+cu130 2.30.7 Initialization fails under injection
SGLang 0.5.21 2.13.0+cu130 2.29.7 Launch/start/stop completes and produces usable reports

Both Nsight Systems 2026.4.1.191 and 2026.5.1.161 reproduced failure on the newer stack. Since the application stack changes as a whole, this comparison does not isolate an NCCL-only regression or rule out an interaction with these Nsight options.

Separately, in some runs the application initialized, but the deferred session was subsequently unavailable; later collection/finalization reported “No deferred collections to finalize.” We have not established whether that symptom shares the import failure’s cause.

Would you recommend testing a simpler --cuda-graph-trace configuration first, or collecting specific Nsight diagnostics with the command above?

Thanks for sharing the launch and collection commands. This clarifies that CUDA tracing and NVTX pre-capture are enabled, and that the import failure occurs before collection starts.

Please try these changes separately, keeping the rest of the configuration unchanged:

  1. Replace --trace=cuda,nvtx with --trace=cuda-sw,nvtx to force software CUDA tracing instead of hardware tracing (HES).
  2. Replace --cuda-graph-trace=node:nvtx-precapture with --cuda-graph-trace=node:nvtx-live to disable pre-capture recording.

Please report whether each test produces the same error.

For diagnostics, you can enable the following on both nodes before launching the workers:

export NCCL_DEBUG=INFO
export NCCL_DEBUG_SUBSYS=ALL
export NCCL_DEBUG_FILE='/tmp/nccl.%h.%p.log'

For Nsight Systems 2026.4/2026.5 logging, save the following as nvlog.config inside the application container on each node:

+ 75iw 75ef 0IW 0EF global
$ /tmp/nsys.log
ForceFlush
Format $sevc$time|$pid|${tid:5}|${name:0}|${file:0}:${line:0}: $text

Before running your existing launch command, set:

export NVLOG_CONFIG_FILE=/path/to/nvlog.config

To help us reproduce this, could you also provide the failing container image reference and digest, its container launch command, and any code overrides introduced by the omitted PYTHONPATH. Is the failure always reproducible or is it intermittent?

P.S. Separately from this initialization issue, your current --trace=cuda,nvtx configuration does not enable advanced NCCL tracing. Once initialization works, you could try --trace=cuda,nvtx,nccl for more detailed visibility into NCCL CPU scheduling and GPU communication operations, including operations replayed through CUDA graphs. This may be useful for subsequent performance analysis.

Thanks for the diagnostic suggestions. We have partial results from a newly provisioned node pair and have paused further testing due to shared-machine availability.

The new setup has two GB300 aarch64 nodes, with 4 GPUs per node and 8 application ranks total. The recorded software versions are Nsight Systems 2026.4.1.191, PyTorch 2.14.1+cu130, and NCCL 2.30.7.

Baseline: --trace=cuda,nvtx --cuda-graph-trace=node:nvtx-precapture

On this pair, the original cuMemImportFromShareableHandle error did not reproduce. The service reached readiness, and deferred start/stop on the head node generated an .nsys-rep file.

However, the collection window had no workload and contained no CUDA kernel records. No worker-side report was generated, so we have not yet validated workload tracing on both nodes.

The NCCL logs show successful cross-node channel setup over IB. We have not yet verified that this run exercised the same FABRIC import path as the original failure.

Test A: --trace=cuda-sw,nvtx, retaining nvtx-precapture

We attempted this twice. In both attempts, the application reported that detokenizer_0 exited with code -9 (SIGKILL), followed by application cleanup. In the second attempt, decode CUDA graph capture completed approximately one second before the child-process termination was reported.

We did not find the original CUDA error 400 in these runs. The source of SIGKILL remains unknown, so we cannot attribute these terminations to software tracing. We found no matching OOM entries in the host logs checked, but that does not conclusively exclude a memory-related kill.

The internal Nsight log also contains:

Invalid parameter for enabling raw timestamp: 255

We do not know whether this is relevant to the termination.

Test B: --cuda-graph-trace=node:nvtx-live

Not run yet.

Image and source modifications

The recorded image reference is:

iregistry.baidu-int.com/nccl/sglang:v0.5.22-cu130-arm64
sha256:59485f47a2960d07a24fc69559179f0c2853d8347238d5d89f2aa42693a4ee07

This is an internal registry image.

The new containers required a local SGLang device-detection change to recognize the custom GPU name CF-NG-GBZZ3-O-L as an MNNVL-capable device; otherwise SGLang rejected the fi_a2a configuration before the test. The reported PYTHONPATH directory contains benchmark/tokenizer helpers rather than an alternative SGLang package.

The complete container invocation and the source modifications present during the original failing runs still need to be verified.

These results show that the original failure is not reproduced in every tested environment. They do not yet establish whether the difference comes from node configuration, transport selection, source modifications, or timing.

Would the raw-timestamp warning be useful to investigate independently, and is there a preferred diagnostic for identifying the source of the child-process SIGKILL?

Thanks for the diagnostic suggestions. We have now completed both requested tests separately, along with a baseline capture, after correcting issues in our test harness.

The retest setup uses two GB300 aarch64 nodes, with 4 GPUs per node and 8 application ranks total: Nsight Systems 2026.4.1.191, PyTorch 2.14.1+cu130, and NCCL 2.30.7.

We corrected a parameter-propagation issue in our orchestration and verified the effective Nsight launch arguments on both nodes. We also added port checks and started collection only after decode workload was active.

Configuration Initialization Workload capture on both nodes
Baseline: --trace=cuda,nvtx --cuda-graph-trace=node:nvtx-precapture Passed Passed
Test A: --trace=cuda-sw,nvtx --cuda-graph-trace=node:nvtx-precapture Passed Passed
Test B: --trace=cuda,nvtx --cuda-graph-trace=node:nvtx-live Passed Passed

The collection windows were approximately 7 seconds. All three configurations produced reports containing decode GPU kernels and NCCL activity. The recorded kernel counts per GPU were approximately:

  • Baseline: 478,545–481,952.

  • Test A: 480,602–500,488.

  • Test B: 472,026–504,876.

These counts confirm that the captures contain workload activity; they are not intended as a performance comparison.

The original cuMemImportFromShareableHandle / CUDA error 400 did not reproduce in these three runs. Both requested variants worked, and the baseline also worked, so we cannot identify either option as a necessary workaround.

Please disregard the earlier variant-specific conclusions from our partially validated runs: the requested arguments were not reliably propagated in that orchestration. We also found an EADDRINUSE startup failure associated with leftover processes, which confounded some subsequent process-termination observations. We cannot attribute all earlier SIGKILL events to that cause.

These successful retests are on a different node pair from the original failure. We have not yet established that they exercised the same FABRIC-handle import conditions, so they do not establish the cause or resolution of the original error.

Thank you for your help. The current result is that baseline, software CUDA tracing, and NVTX live tracing all successfully initialize and capture workload on this retest setup.

Thanks for the update and for completing the tests. Glad to hear that all three configurations now capture the workload successfully and you can continue profiling. If the original error returns or you uncover anything new, please update this thread and we’ll pick up the investigation.