SGLang NCCL Error and Multi-Node Timeout
Resolve SGLang NCCL errors and multi-node serving timeouts across tensor-parallel workers by fixing /dev/shm, --dist-init-addr, NIC selection, and P2P paths.
SGLang multi-GPU and multi-node NCCL errors typically trace to undersized Docker /dev/shm (64 MB default), unreachable --dist-init-addr or mismatched NCCL_SOCKET_IFNAME across nodes, or blocked PCIe P2P DMA on non-NVLink hosts.
- Symptom
NCCL WARN Error while creating shared memory segment /dev/shm/nccl-- Root cause
- Transport, /dev/shm, --dist-init-addr, or single-rank FlashInfer/CUDA failure broke collective progress across TP workers.
- Recommended fix
NCCL_DEBUG=INFO- How Denpex helps
- Denpex investigates SGLang NCCL Error and Multi-Node Timeout using the evidence you provide or your connected workload collects. Earlier rank, host or application evidence is needed to distinguish an initiating failure from a downstream report.
What this failure is
A tensor-parallel or multi-node SGLang worker timed out or aborted inside NCCL collective initialization or token-generation synchronization.
Is this what broke your run? Paste your log.
You're reading about SGLang NCCL Error and Multi-Node Timeout. Paste your own traceback and relevant evidence for an investigation of your workload, with a next action or a specific missing fact. A reference entry does not establish your cause. No account or card for the free diagnosis. Review data handling before submitting sensitive logs.
Before uploading, review cloud data handling and local options.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
Why it happens (the mechanism)
SGLang coordinates tensor-parallel workers over NCCL and ZMQ. If one worker cannot map POSIX shared memory, binds a Docker bridge IP instead of the cluster data interface, or hits a silent CUDA/FlashInfer error on one rank, peer ranks stall until NCCL aborts.
What you'll observe
- SGLang server hangs during model load or stalls under traffic with NCCL timeout
- Multi-node --nnodes launches fail to complete distributed rendezvous
Common symptoms and what they mean
Check possible explanations against the incident evidence. A matching symptom alone does not establish its cause.
| Symptom | Possible explanation |
|---|---|
| RuntimeError: NCCL error: unhandled system error in sglang worker | Transport, /dev/shm, --dist-init-addr, or single-rank FlashInfer/CUDA failure broke collective progress across TP workers. |
| Watchdog caught collective operation timeout across SGLang TP ranks | Transport, /dev/shm, --dist-init-addr, or single-rank FlashInfer/CUDA failure broke collective progress across TP workers. |
Which systems are affected
- SGLang multi-GPU tensor-parallel servers
- Multi-node SGLang Docker and Kubernetes clusters
How to confirm this is the problem
Use this checklist to test the hypothesis against a small reproduction. No single line proves the root cause, so preserve the preceding events and compare one variable at a time.
- ✓Verify all TP ranks finish model warmup with NCCL_DEBUG=INFO showing clean transport init and serve concurrent requests without watchdog aborts.
Root cause
- Transport, /dev/shm, --dist-init-addr, or single-rank FlashInfer/CUDA failure broke collective progress across TP workers.
The fix and how to prevent it
How to fix it
- Confirm /dev/shm capacity inside the container (df -h /dev/shm) and launch Docker with --shm-size=16g or --ipc=host.
- For multi-node launches, verify --dist-init-addr <head-ip>:<port> is reachable from every node and pin NCCL_SOCKET_IFNAME and GLOO_SOCKET_IFNAME to the data-plane NIC.
- Reproduce with NCCL_DEBUG=INFO to capture the earliest WARN/ERROR line before the timeout.
- On PCIe-only servers without NVLink, test NCCL_P2P_DISABLE=1 as a controlled diagnostic to isolate IOMMU/ACS P2P blocking.
Step-by-step remediation
- 1Inspect df -h /dev/shm and ip addr inside the container.
- 2Run the launch with NCCL_DEBUG=INFO and inspect the first WARN before any timeout.
- 3Confirm --dist-init-addr connectivity and re-test concurrent serving requests.
How to prevent it
- Standardize --shm-size and NCCL_SOCKET_IFNAME in all SGLang Helm/Docker templates
- Check every worker log individually when an API router timeout occurs
Save this diagnosis and catch the next crash automatically
All root cause, fix, and prevention steps above are free to read. Create a free account with any email or GitHub to keep your saved diagnosis history across the encyclopedia and run cloud checks, or use a work email below for the 30-day Team evaluation. No card required.
Or start a 30-day free Team trial (work email)
Verified work email unlocks all 14 fleet diagnostic tools, Slack alerts, and team history for 30 days. No card and no automatic charge.
Searchable error signature
NCCL WARN Error while creating shared memory segment /dev/shm/nccl-
Watchdog caught collective operation timeout: WorkNCCL(SeqNum=12, OpType=ALLREDUCE) timed outUse this text as a lookup key in logs and upstream issue trackers. It is not presented as a captured customer log. Confirm the cause from your own preceding events, versions, configuration and the cited references.
Diagnose your own log automatically
The root cause and fix steps above stay free. Create a free account to analyze full job logs, attribute the first failed rank, and keep saved incident history.
Sign up free. Analyze your cluster logsNo credit card. Daily allowance follows verified trust tier. Instant access.
Why the recommended fix works
Exposing adequate /dev/shm and pinning routable cluster NICs lets NCCL construct intra-node SHM/NVLink and inter-node IB/TCP rings without deadlocking on container bridges.
Code examples
df -h /dev/shm
NCCL_DEBUG=INFO NCCL_SOCKET_IFNAME=eth0 python3 -m sglang.launch_server --model-path YOUR_MODEL --tp 8This snippet illustrates the entry-specific check. Verify the installed versions, permissions, target and workload context before using it. A command or API example is not proof of recovery.
Best practices by model family
| Model / Stack | Recommendation | Notes |
|---|---|---|
| Single-node TP on PCIe GPUs | Verify /dev/shm and test NCCL_P2P_DISABLE=1 if hung | Isolates ACS/IOMMU P2P DMA hangs. |
| Multi-node SGLang | Pin --dist-init-addr, --node-rank, and NCCL_SOCKET_IFNAME | Prevents Docker bridge IP advertisements. |
With the fix vs without the fix
| Dimension | With the fix | Without the fix |
|---|---|---|
| Container IPC | Explicit 16 GiB /dev/shm and matched NIC env | 64 MB default /dev/shm causes silent worker hangs |
| Fault localization | NCCL_DEBUG=INFO across every TP worker | Reading only frontend API router timeout |
Diagnostic note
“API router timeouts in SGLang hide which GPU worker actually failed. Always read worker stderr and host dmesg before raising NCCL timeouts.”
Diagnose this failure in VS Code
Select the traceback or open the failed terminal, then run Denpex locally to inspect matched failure patterns, supporting evidence and next checks without uploading the log. Verify recommendations against your workload before changing production.
Install the free VS Code extensionNCCL errors in context
An NCCL error can follow an earlier worker failure. The hub connects documented collective errors with their interpretation limits, worker evidence and configuration checks.
Compare related nccl errorsFrequently asked questions
Questions engineers and on-call staff commonly ask about this failure.
Should I disable NCCL in SGLang to fix timeouts?
Why does multi-node SGLang hang at startup with no error?
Don't just read the fix, diagnose your run
The encyclopedia explains documented failure patterns. Denpex investigates your logs, configuration and stack, shows the supporting evidence, and asks for missing details when needed.
Related Inference errors
DeepGEMM rejects FP8 block-scaled weights with Unknown SF transformation on an unsupported architecture
Inference · high
SGLang torch.OutOfMemoryError: CUDA out of memory
Inference · high
vLLM NCCL P2P Hang and Timeout in Tensor Parallelism
Inference · high
vLLM CUDA Graph Capture OOM: Startup Fix & Tuning
Inference · high