Setting NCCL_IB_DISABLE=1 permanently to silence Error 2
Falling back to TCP sockets cuts multi-node training bandwidth massively; fix ulimit -l, HCA mounts, or subnet routing instead.
Operator task guide
NCCL numeric return codes map to distinct layers: Error 1 (ncclUnhandledCudaError) means a CUDA call inside NCCL failed; Error 2 (ncclSystemError) means a Linux socket, mmap, /dev/shm, or RDMA syscall failed; Error 3 (ncclInternalError) signals an NCCL invariant or library-version mismatch; Error 4 (ncclInvalidUsage) points to duplicate GPU assignment or bad communicator setup.
Because NCCL wraps the underlying OS or CUDA error into a generic RuntimeError, re-run with NCCL_DEBUG=INFO (plus CUDA_LAUNCH_BLOCKING=1 for Error 1) to print the exact errno, CUDA status, or conflicting library path immediately preceding the wrapper.
Reviewed . Reference guidance is not a diagnosis of your workload.
Capture the first NCCL WARN/ERROR line before the Python RuntimeError wrapper so you see the syscall errno or CUDA error code.
NCCL_DEBUG=INFO NCCL_DEBUG_SUBSYS=INIT,P2P,NET,SHM torchrun --nproc_per_node=8 train.py 2>&1 | grep -iE 'NCCL (WARN|ERROR)|cuda|errno'Error 1 is almost never an NCCL bug. An asynchronous CUDA illegal access, OOM, or hardware Xid poisoned the context before NCCL synchronized. Run with CUDA_LAUNCH_BLOCKING=1 and check dmesg for Xids.
CUDA_LAUNCH_BLOCKING=1 torchrun --nproc_per_node=8 train.py
dmesg -T | grep -iE 'NVRM: Xid|AER'Error 2 points to OS limits or networking: 64 MB /dev/shm exhaustion, ulimit -l memlock limits for RDMA, unreachable NCCL_SOCKET_IFNAME, or blocked ephemeral ports.
df -h /dev/shm
ulimit -l
ip -br addr
ibstatFor Error 3, check for duplicate libnccl.so versions on LD_LIBRARY_PATH vs PyTorch bundled NCCL. For Error 4, check that two ranks are not assigned to the same GPU UUID via bad LOCAL_RANK or CUDA_VISIBLE_DEVICES.
python3 -c "import torch; print(torch.cuda.nccl.version())"
ldconfig -p | grep libnccl
env | grep -E 'RANK|LOCAL_RANK|CUDA_VISIBLE_DEVICES'| Signal | What it means | Next action |
|---|---|---|
| Error 1: ncclUnhandledCudaError | CUDA call inside NCCL failed or context was poisoned. | Re-run with CUDA_LAUNCH_BLOCKING=1 and check host dmesg for Xids. |
| Error 2: ncclSystemError (unhandled system error) | OS socket, shm, memlock, or IB verbs syscall failed. | Check /dev/shm, ulimit -l, NCCL_SOCKET_IFNAME, and firewall/RDMA state. |
| Error 3: ncclInternalError (internal check failed) | NCCL library conflict or broken topology state. | Compare torch.cuda.nccl.version() against ldconfig and verify NVSwitch/P2P topology. |
| Error 4: ncclInvalidUsage | Duplicate GPU ordinal or mismatched communicator rank args. | Verify LOCAL_RANK maps 1:1 to CUDA_VISIBLE_DEVICES per node. |
Falling back to TCP sockets cuts multi-node training bandwidth massively; fix ulimit -l, HCA mounts, or subnet routing instead.
Pip-installed nvidia-nccl-cu* packages can conflict with system /usr/lib/x86_64-linux-gnu/libnccl.so.
Error 1 means CUDA failed on a GPU; check kernel memory access, OOM, or hardware Xids first.
Full encyclopedia runbook for Error 3.
Resolve Error 2 socket, /dev/shm, and RDMA failures.
Browse all NCCL errors and diagnostic variables.
Paste raw NCCL error logs for instant rank triage.
It means NCCL invoked a CUDA runtime/driver function and received an error. Run with NCCL_DEBUG=INFO and CUDA_LAUNCH_BLOCKING=1 to surface the actual CUDA error and check dmesg for hardware Xids.
Most often /dev/shm is capped at 64 MB, ulimit -l is too low for RDMA memory pinning, or NCCL picked an unreachable bridge interface instead of the cluster data NIC.
Verify all nodes run matching PyTorch and libnccl versions without conflicting LD_LIBRARY_PATH entries, and confirm GPU topology (nvidia-smi topo -m) is healthy across NVLink/PCIe.
Two processes attempted to initialize NCCL on the same physical GPU ordinal, usually because LOCAL_RANK was not wired to torch.cuda.set_device(local_rank) or Slurm CUDA_VISIBLE_DEVICES collided with torchrun.
Get the likely cause, supporting evidence, and next safe steps with the same cloud reasoning used by paid plans. A crash the engine recognizes is answered in seconds, then checked by an independent AI review that updates this page when it finishes. A crash it does not recognize waits for the AI's own answer, which can take a few minutes. No account, card, or installation. Logs are masked at Denpex API ingress and are not saved to account history.
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.
No credit card. No automatic subscription. See whether Denpex helps with an incident you already understand.
Up to 50 diagnoses a day for 30 days. Verify your work email to activate an eligible company evaluation, then replay a resolved incident and compare the evidence and next steps with your team's confirmed cause.
Use the three free diagnoses to review your error and relevant evidence. Keep reference guidance separate from the cause and recovery status of your own workload.
Diagnose your incident