Multi-GPU & Distributedcudanvidia-driverpytorchdeepspeed

Why NCCL cannot find InfiniBand and falls back to slow TCP, and how to get it detected again

Error
NCCL INFO NET/IB : No device found. NCCL INFO NET/Socket : Using [eth0]

Also appears as

  • NCCL WARN NET/IB : Got completion with error, opcode, recoverable
  • Multi-node training throughput far below expected, NCCL_DEBUG shows Socket transport instead of IB

Short answer

NCCL falls back to slow TCP sockets when it cannot find a usable InfiniBand device, most often because the IB kernel modules or rdma-core drivers are not installed or loaded, the fabric's subnet manager is not running so ports stay down, or NCCL environment variables point at the wrong network interface. Checking ibstat to confirm the hardware and fabric are actually up is the first step, before touching any NCCL environment variables.

Affects: Multi-node clusters with InfiniBand or RoCE fabric hardware installed, using NCCL through PyTorch, DeepSpeed, or any multi-node training or inference framework

Confirm the fabric is actually up before touching NCCL settings

  1. 1Run ibstat to check whether the InfiniBand HCA is detected and its port state is Active; if it shows Down or Initializing, the problem is at the fabric level, not NCCL.
  2. 2Confirm InfiniBand kernel modules and rdma-core or OFED userspace tools are installed with ibv_devinfo; a missing device here means drivers need to be installed or loaded.
  3. 3If ports show as Initializing rather than Active, check whether a subnet manager (opensm, or a managed switch's embedded SM) is running on the fabric.
  4. 4Set NCCL_DEBUG=INFO and look for NET/IB lines specifically; if you see no device found, confirm NCCL_IB_HCA and NCCL_SOCKET_IFNAME are not accidentally set to the wrong device.
  5. 5If running in a container or Kubernetes pod, confirm /dev/infiniband is mounted into the container, since IB is invisible to a container that cannot see the host's IB devices.

How to confirm this is your problem

  • Multi-node training or serving throughput is far below what InfiniBand hardware should provide, closer to typical Ethernet speeds
  • NCCL_DEBUG=INFO logs show NET/IB no device found followed by falling back to Socket transport
  • ibstat shows the HCA present but port state Down or Initializing rather than Active
  • The same job performs fine on nodes without InfiniBand at all, ruling out a training code bug

Root causes and fixes

Most common

InfiniBand kernel modules or rdma-core/OFED userspace drivers are not installed or not loaded on this host

NCCL's IB transport is built on the ibverbs userspace library, which requires both the appropriate kernel modules and rdma-core, or vendor OFED, to be installed. If either is missing, for example after a fresh OS install, a kernel update that did not rebuild the modules, or a container image built without IB support, ibv_devinfo returns no devices and NCCL silently falls back to sockets without necessarily raising a hard error.

Fix: Install rdma-core (or the vendor's OFED stack) and confirm the relevant kernel modules are loaded, then verify ibv_devinfo lists your HCA before assuming a NCCL-level problem.

Commands
ibv_devinfo
lsmod | grep -i mlx
modprobe mlx5_core
Common

The InfiniBand ports are physically connected and detected, but no subnet manager is running on the fabric

InfiniBand fabrics require a subnet manager, either running on a host via opensm or embedded in a managed switch, to assign LIDs and bring ports to an Active state. Without one running anywhere on the fabric, the physical link can show as connected while never reaching the Active state that NCCL requires, which looks identical to a missing device from NCCL's perspective.

Fix: Confirm a subnet manager is running somewhere on the fabric, either the switch's management interface or a designated host running opensm, then recheck ibstat for Active port state.

Common

NCCL environment variables (NCCL_IB_HCA, NCCL_SOCKET_IFNAME) point NCCL at the wrong network interface, bypassing a functional IB device

In multi-homed servers with both InfiniBand and multiple Ethernet interfaces, NCCL's auto-detection can occasionally pick the wrong interface, or a previous engineer may have hardcoded a socket interface override to fix a different problem and left it in place, which forces NCCL to skip its IB path entirely regardless of hardware.

Fix: Unset any stale NCCL_SOCKET_IFNAME or NCCL_IB_HCA overrides and let NCCL auto-detect first, then only set NCCL_IB_HCA explicitly if auto-detection genuinely picks the wrong one on a multi-HCA host.

Occasional

The training job runs inside a container or Kubernetes pod that does not have the host's InfiniBand devices mounted or exposed

Docker and Kubernetes isolate device access by default; unless /dev/infiniband and the relevant host network configuration are explicitly passed through, the container has no visibility into IB hardware the host itself can see perfectly well, so NCCL inside the container falls back to sockets even though ibstat on the host shows everything working.

Fix: Mount /dev/infiniband into the container explicitly, use an RDMA-aware Kubernetes device plugin if running under Kubernetes, and verify ibv_devinfo works from inside the container, not just on the host.

Rare

A firmware or cabling fault on the HCA or a specific switch port is preventing link negotiation

Physical layer problems, a failing HCA, a bad cable, or a faulty switch port, can prevent InfiniBand link training from completing even when drivers and the subnet manager are correctly configured, and typically affect only one or a few nodes rather than the whole cluster.

Fix: Swap the cable and, if possible, the switch port for an affected node to isolate whether the fault is in the HCA, the cable, or the switch, and check switch-side port error counters for physical layer errors.

Diagnostic commands

Check InfiniBand hardware and link state

ibstat

Port State should read Active and Physical State LinkUp; Down means no link at all (cable or switch port issue), while Initializing with LinkUp usually means no subnet manager is running on the fabric.

Confirm the ibverbs device is visible to userspace

ibv_devinfo

No output or an empty device list means either the kernel modules are not loaded or rdma-core/OFED is not installed; a listed device with correct port info means the driver stack itself is fine and the issue is elsewhere.

Check NCCL's own view of available network transports

NCCL_DEBUG=INFO NCCL_DEBUG_SUBSYS=NET python -c "import torch"

Look specifically for NET/IB lines; no device found after confirming ibv_devinfo shows a device usually points to a NCCL_IB_HCA or NCCL_SOCKET_IFNAME environment variable override.

Confirm IB device access from inside a container, if applicable

docker exec <container> ibv_devinfo

If this returns nothing while the same command on the host shows the device, the container is missing /dev/infiniband passthrough and needs updated container or pod device configuration.

Stopping it from happening again

  • Include ibstat and ibv_devinfo checks in your node provisioning or health-check pipeline so a missing driver or down port is caught before a training job runs on that node.
  • Standardize container images and Kubernetes device plugin configuration to include InfiniBand passthrough by default for any node with IB hardware.
  • Document and monitor which host runs the subnet manager, since a rebooted or decommissioned SM host can silently take the whole fabric down to Initializing state.
  • Avoid hardcoding NCCL_SOCKET_IFNAME or NCCL_IB_HCA as a permanent fix for a one-off problem; if you must set them, document why and revisit when hardware changes.

When this becomes an architecture problem

If InfiniBand hardware is present but was never properly commissioned, no consistent subnet manager, inconsistent driver versions across nodes, or a fabric design that does not match your actual node count and topology, that is a networking and datacenter design gap that needs a proper fabric commissioning pass, not a per-job NCCL workaround.

Frequently asked questions

Does setting NCCL_IB_DISABLE=1 fix a slow InfiniBand setup?

No, that variable forces NCCL to ignore InfiniBand entirely and use TCP sockets, which is useful only as a diagnostic to confirm IB was the source of an error, or as a temporary workaround while you fix the fabric. It makes throughput worse, not better, since it deliberately gives up the faster IB path.

Why does ibstat show my HCA but NCCL still falls back to sockets?

ibstat confirms the hardware and driver are present, but NCCL also needs the port to be in an Active state, which requires a working subnet manager, and needs its own environment variables to not be pointed at the wrong interface. Check both before assuming the hardware itself is the problem.

Can I use InfiniBand for storage and Ethernet for NCCL traffic on the same node?

Yes, but you need to be explicit about it with NCCL_SOCKET_IFNAME or NCCL_IB_HCA if the host has multiple interfaces, since NCCL's auto-detection may not choose the split you intend. Document the intended split clearly so it survives driver or NCCL upgrades.

Related problems

NCCL error during multi-GPU training or inference

An NCCL error during multi-GPU training or inference is almost always a symptom of a rank that crashed, a version mismatch across processes, or bad GPU topology, not a bug in NCCL itself. Enable NCCL_DEBUG=INFO first and read the per-rank logs before touching timeouts or retry logic.

NCCL collective operation timeout during distributed training

An NCCL timeout means one or more ranks did not reach a collective operation (all-reduce, broadcast, all-gather) within the configured window, almost always because a straggler rank is slow or stuck, not because NCCL is malfunctioning. Raising NCCL_TIMEOUT can mask the symptom, but the durable fix is finding and removing the straggler: a data loading stall, an OOM-crashed rank, or a checkpoint write blocking one process.

Multi-node training hangs with no error after rendezvous

A multi-node job that hangs with no error almost always means not every rank actually joined the process group: a mismatched world size, a wrong MASTER_ADDR or MASTER_PORT, a firewall blocking the ephemeral ports NCCL negotiates after rendezvous, or a node that silently OOMed are the four most common causes. Because NCCL blocks silently while waiting for missing ranks, there is often no error at all until you manually intervene or hit a long default timeout.

GPU peer-to-peer (P2P) access not working between GPUs on the same node

GPU peer-to-peer (P2P) access fails when the PCIe topology, IOMMU or ACS settings, or the GPU model itself does not support a direct memory path between two devices, forcing all transfers through the CPU and host memory instead of GPU-to-GPU. Setting NCCL_P2P_DISABLE=1 is a useful diagnostic to confirm P2P is the problem, but it only removes the crash by falling back to a slower path; it does not restore the P2P bandwidth you actually need for good multi-GPU performance.

Guide

On-Prem GPU Cluster Design: Node Sizing, Networking, and Storage

Design an on-prem GPU cluster: node sizing for H100/H200/B200, InfiniBand vs RoCE networking, storage throughput, and rack power for enterprise AI workloads.

Guide

Multi-Node LLM Training Infrastructure: Networking and Storage

Multi-node LLM training infrastructure explained: InfiniBand vs RoCE tradeoffs, storage throughput needs, and cluster topology for enterprise fine-tuning.

Guide

AI Datacenter Power and Cooling Planning for GPU Racks

Plan AI datacenter power and cooling for GPU racks: density thresholds, liquid cooling triggers, PUE targets, and real 2026 numbers for H100 to B200 racks.

Still stuck, or tired of fighting your own infrastructure?

Netray deploys and operates on-prem AI for regulated manufacturers and defense suppliers. We have debugged this stack in production, on air-gapped networks, at scale.