Skip to content

Operator task guide

How to diagnose NCCL and driver errors on rented cloud GPUs

When distributed training or multi-GPU serving hangs on a rented bare-metal or VM cloud instance, separate host infrastructure faults (driver/NVML mismatch, disabled NVSwitch fabric, virtualized PCIe ACS stalls, or uncorrectable ECC pages) from your container software stack inside five minutes before filing a provider ticket.

Prove hardware vs code using bounded single-node diagnostics: dmesg Xid inspection, nvidia-smi nvlink status, a tiny PyTorch distributed barrier test with NCCL_DEBUG=INFO, and an isolated NCCL_IB_DISABLE=1 or NCCL_P2P_DISABLE=1 toggle.

Reviewed . Reference guidance is not a diagnosis of your workload.

Step-by-step method

  1. 1

    Capture host driver and fabric state before touching code

    Verify host kernel driver vs container library parity, check for Xid hardware errors in dmesg, and verify NVLink or PCIe switch links are all active on every rented GPU.

    nvidia-smi
    nvidia-smi nvlink -s
    dmesg -T | grep -iE 'nvrm|xid|nvlink|aer' | tail -n 30
  2. 2

    Pin the exact bootstrap network interface for NCCL

    Cloud GPU instances frequently expose bridge interfaces (docker0, cni0, tailscale0, or extra metadata NICs) that cause NCCL bootstrap sockets to time out connecting across nodes or containers.

    export NCCL_DEBUG=INFO
    export NCCL_DEBUG_SUBSYS=INIT,NET
    export NCCL_SOCKET_IFNAME=^docker0,lo,veth
  3. 3

    Bisect RDMA/IB and PCIe P2P inside a 30-second collective check

    Run a minimal 2-to-8 GPU torchrun all-reduce check. If toggling NCCL_P2P_DISABLE=1 clears a hang on virtualized PCIe instances or multi-GPU RTX/L40S hosts, PCIe ACS or IOMMU P2P routing on the hypervisor is blocking direct GPU transfers.

    torchrun --standalone --nproc_per_node=8 -c "import os, torch, torch.distributed as dist; dist.init_process_group('nccl'); t = torch.ones(1024, device=int(os.environ['LOCAL_RANK'])); dist.all_reduce(t); print('ok', os.environ['LOCAL_RANK'])"

Cloud GPU fault isolation decision matrix

Signals, meanings and actions for how to diagnose nccl and driver errors on rented cloud gpus.
SignalWhat it meansNext action
Failed to initialize NVML: Driver/library version mismatchHost kernel nvidia.ko updated without reboot or container mismatchContact provider for node reboot or re-align container CUDA toolkit.
NCCL socket timeout during bootstrap with private virtual NICsNCCL picked non-routable bridge interfaceSet NCCL_SOCKET_IFNAME to cluster VPC interface or exclude docker/veth.
All-reduce hangs unless NCCL_P2P_DISABLE=1 is setVM IOMMU / PCIe ACS blocks peer-to-peer DMA between GPUsAsk host operator to disable PCIe ACS / configure vIOMMU pass-through.
Xid 74, 79, 95, or inactive NVLink lane in dmesgPhysical GPU board, riser, or NVSwitch defectPreserve dmesg and nvidia-bug-report logs and request provider node replacement.

Evidence checklist

  • Exact nvidia-smi -q summary including UUID, PCI bus ID, and ECC uncorrectable counters
  • nvidia-smi nvlink -s and lspci -vvv link speed output
  • dmesg -T filtered for NVRM Xid and PCIe AER errors
  • NCCL_DEBUG=INFO output showing NET and P2P plugin transport selection

Common mistakes

Debugging model weights for an hour when a rented node lost a GPU off the PCIe bus

Always run a 10-second host inventory plus minimal torchrun barrier smoke test first on fresh rented instances.

Confusing hypervisor PCIe ACS hangs with PyTorch code bugs

PCIe P2P stalls are common on virtualized cloud GPUs when host IOMMU blocks DMA transactions between peer devices.

Frequently asked questions

How do I prove to a cloud GPU provider that an NCCL hang is a host defect?

Attach nvidia-smi nvlink -s, dmesg Xid lines, and results from a minimal PyTorch/nccl-tests all_reduce command showing normal execution only when P2P or one physical GPU index is bypassed.

What causes NVML driver/library version mismatch right after apt upgrade on cloud VMs?

Unattended OS upgrades updated userspace libnvidia-ml while an older nvidia.ko kernel module stays loaded in memory until host reboot or container runtime restart.

Apply the method to your incident

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