InfiniBand Fabric & Diagnostics

How an IB fabric works (Subnet Manager, LIDs, GUIDs, port states), and exactly what ibstat, sminfo, smpquery, ibnetdiscover, ibsim, perfquery, ibdiagnet and friends do, with the scenarios the exam asks about.

1. InfiniBand in plain words

InfiniBand (IB) is a high-bandwidth, low-latency network built for HPC and AI. In a DGX H100 cluster, each node's 8 compute ConnectX-7 adapters (one per GPU, 400 Gb/s NDR each) connect to Quantum-2 IB switches. That's the compute fabric NCCL uses between nodes.

TermMeaning
HCA (Host Channel Adapter)The IB network card in a server (ConnectX-7). Shows as mlx5_0, mlx5_1…
SwitchForwards packets using forwarding tables the SM programs (Quantum-2 for NDR)
SubnetAll HCAs and switches managed by one (master) Subnet Manager
Subnet Manager (SM)The "brain": discovers the fabric, assigns addresses, computes routes, programs switches
RDMARemote Direct Memory Access: one machine reads/writes another's memory without involving its CPU. The basis of IB performance and GPUDirect RDMA.
An IB fabric is a city's road network. The Subnet Manager is city hall: it surveys every road (discovery), hands out street addresses (LIDs), writes the road signs at every junction (switch forwarding tables), and keeps an eye on the city. Without city hall, roads physically exist (LinkUp), but no one has an address and no signs are up, so nothing can be delivered (port state: Init).
Unlike Ethernet, InfiniBand requires a Subnet Manager. Cables can be perfectly fine and ports still won't carry traffic until an SM configures them.
The same RDMA verbs also run over Ethernet as RoCE, including NVIDIA's Spectrum-X platform. There's no Subnet Manager there, so sminfo, ibnetdiscover, and ibdiagnet don't apply. See RoCE & Spectrum-X.

1b. The layers: from cable to NCCL

The InfiniBand spec defines a layered stack, like TCP/IP. It doesn't number its layers, but they line up with the OSI model's layers 1 to 4, with software above, so the table shows the OSI numbers as a guide. Each layer has its own job, header, and tools, so knowing which layer a symptom lives in tells you which tool to reach for.

OSI layerIB layerJobKey ideasCheck it with
5–7Upper layers (software)What applications useThe verbs API (libibverbs, rdma-core); registered memory with keys; consumers like NCCL, MPI/UCX, IPoIB, NVMe-oF, GPUDirect RDMAnccl-tests, NCCL_DEBUG=INFO ("NET/IB"), ibv_devinfo
4TransportEnd-to-end delivery between two queue pairs (QPs), in the HCA's hardwareBTH header: destination QP, packet sequence number, opcode (Send, RDMA Write, RDMA Read). Service types: RC (reliable connected, what NCCL uses: acks and retransmits in hardware), UC, UD. QP0/QP1 carry management (section 6).ib_write_bw, ib_read_lat (perftest)
3NetworkRouting between subnetsGRH header with 128-bit GIDs. Optional inside one subnet, which is the usual cluster case.ibv_devinfo -v (GID table)
2LinkHop-by-hop delivery inside one subnet, losslessLRH header with source/destination LIDs; switches forward by LID using tables the SM programs. Credit-based flow control: a port only sends when the next hop has buffer space, so IB doesn't drop packets for congestion. Virtual lanes (VLs) share one cable; VL15 is reserved for SM traffic. Logical port state: Init → Armed → Active.ibstat (State, Base lid), perfquery (PortXmitWait = waiting for credits), ibtracert
1PhysicalBits on the wireLanes and width (4x), signaling rate (NDR: 100 Gb/s per lane, 400 Gb/s per 4x port), cables and optics, FEC and BER. Physical state: Polling → LinkUp.mlxlink, ibstat (Rate, Physical state), ibdiagnet (section 5b)

One IB packet carries a header per layer, in order:

| LRH (link: LIDs, VL) | GRH (network: GIDs, optional) | BTH (transport: QP, PSN) | payload | ICRC | VCRC |

The two checksums map to the layers too: the ICRC (invariant) covers the fields that never change and is checked end to end; the VCRC (variant) is recomputed on every hop because the link header changes there.

Shipping a parcel: the physical layer is the road surface, the link layer is local delivery between depots in one city (LIDs as street addresses, credits as "only drive when the next depot has room"), the network layer is the inter-city address (GID), and the transport layer is the tracking number and signature on delivery (QP and sequence numbers, acks). Verbs are the shop counter where you hand over the parcel.
Troubleshoot bottom-up. Physical (mlxlink: link up, right width and speed, BER OK) → link (ibstat: State Active with a LID, so the SM did its job) → transport (ib_write_bw between two nodes) → application (nccl-tests). A failure at one layer makes every layer above it fail too, so start at the bottom.
RoCE keeps the top and swaps the bottom. RoCEv2 replaces the IB physical, link, and network layers with Ethernet, IP, and UDP (port 4791), but keeps the BTH and everything above it, which is why the same verbs and NCCL code run on both. Losslessness then comes from PFC (priority pause frames) instead of credits, with ECN-based congestion control on top.

2. Identities: GUID, LID, GID

IDSizeAssigned byPersistent?Used for
GUID (node GUID, port GUID, system image GUID)64-bitBurned in by the manufacturerYes (hardware identity)Uniquely identifying a device/port, like a MAC address
LID (Local Identifier)16-bitThe Subnet ManagerUsually kept, but can changeRouting inside the subnet. Most diag tools take a LID as the target.
GID128-bitSubnet prefix + port GUIDYesGlobal addressing (like IPv6), routing across subnets
GUID = who you are (birth certificate). LID = where you live (street address handed out by city hall/the SM). Base lid: 0 (or 65535, the unassigned value 0xffff, on mlx5 adapters) means you haven't been given an address, so there's no working SM.

3. The Subnet Manager: master, standby, priority

What the SM does

  1. Sweeps (discovers) the fabric using direct-routed management packets.
  2. Assigns LIDs to every HCA port and switch.
  3. Computes routes (routing engines such as min-hop, up/down, ftree for fat trees, adaptive routing on Quantum switches).
  4. Programs switch forwarding tables (LFTs) and moves ports to Active.
  5. Runs the Subnet Administrator (SA): a database that apps query for path records (how to reach LID X).
  6. Handles partitions (PKeys), QoS, and re-sweeps when links change (traps from switches).

Where it runs

Master election: several SMs, one boss

For redundancy you run more than one SM. They negotiate, and exactly one becomes MASTER while the others are STANDBY. Standbys poll the master, and if it disappears, a standby takes over (handover / failover).

RuleDetail
1. Highest priority winsSM priority is 0–15, and 15 is highest. Set in OpenSM with sm_priority in opensm.conf or opensm -p 15.
2. Tie-break: lowest GUID winsIf priorities are equal, the SM with the lowest port GUID becomes master.
SM states0 NOTACTIVE, 1 DISCOVERING, 2 STANDBY, 3 MASTER (shown by sminfo)
"Priority high, GUID low." 15 beats 14. With equal priority, the smaller GUID wins.
Moving the master on purpose (a permanent change, not a failover): give the new master the strictly higher priority, and the old one a lower priority. Raising the new one to match isn't enough, because a tie goes to the lower GUID. OpenSM reads sm_priority only when it starts, so restart each SM after editing it, the standby first, and only while the other SM is running. A running master hands over to a higher-priority SM it discovers. Confirm with sminfo on both LIDs. Practise it in lab ticket CHG-2350.
Having two SMs that both think they're master on one fabric (for example two unrelated OpenSM instances on separate subnets that got joined) causes LID churn and instability. Plan exactly one master with clear priorities, and keep the others as standby.

4. Port states and physical states

ibstat shows two separate things for each port. Learn both columns.

Physical state (the wire)Meaning
LinkUpElectrical/optical link established with the partner. Cable OK.
PollingTrying to find a partner: no cable, bad cable, far end down, or a mismatch
DisabledPort administratively disabled (for example with ibportstate disable)
Sleep / LinkErrorRecoveryLow power / recovering from errors
Logical port state (the SM's view)Meaning
DownNo physical link
Initializing (Init)The link is physically up, but the SM hasn't configured it (no SM, SM can't reach it, or the SM hasn't swept yet)
ArmedConfigured, about to go active (brief)
ActiveFully configured. Can carry traffic.
The classic combination: State: Initializing + Physical state: LinkUp = cable fine, no working Subnet Manager. State: Down + Physical state: Polling = cable / partner problem.

5. Speeds and widths

NamePer lane (approx)4x portTypical
EDR25 Gb/s100 Gb/sConnectX-5
HDR50 Gb/s200 Gb/sConnectX-6, DGX A100
NDR100 Gb/s400 Gb/sConnectX-7, DGX H100, Quantum-2
XDR200 Gb/s800 Gb/sNext generation (ConnectX-8, Quantum-X800)
ibstat showing Rate: 200 on an NDR fabric → the link came up degraded (fewer lanes or lower speed): a bad cable/transceiver, dirty optics, or a port problem. Check with iblinkinfo, mlxlink, and ibdiagnet. It's not a software tuning issue.

5b. Physical layer: 400G cables, BER, and FEC

Most "slow or flaky link" problems are physical: a cable, an optic, a connector, or a port. This section covers what connects the ports, how link quality is measured (BER), and how to read mlxlink to find a bad cable.

Cable and optic types

TypeWhat it isReach at 400G (rough)Notes
DAC (Direct Attach Copper), passiveA copper cable with the connectors molded on each end. No electronics in the signal path.Only a few metersCheapest, lowest power, lowest latency. Used inside a rack (server to top-of-rack switch, or switch to switch). Thick, heavy, and has a minimum bend radius.
ACC (Active Copper Cable)Copper with small signal-boosting chips in the connectorsA bit longer than a DACBridges the gap between DAC and optics; thinner cable.
AOC (Active Optical Cable)Fiber with the optics built permanently into both endsTens of metersFixed length; no separate transceivers to clean.
Transceivers + fiberPluggable optical modules (multimode for shorter runs, single-mode for longer) plus separate fiber patch cablesTens of meters (multimode) to hundreds of meters or more (single-mode)Needed between rows and to spine switches. Connectors must be clean; dirt is a classic cause of errors.

NDR ConnectX-7 and Quantum-2 ports use the OSFP form factor (some adapters use QSFP112). Switch-side "twin-port" OSFP cages carry two 400G links, so splitter cables (one 800G end to two 400G ends) are common. Always use cables rated for the port speed: an older HDR-rated cable in an NDR port typically links at 200, not 400.

Exact reach limits depend on the specific cable part number. Check the vendor's cable spec (NVIDIA LinkX for NVIDIA fabrics) rather than memorizing one number.

For form factors (OSFP, QSFP112, flat-top vs finned-top), fiber and connectors, the eye diagram, module diagnostics (DDM), and transceiver firmware, see the transceivers, cables & signal quality guide.

Why 400G links always have errors, and why that's OK

NDR runs each lane at about 100 Gb/s using PAM4 signaling: four voltage levels per symbol instead of two. That doubles the data per symbol but shrinks the gap between levels, so noise flips bits far more easily. At these speeds some bit errors are normal. The link fixes them with FEC (Forward Error Correction, Reed-Solomon codes): the sender adds redundant data, and the receiver uses it to repair corrupted bits on the fly, without retransmitting.

FEC is like a spell-checker that silently fixes typos as you read. A few typos per page are fine; the text still reads perfectly. But if a page has so many typos that the spell-checker gives up, you get garbled words (uncorrectable errors), and the page has to be sent again.

The BER metrics

BER (Bit Error Rate) = errored bits ÷ total bits received. It's written in scientific notation: 1E-12 means one bad bit per trillion. Smaller is better. Because of FEC there are two BERs to read:

Metric (mlxlink naming)MeasuredWhat it tells youHealthy
Raw Physical BER (also per-lane raw errors)Before FECHow noisy the physical channel (cable, optic, connector, port) really isLow and stable, similar on every lane, and well below the FEC's correction limit
Effective Physical BER / Effective Physical ErrorsAfter FECErrors the FEC couldn't fix. These become corrupted packets that are dropped and resent.Zero (or essentially zero)
Symbol errors / Symbol BERAfter FEC, at the symbol levelSimilar to effective errors; reported on newer firmwareZero
Link Down Counter / Link Error Recovery CounterEventsThe link dropped, or had to retrainNot increasing
Read it like this. Effective (post-FEC) errors above zero = a real problem: packets are being corrupted. Raw (pre-FEC) BER is the early warning: if it's much higher than on similar links, rising over time, or one lane is far worse than the others, the cable or optic is marginal and likely to fail soon. Compare against the thresholds your tools flag (ibdiagnet and UFM have built-in BER checks), and against healthy links in the same fabric.

Interactive: what a BER means at line rate

Notice how even a "small" raw BER means many errors per second at 400 Gb/s. That's why FEC is mandatory, and why the post-FEC number is the one that must be zero.

Reading mlxlink

mlxlink is part of MFT (NVIDIA Firmware Tools). Start the tools with mst start; device names come from mst status, or you can use the mlx5_X RDMA name.

mlxlink -d mlx5_0                # link summary: state, speed, width, FEC mode in use
mlxlink -d mlx5_0 -m             # module / cable info: type (copper or optical), length, vendor, part number;
                                 #   for optics also temperature, TX/RX optical power per lane
mlxlink -d mlx5_0 -c             # counters: raw BER, effective BER, per-lane raw errors, link down / recovery
mlxlink -d mlx5_0 --pc           # clear the counters (start a fresh measurement window)
mlxlink -d mlx5_0 -e             # eye opening per lane (signal quality margin)

Counters only mean something over a time window and under traffic. Clear them, run load (for example ib_write_bw on that link, or an nccl-tests run), then read them again. mlxlink can also query switch ports remotely, and recent ibdiagnet versions can collect physical-layer and BER data for every port in the fabric in one run.

Passive DACs contain only an ID chip (EEPROM): -m shows their type, length, and part number, but there's no optical power or temperature to read. Those diagnostics exist only for active cables and optics.

Troubleshooting flow: is it the cable, the optic, or the port?

  1. Find suspects: ibdiagnet / ibqueryerrors / UFM alerts, links at the wrong rate in iblinkinfo, or a slow rail in nccl-tests.
  2. Check the cable is right: mlxlink -m shows the type and part number. Is it rated for 400G, and within its length limit?
  3. Measure: mlxlink --pc, run traffic, then mlxlink -c. Look for effective errors, high raw BER, or one bad lane. For optics, compare RX power per lane.
  4. Cheapest fixes first: reseat both ends (a DAC that isn't fully latched is common). For optics, inspect and clean the fiber connectors. Check the DAC isn't kinked or bent past its bend radius.
  5. Isolate: move the cable to a known-good port, or put a known-good cable in the suspect port. If the errors follow the cable, replace the cable. If they stay with the port, suspect the port, the HCA, or the switch (and its firmware).
  6. Confirm: clear counters, re-test under load, check the rate is back to 400 with zero effective errors, then return the node to service. While waiting for a part, drain the node or disable the port (ibportstate ... disable) so jobs don't run on a flaky link.
A link that is Active at Rate: 400 can still be bad. Speed and state only prove the link trained. Errors under load (effective BER, symbol errors, rising link-down or recovery counters) are what reveal a marginal cable. And the fix for a high-BER link is physical (reseat, clean, replace), never an NCCL setting.

400G Ethernet (RoCE / Spectrum-X) uses the same PAM4 + FEC physics and the same cable families. mlxlink works on ConnectX Ethernet ports too, and the Linux tools are ethtool -m <if> (module info), ethtool --show-fec <if> (FEC mode), and ethtool -S <if> (look for the FEC and PHY error counters). See the RoCE & Spectrum-X guide.

6. How the tools talk: SMPs, SA, PMA

IB management uses special packets called MADs (Management Datagrams). Knowing the three kinds explains which tool needs what:

KindGoes toTools
SMP (Subnet Management Packet), on QP0 / VL15Directly to a device's management agent. Works even with direct routing (hop by hop) before LIDs exist.smpquery, sminfo, ibnetdiscover, ibroute, ibportstate, the SM itself
SA query (GMP on QP1)The master SM's Subnet Administrator databasesaquery (and every RDMA app asking for path records)
PMA (Performance Management Agent, GMP)Port counters on any deviceperfquery, ibqueryerrors
Most of these tools come from the infiniband-diags package (part of rdma-core / MLNX_OFED / DOCA-OFED) and generally need root (access to /dev/infiniband/umad*). Use -C mlx5_X -P 1 to choose which local HCA/port sends the query.

7. The toolbox: every command explained

ToolScopeWhat it doesTypical use
ibstatLocal HCAs onlyShows each local CA and port: State, Physical state, Rate, Base lid, SM lid, Port GUID, Link layer"Is my port up, at what speed, and does it see an SM?"
ibstatusLocalSimilar summary (reads sysfs)Quick port check
ibv_devinfoLocalVerbs-level device info (from rdma-core)"Can RDMA verbs see the device?"
ibdev2netdevLocalMaps mlx5_X ↔ network interface (ib0, ibp...)NCCL_IB_HCA / IPoIB mapping
sminfoFabric (one SM)Queries the SMInfo attribute: SM LID, GUID, priority, state (MASTER/STANDBY), activity count. With no target, it asks the master SM the local port knows."Who is the master SM? Is it alive? What priority?"
smpqueryAny node by LID/GUID/direct routeSends an SMP to read one attribute: nodeinfo, nodedesc, portinfo, switchinfo, pkeys, sl2vl, vlarb, guids"Tell me details about LID X", for example its hostname (nodedesc) or port speed (portinfo)
ibnetdiscoverWhole fabricWalks the fabric and prints the topology: every switch, HCA, and link (with GUIDs, LIDs, ports, node descriptions)"Map the fabric / verify cabling matches the design"
ibhosts / ibswitchesWhole fabricList just the HCAs / switches (built on discovery)Inventory
iblinkinfoWhole fabricEvery link with its width/speed and state, switch port by switch portFind links at the wrong speed or width
perfqueryOne portReads port counters: SymbolErrorCounter, LinkDownedCounter, PortRcvErrors, PortXmitDiscards, data/packet counts (-x extended, -R reset)"Is this link taking errors?"
ibqueryerrorsWhole fabricScans error counters across all ports and reports those above thresholdsFabric-wide error sweep
ibrouteOne switchDumps a switch's forwarding table (LFT)Routing debug
ibtracertPathTraces the hop-by-hop path between two LIDs"Which switches does traffic from A to B cross?"
ibpingTwo nodesIB-level ping (needs ibping -S on the target)Basic reachability
saquerySA (master SM)Queries the SA database: nodes, path records, multicast groups"What does the SM think exists?"
ibportstateOne portQuery or change a port: enable/disable/reset, speed/widthBounce a flapping port, disable a bad link
ibaddrLocal / targetShows the LID and GID of a portAddress lookup
ibdiagnetWhole fabricNVIDIA's comprehensive fabric diagnostic: discovery, duplicate GUIDs/LIDs, link speed/width, error counters, routing checks, cable info, report filesBring-up acceptance and full fabric health
mlxlinkOne port (MFT)Physical-layer detail: eye/BER, cable/transceiver info, FECDiagnose a bad cable or optic
flint / mlxfwmanagerLocal (MFT)Query/burn HCA firmware (see the MFT guide)Firmware consistency
ib_write_bw etc. (perftest)Two nodesRDMA bandwidth/latency benchmarksProve a link reaches line rate
ibsimSimulated fabricAn InfiniBand fabric simulator: emulates a fabric from a topology file so management software (OpenSM, diags) can be tested without real hardwareDevelopment/testing. Not used to diagnose a real fabric.
opensmFabricThe Subnet Manager daemon itselfRun/configure an SM

8. The confusing four (plus ibsim)

ibstatsminfosmpqueryibnetdiscoveribsim
Looks atYour own HCA portsThe Subnet ManagerOne attribute of one nodeThe whole fabric's topologyA fake fabric
Needs the fabric?No (local)YesYesYesNo (simulated)
Answers"Is my port Active, at 400, with a LID, and which LID is the SM?""Who is master SM? GUID, LID, priority, state?""What's the name / port info / node info of LID X?""What's connected to what?""Can I test SM software without hardware?"
Master SM?Gives the SM lid only (no state/priority/name)Yes: the authoritative answerTurns the SM's LID into a hostname (nodedesc)Shows nodes but doesn't say which runs the master SMNo
ibstat = "me" (local status). · sminfo = "the boss" (SM info). · smpquery = "ask anyone one question" (SMP query). · ibnetdiscover = "draw the map". · ibsim = "pretend fabric" (simulator, a distractor).
For "identify the master SM": sminfo gives its LID/GUID/priority/state, then smpquery nodedesc <LID> tells you which machine it is. That pairing is the answer pattern: sminfo + smpquery.

9. Workflow: find the master SM

Step 1: what does my port see?

$ ibstat mlx5_0
CA 'mlx5_0'
        CA type: MT4129
        Number of ports: 1
        Firmware version: 28.39.1002
        Port 1:
                State: Active
                Physical state: LinkUp
                Rate: 400
                Base lid: 57
                LMC: 0
                SM lid: 1
                Port GUID: 0xb83fd20300a1b2c4
                Link layer: InfiniBand

Port is Active at 400 and has LID 57. The SM it's using lives at LID 1. That's a pointer, but not proof of state or priority.

Step 2: ask the SM itself

$ sminfo
sminfo: sm lid 1 sm guid 0x0002c90300ab1234, activity count 4183027 priority 15 state 3 SMINFO_MASTER

Step 3: which machine is LID 1?

$ smpquery nodedesc 1
Node Description:.........ufm-01 HCA-1

$ smpquery nodeinfo 1          # node type, GUIDs, port count
$ smpquery portinfo 1 1        # LID, state, speed/width of port 1 on LID 1

The master SM runs on ufm-01.

Step 4: find the standby SMs

$ saquery -s                     # SA query: ports advertising the IsSM capability (i.e. running an SM) → their LIDs
$ sminfo 12                      # query the SM at LID 12 directly
sminfo: sm lid 12 sm guid 0x0002c90300ab5678, activity count 900311 priority 14 state 2 SMINFO_STANDBY
$ smpquery nodedesc 12
Node Description:.........ufm-02 HCA-1
saquery options differ a bit between infiniband-diags versions (check saquery --help). The universal method: get candidate LIDs (from your design, UFM, or discovery), run sminfo <lid> on each, and look for STANDBY vs MASTER.

Step 5 (optional): change who's master

# OpenSM: /etc/opensm/opensm.conf
sm_priority 15        # on the intended master
sm_priority 14        # on the standby
# or start with:  opensm -p 15
# UFM: set SM priority / HA in the UFM configuration
Summary chain: ibstat (SM lid) → sminfo (confirm MASTER, GUID, priority, alive) → smpquery nodedesc (hostname).

Practice this on a live mock fabric in the hands-on lab below: start with ticket SM-1001.

9b. Hands-on lab: six simulated fabric tickets

A mock fabric you work like the real thing: three Quantum-2 switches (leaf01, leaf02, spine01), a head node, two OpenSM servers (sm01, sm02), and four DGX nodes (two compute HCAs each, to keep output short). Pick a ticket, start with cat notes.txt, and type help for the commands. State carries through, as on a real fabric:

Outputs are simplified mock-ups modeled on how the real tools behave, not exact copies. Every name, GUID, and version is a placeholder. Up/Down arrows recall history; Tab completes commands, hosts, and paths. Supported shell features: pipes to grep, head, tail, wc, sort, and uniq; > redirects; ; and &&; pdsh -w dgx[01-04] "cmd".
Ticket checklist
    Answer key for this ticket (spoilers)

    One clean path. Other orders work too: the checklist tracks results, not exact commands.

    10. More workflows

    A. Bring-up: are all ports healthy?

    ibstat                              # on every node: all 8 compute ports Active, LinkUp, Rate 400
    iblinkinfo                          # fabric-wide: any link not 4X NDR?
    ibdiagnet                           # full report: errors, speeds, duplicate GUIDs/LIDs, routing
    ibqueryerrors                       # counters above threshold

    B. Verify cabling matches the design

    ibnetdiscover > fabric.topo         # current topology
    ibhosts; ibswitches                 # inventory: expected number of HCAs and switches?
    # compare against the planned topology (ibdiagnet can also compare to a reference topology)

    C. Investigate one suspicious link

    perfquery <lid> <port>              # SymbolErrorCounter, LinkDownedCounter, PortRcvErrors...
    perfquery -x <lid> <port>           # extended 64-bit data counters
    perfquery -R <lid> <port>           # reset counters, then watch whether they grow
    smpquery portinfo <lid> <port>      # speed/width actually negotiated
    mlxlink -d mlx5_0 -m                # physical layer, cable/module info (MFT)
    ibportstate <lid> <port> reset      # bounce the port (careful in production)

    D. Trace a path between two nodes

    ibtracert 57 112                    # hop-by-hop path from LID 57 to LID 112
    ibroute <switch-lid>                # that switch's forwarding table

    11. Port-state decoder

    12. "Which tool?" chooser

    Pick a question above.

    13. Sample outputs

    What the commands in this guide print. Expand a command to see a typical result and what to check in it.

    Illustrative output, not captured from a real system. Hostnames, serial numbers, GUIDs, MAC and IP addresses are invented, and columns and wording vary between versions. Learn the shape of each output and the fields called out under it.
    mlxlink -d mlx5_0Physical link summary and recommendation
    Operational Info
    ----------------
    State                              : Active
    Physical state                     : LinkUp
    Speed                              : IB-NDR
    Width                              : 4x
    FEC                                : Standard_RS-FEC - (544,514)
    Loopback Mode                      : No Loopback
    Auto Negotiation                   : ON
    
    Supported Info
    --------------
    Enabled Link Speed                 : 0x00000080 (NDR)
    Supported Cable Speed              : 0x000000fe (NDR,HDR,EDR,FDR,FDR10,QDR,SDR)
    
    Troubleshooting Info
    --------------------
    Status Opcode                      : 0
    Group Opcode                       : N/A
    Recommendation                     : No issue was observed
    
    Tool Information
    ----------------
    Firmware Version                   : 28.39.1002
    amBER Version                      : 3.2
    MFT Version                        : mft 4.26.1-3

    What to look at: Healthy NDR is State Active, Physical state LinkUp, Speed IB-NDR, Width 4x and an RS-FEC mode. Width 2x or 1x, a lower speed such as IB-HDR, Physical state Polling, or a Recommendation other than 'No issue was observed' points at the cable, optic or port.

    mlxlink -d mlx5_0 -mModule/cable identity and optical power
    Module Info
    -----------
    Identifier                         : OSFP
    Compliance                         : 400GBASE-SR4
    Cable Technology                   : 850 nm VCSEL
    Cable Type                         : Optical Module (separated)
    OUI                                : Nvidia
    Vendor Name                        : NVIDIA
    Vendor Part Number                 : MMA4Z00-NS400
    Vendor Serial Number               : MT2301X00001
    Rev                                : A6
    Wavelength [nm]                    : 850
    Transfer Distance [m]              : 50
    FW Version                         : 47.171.0
    Digital Diagnostic Monitoring      : Yes
    Power Class                        : 8.5 W max
    Temperature [C]                    : 51 [-5..75]
    Voltage [mV]                       : 3285 [3135..3465]
    Bias Current [mA]                  : 7.412,7.388,7.450,7.401 [5.5..10]
    Rx Power Current [dBm]             : 0.912,1.104,0.807,1.011 [-7.6..4]
    Tx Power Current [dBm]             : 1.203,1.287,1.115,1.198 [-5.6..4]
    Module State                       : Ready state
    Rx LOS [per lane]                  : 0,0,0,0
    Tx Fault [per lane]                : 0,0,0,0

    What to look at: Check the module type (copper DAC vs optical), part number and firmware against the recipe, and compare the per-lane Rx power values. A lane reading around -40 dBm (no light) or far below its neighbours means a dirty or damaged fiber or a failing far-end laser, and passive DACs show no power or temperature at all.

    mlxlink -d mlx5_0 -cRaw and effective BER counters
    Physical Counters and BER Info
    ------------------------------
    Time Since Last Clear [Min]        : 412.3
    Effective Physical Errors          : 0
    Effective Physical BER             : 15E-255
    Raw Physical Errors Per Lane       : 498210,476931,521877,503466
    Raw Physical BER                   : 2E-10
    Link Down Counter                  : 0
    Link Error Recovery Counter        : 0
    Symbol Errors                      : 0
    Symbol BER                         : 15E-255

    What to look at: Effective Physical Errors must be 0 (15E-255 is how mlxlink prints 'no post-FEC errors'), and the raw errors should be similar on every lane. Nonzero effective errors, a climbing Link Down Counter, or one lane with far more raw errors than the others means a marginal cable or optic; clear with --pc and re-read under traffic before judging.

    ibstat mlx5_0Local HCA port state, rate, LIDs
    CA 'mlx5_0'
            CA type: MT4129
            Number of ports: 1
            Firmware version: 28.39.1002
            Hardware version: 0
            Node GUID: 0xb83fd20300a1b2c4
            System image GUID: 0xb83fd20300a1b2c4
            Port 1:
                    State: Active
                    Physical state: LinkUp
                    Rate: 400
                    Base lid: 57
                    LMC: 0
                    SM lid: 1
                    Capability mask: 0xa751e848
                    Port GUID: 0xb83fd20300a1b2c4
                    Link layer: InfiniBand

    What to look at: You want State Active, Physical state LinkUp, Rate 400 and a nonzero Base lid and SM lid. State Initializing with LinkUp means the cable is fine but no Subnet Manager has configured the port, Physical state Polling means no signal from the far end, and Rate 200 on an NDR fabric means a degraded link.

    sminfoIdentify the master Subnet Manager
    sminfo: sm lid 1 sm guid 0x0002c90300ab1234, activity count 4183027 priority 15 state 3 SMINFO_MASTER

    What to look at: State 3 SMINFO_MASTER at the expected priority confirms the master SM, and the activity count should increase if you run it again a few seconds later. A timeout ('_do_madrpc: recv failed') or an activity count that never changes means the SM is dead or unreachable.

    smpquery nodedesc 1Hostname behind a LID
    Node Description:.........ufm-01 HCA-1

    What to look at: Use it right after sminfo to turn the SM's LID into a machine name. If the description is an unexpected host (for example a DGX node instead of the UFM or SM server), a rogue SM has taken over the fabric.

    smpquery portinfo 57 1Negotiated width/speed of one port
    # Port info: Lid 57 port 1
    Mkey:............................<not displayed>
    GidPrefix:.......................0xfe80000000000000
    Lid:.............................57
    SMLid:...........................1
    CapMask:.........................0xa751e848
    LocalPort:.......................1
    LinkWidthEnabled:................1X or 4X
    LinkWidthSupported:..............1X or 4X
    LinkWidthActive:.................4X
    LinkState:.......................Active
    PhysLinkState:...................LinkUp
    LinkDownDefState:................Polling
    LMC:.............................0
    NeighborMTU:.....................4096
    OperVLs:.........................VL0-7
    ...
    LinkSpeedExtActive:..............106.25 Gbps
    LinkSpeedExtSupported:...........14.0625 Gbps or 25.78125 Gbps or 53.125 Gbps or 106.25 Gbps
    LinkSpeedExtEnabled:.............14.0625 Gbps or 25.78125 Gbps or 53.125 Gbps or 106.25 Gbps

    What to look at: For NDR the meaningful fields are LinkWidthActive 4X and LinkSpeedExtActive 106.25 Gbps per lane; the legacy LinkSpeedActive field is not the NDR speed. LinkWidthActive 2X or 1X, or a lower LinkSpeedExtActive, confirms a degraded link on that specific port.

    saquery -sList every port running an SM
    PortInfoRecord dump:
            EndPortLid...............1
            PortNum..................1
            CapabilityMask...........0xa751e84a
            LinkState................Active
    PortInfoRecord dump:
            EndPortLid...............12
            PortNum..................1
            CapabilityMask...........0xa751e84a
            LinkState................Active

    What to look at: Each record is a port advertising the IsSM capability, so you should see exactly your intended master and standby (here LIDs 1 and 12); check each with sminfo <lid> to see MASTER vs STANDBY. An extra LID here means an unplanned SM is running, and a single record means there is no standby.

    ibstatusQuick sysfs port summary, all HCAs
    Infiniband device 'mlx5_0' port 1 status:
            default gid:     fe80:0000:0000:0000:b83f:d203:00a1:b310
            base lid:        0x3b
            sm lid:          0x1
            state:           4: ACTIVE
            phys state:      5: LinkUp
            rate:            400 Gb/sec (4X NDR)
            link_layer:      InfiniBand
    
    Infiniband device 'mlx5_1' port 1 status:
            default gid:     fe80:0000:0000:0000:b83f:d203:00a1:b311
            base lid:        0x3c
            sm lid:          0x1
            state:           4: ACTIVE
            phys state:      5: LinkUp
            rate:            200 Gb/sec (2X NDR)
            link_layer:      InfiniBand
    ...

    What to look at: Every compute port should read 4: ACTIVE, 5: LinkUp and 400 Gb/sec (4X NDR); LIDs here are hex (0x3b = 59). The mlx5_1 entry above (run on dgx02) shows the classic degraded link: 200 Gb/sec (2X NDR) means two lanes failed to train, which is a cable or optic problem, not tuning.

    ibv_devinfoVerbs-level view of the HCA
    hca_id: mlx5_0
            transport:                      InfiniBand (0)
            fw_ver:                         28.39.1002
            node_guid:                      b83f:d203:00a1:b2c4
            sys_image_guid:                 b83f:d203:00a1:b2c4
            vendor_id:                      0x02c9
            vendor_part_id:                 4129
            hw_ver:                         0x0
            board_id:                       MT_0000000999
            phys_port_cnt:                  1
                    port:   1
                            state:                  PORT_ACTIVE (4)
                            max_mtu:                4096 (5)
                            active_mtu:             4096 (5)
                            sm_lid:                 1
                            port_lid:               57
                            port_lmc:               0x00
                            link_layer:             InfiniBand
    ...

    What to look at: This proves libibverbs (what NCCL and perftest use) can see and open the device: look for PORT_ACTIVE, a nonzero port_lid and link_layer InfiniBand. 'No IB devices found' or PORT_DOWN / PORT_INIT means RDMA applications will fail on this HCA even if the driver is loaded.

    ibdev2netdevMap mlx5_X devices to netdevs
    mlx5_0 port 1 ==> ibp24s0 (Up)
    mlx5_1 port 1 ==> ibp41s0 (Up)
    mlx5_2 port 1 ==> ibp64s0 (Up)
    mlx5_3 port 1 ==> ibp79s0 (Up)
    mlx5_4 port 1 ==> ibp94s0 (Up)
    mlx5_5 port 1 ==> ibp154s0 (Up)
    mlx5_6 port 1 ==> ibp192s0 (Down)
    mlx5_7 port 1 ==> ibp206s0 (Up)
    ...

    What to look at: Use it to match RDMA device names (for NCCL_IB_HCA) to the IPoIB interface names. Any compute rail showing (Down), like mlx5_6 here, will be missing from NCCL and should be checked with ibstat and mlxlink.

    ibnetdiscoverDiscover and print fabric topology
    #
    # Topology file: generated on Tue Nov 10 10:14:07 2026
    #
    # Initiated from node b83fd20300a1b2c4 port b83fd20300a1b2c4
    
    vendid=0x2c9
    devid=0xd2f2
    sysimgguid=0xfc6a1c0300e5a100
    switchguid=0xfc6a1c0300e5a100(fc6a1c0300e5a100)
    Switch  64 "S-fc6a1c0300e5a100"         # "leaf01" enhanced port 0 lid 2 lmc 0
    [1]     "H-0002c90300ab1234"[1](2c90300ab1234)          # "ufm-01 HCA-1" lid 1 4xNDR
    [3]     "H-b83fd20300a1b2c4"[1](b83fd20300a1b2c4)       # "dgx01 mlx5_0" lid 57 4xNDR
    [4]     "H-b83fd20300a1b310"[1](b83fd20300a1b310)       # "dgx02 mlx5_0" lid 59 4xNDR
    [33]    "S-fc6a1c0300e5b100"[1]         # "spine01" lid 4 4xNDR
    [34]    "S-fc6a1c0300e5b100"[2]         # "spine01" lid 4 4xNDR
    ...
    
    vendid=0x2c9
    devid=0x1021
    sysimgguid=0xb83fd20300a1b2c4
    caguid=0xb83fd20300a1b2c4
    Ca      1 "H-b83fd20300a1b2c4"          # "dgx01 mlx5_0"
    [1](b83fd20300a1b2c4)   "S-fc6a1c0300e5a100"[3]         # lid 57 lmc 0 "leaf01" lid 2 4xNDR
    ...

    What to look at: Each switch block lists which device sits on each port, so compare it with the cabling plan: the right node description on the right port number, and 4xNDR on every link. A host on an unexpected port, a missing node, or a link printed as 2xNDR is a cabling or physical-layer finding.

    ibhosts; ibswitchesInventory HCAs and switches
    Ca      : 0xa088c20300000008 ports 1 "dgx08 mlx5_0"
    ...
    Ca      : 0xb83fd20300a1b2c4 ports 1 "dgx01 mlx5_0"
    Ca      : 0x0002c90300ab5678 ports 1 "ufm-02 HCA-1"
    Ca      : 0x0002c90300ab1234 ports 1 "ufm-01 HCA-1"
    Switch  : 0xfc6a1c0300e5b100 ports 64 "spine01" enhanced port 0 lid 4 lmc 0
    Switch  : 0xfc6a1c0300e5a200 ports 64 "leaf02" enhanced port 0 lid 3 lmc 0
    Switch  : 0xfc6a1c0300e5a100 ports 64 "leaf01" enhanced port 0 lid 2 lmc 0

    What to look at: Count the lines and compare with the design (for example 8 DGX nodes x 8 compute HCAs plus SM servers, and the planned number of QM9700 leaves and spines). Fewer entries than planned means nodes or switches that are down, uncabled or on an isolated part of the fabric.

    iblinkinfoWidth/speed/state of every link
    Switch: 0xfc6a1c0300e5a100 leaf01:
               2    1[  ] ==( 4X      106.25 Gbps Active/  LinkUp)==>       1    1[  ] "ufm-01 HCA-1" ( )
               2    3[  ] ==( 4X      106.25 Gbps Active/  LinkUp)==>      57    1[  ] "dgx01 mlx5_0" ( )
               2    4[  ] ==( 4X      106.25 Gbps Active/  LinkUp)==>      59    1[  ] "dgx02 mlx5_0" ( )
               2    5[  ] ==(                Down/ Polling)==>             [  ] "" ( )
               2   33[  ] ==( 4X      106.25 Gbps Active/  LinkUp)==>       4    1[  ] "spine01" ( )
    ...
    Switch: 0xfc6a1c0300e5a200 leaf02:
               3    3[  ] ==( 4X      106.25 Gbps Active/  LinkUp)==>      58    1[  ] "dgx01 mlx5_1" ( )
               3    4[  ] ==( 2X      106.25 Gbps Active/  LinkUp)==>      60    1[  ] "dgx02 mlx5_1" ( Could be 4X 106.25 Gbps)
               3   34[  ] ==( 4X      106.25 Gbps Active/  LinkUp)==>       4    4[  ] "spine01" ( )
    ...

    What to look at: Every cabled port should show 4X 106.25 Gbps Active/LinkUp. 'Could be 4X' marks a link that trained narrower than both ends support (a degraded cable), Down/Polling means no partner signal, and Active is replaced by Init when the SM has not configured the link.

    perfquery 57 1Error and traffic counters, one port
    # Port counters: Lid 57 port 1 (CapMask: 0x5A00)
    PortSelect:......................1
    CounterSelect:...................0x0000
    SymbolErrorCounter:..............0
    LinkErrorRecoveryCounter:........0
    LinkDownedCounter:...............0
    PortRcvErrors:...................0
    PortRcvRemotePhysicalErrors:.....0
    PortRcvSwitchRelayErrors:........0
    PortXmitDiscards:................0
    PortXmitConstraintErrors:........0
    PortRcvConstraintErrors:.........0
    CounterSelect2:..................0x00
    LocalLinkIntegrityErrors:........0
    ExcessiveBufferOverrunErrors:....0
    QP1Dropped:......................0
    VL15Dropped:.....................0
    PortXmitData:....................4294967295
    PortRcvData:.....................4294967295
    PortXmitPkts:....................1873301922
    PortRcvPkts:.....................1869045117
    PortXmitWait:....................21844

    What to look at: SymbolErrorCounter, LinkErrorRecoveryCounter, LinkDownedCounter and PortRcvErrors should stay at 0 under traffic; values that grow between reads mean a physical-layer problem on this link. The 32-bit data counters pegged at 4294967295 are normal on a busy port, so use -x for real byte counts.

    perfquery -x 57 1Extended 64-bit port counters
    # Port extended counters: Lid 57 port 1 (CapMask: 0x5A00)
    PortSelect:......................1
    CounterSelect:...................0x0000
    PortXmitData:....................1923847561024
    PortRcvData:.....................1918003392768
    PortXmitPkts:....................7493205688
    PortRcvPkts:.....................7476180468
    PortUnicastXmitPkts:.............7493205688
    PortUnicastRcvPkts:..............7476180468
    PortMulticastXmitPkts:...........0
    PortMulticastRcvPkts:............0
    SymbolErrorCounter:..............0
    LinkErrorRecoveryCounter:........0
    LinkDownedCounter:...............0
    PortRcvErrors:...................0
    PortRcvRemotePhysicalErrors:.....0
    PortXmitDiscards:................0
    PortXmitWait:....................21844

    What to look at: PortXmitData and PortRcvData are counted in 4-byte words, so multiply by 4 for bytes; they should keep rising during a test. Error counters climbing here (or after a perfquery -R reset) point at the link, while a large, growing PortXmitWait with no errors points at congestion rather than a bad cable.

    ibqueryerrorsFabric-wide error counter sweep
    Errors for "leaf02"
       GUID 0xfc6a1c0300e5a200 port 4: [SymbolErrorCounter == 214] [LinkErrorRecoveryCounter == 3]
       GUID 0xfc6a1c0300e5a200 port 34: [SymbolErrorCounter == 1287] [LinkErrorRecoveryCounter == 14] [LinkDownedCounter == 6]
    Errors for "spine01"
       GUID 0xfc6a1c0300e5b100 port 4: [SymbolErrorCounter == 1192] [LinkErrorRecoveryCounter == 14] [LinkDownedCounter == 6]
    
    ## Summary: 74 nodes checked, 2 bad nodes found
    ##          212 ports checked, 3 ports have errors beyond threshold
    ##
    ## Thresholds:
    ##   [SymbolErrorCounter = 10] [LinkErrorRecoveryCounter = 10] [LinkDownedCounter = 10]
    ##   [PortRcvErrors = 10] [PortRcvRemotePhysicalErrors = 100] [PortXmitDiscards = 100]
    ##   ...

    What to look at: A clean fabric prints only the Summary with 0 bad nodes. Matching errors on both ends of one link (leaf02 port 34 and spine01 port 4 here) with a rising LinkDownedCounter identify a flapping cable, and PortXmitDiscards alone usually means congestion rather than cabling.

    ibtracert 57 112Hop-by-hop path between two LIDs
    From ca {0xb83fd20300a1b2c4} portnum 1 lid 57-57 "dgx01 mlx5_0"
    [1] -> switch port {0xfc6a1c0300e5a100}[3] lid 2-2 "leaf01"
    [33] -> switch port {0xfc6a1c0300e5b100}[1] lid 4-4 "spine01"
    [7] -> switch port {0xfc6a1c0300e5a400}[33] lid 6-6 "leaf04"
    [10] -> ca port {0xa088c20300000008}[1] lid 112-112 "dgx08 mlx5_0"
    To ca {0xa088c20300000008} portnum 1 lid 112-112 "dgx08 mlx5_0"

    What to look at: Read it to see which leaf and spine ports traffic between the two nodes actually crosses, then check those ports with perfquery. 'no route to dlid' or a path that stops part way means missing forwarding entries, usually an SM or routing problem or a down uplink.

    ibdiagnetFull fabric health report
    Loading IBDIAGNET from: /usr/lib/x86_64-linux-gnu/ibdiagnet2.1.1
    -I- Using port 1 as the local port
    
    Discovery
    -I- Discovering ... 74 nodes (10 Switches & 64 CA-s) discovered.
    -I- Fabric Discover finished successfully
    -I- Duplicated GUIDs detection finished successfully
    -I- Duplicated Node Description detection finished successfully
    
    Lids Check
    -I- Lids Check finished successfully
    
    Subnet Manager
    -I- SM Info retrieving finished successfully
    -I- Subnet Manager Check finished successfully
    
    Port Counters
    -E- lid=0x0003 dev=54002 leaf02/P34  Performance Monitor counter: symbol_error_counter  Value: 1287 (threshold=1)
    -I- ... 4 more, see /var/tmp/ibdiagnet2/ibdiagnet2.log
    -I- Ports counters value Check finished with errors
    
    Speed / Width checks
    -W- Link width 2x is below the supported 4x: leaf02 port 4 <-> dgx02 mlx5_1
    -I- Speed / Width checks finished with warnings
    
    Summary
    -I- Stage                     Warnings   Errors     Comment
    -I- Discovery                 0          0
    -I- Lids Check                0          0
    -I- Links Check               0          0
    -I- Subnet Manager            0          0
    -I- Port Counters             0          5
    -I- Nodes Information         0          0
    -I- Speed / Width checks      1          0
    
    -I- You can find detailed errors/warnings in: /var/tmp/ibdiagnet2/ibdiagnet2.log
    -I- Database                  : <db_csv> /var/tmp/ibdiagnet2/ibdiagnet2.db_csv
    -I- LST                       : /var/tmp/ibdiagnet2/ibdiagnet2.lst

    What to look at: Read the Summary table first: a sign-off run should show 0 errors and 0 warnings in every stage, then open /var/tmp/ibdiagnet2/ibdiagnet2.log for details. Duplicate GUID or LID errors, a missing master SM, port counter errors, or width/speed warnings like the 2x link above each need fixing before acceptance.

    ib_write_bw -d mlx5_0 --report_gbits dgx02RDMA write bandwidth between two nodes
    ---------------------------------------------------------------------------------------
                        RDMA_Write BW Test
     Dual-port       : OFF          Device         : mlx5_0
     Number of qps   : 1            Transport type : IB
     Connection type : RC           Using SRQ      : OFF
     PCIe relax order: ON
     ibv_wr* API     : ON
     TX depth        : 128
     CQ Moderation   : 1
     Mtu             : 4096[B]
     Link type       : IB
     Max inline data : 0[B]
     rdma_cm QPs     : OFF
     Data ex. method : Ethernet
    ---------------------------------------------------------------------------------------
     local address: LID 0x39 QPN 0x0128 PSN 0x4f1a2b RKey 0x1fff00 VAddr 0x007f3a5c000000
     remote address: LID 0x3b QPN 0x0129 PSN 0x7c3d1e RKey 0x1fff01 VAddr 0x007f12a8000000
    ---------------------------------------------------------------------------------------
     #bytes     #iterations    BW peak[Gb/sec]    BW average[Gb/sec]   MsgRate[Mpps]
     65536      5000             392.61             392.37             0.748386
    ---------------------------------------------------------------------------------------

    What to look at: Run 'ib_write_bw -d mlx5_0 --report_gbits' on dgx02 first as the server, then this on the client. On a 400G NDR link BW average should be close to line rate (about 390 Gb/s); roughly half of that points at a degraded 2x link or a PCIe/NUMA problem, and a connection error means the remote server is not running or the port is not Active.

    14. Scenarios

    15. Searchable command reference

    CommandPurpose

    16. Flashcards (click to flip)

    17. Exam traps

    1. "Identify the master SM" → sminfo (state MASTER, LID, GUID, priority) + smpquery nodedesc <LID> for the hostname.
    2. ibstat is local only. It shows your port state and the SM's LID, not the SM's state, priority, or name.
    3. ibnetdiscover maps topology. Great for cabling, but it doesn't identify which SM is master.
    4. ibsim is a simulator for testing software without hardware. Never the answer for diagnosing a real fabric.
    5. Init + LinkUp = no SM. Down/Polling = cable/partner problem. Rate 200 on NDR = degraded link.
    6. Master election: highest priority (0–15, 15 highest) wins. Tie → lowest GUID.
    7. LIDs are assigned by the SM. GUIDs are burned in. Base lid 0 (or 65535) = not configured by an SM.
    8. Port error counters → perfquery (one port) / ibqueryerrors (fabric). Full health report → ibdiagnet.
    9. Link speed/width across the fabric → iblinkinfo (or ibdiagnet).
    10. Fabric Manager ≠ Subnet Manager. FM = NVLink/NVSwitch inside a node. SM = InfiniBand.
    11. Active at Rate 400 doesn't prove a good link. Check errors under load with mlxlink -c: effective (post-FEC) errors must be zero; raw BER is the early warning.
    12. Passive DAC = short in-rack copper; longer runs need active copper, AOCs, or transceivers + fiber. A cable not rated for NDR links at 200.
    13. Changing a port (disable/enable/reset) → ibportstate, not smpquery (smpquery only reads).

    18. Practice quiz (32 questions)

    Score: 0 / 0