In large GPU/AI clusters, each compute node often has multiple InfiniBand (IB) Host Channel Adapters (HCAs). On Linux, these HCAs appear as mlx5_x devices.
To troubleshoot connectivity or performance issues, it is essential to map:
mlx5_x (Linux device name)
Port GUID (from ibstat)
Linux netdev interface (from ip a)
Link speed (from ibstat or mlxlink)
Connected switch and port (from ibnetdiscover or subnet manager topology dump)
Check available Mellanox devices:
Example output:
Each corresponds to one HCA port.
ibstat)Run the following for each HCA:
Look for Port GUID:
This uniquely identifies the IB port in the fabric.
ip a)Check ip a output for ibX interfaces:
Sample:
The netdev (e.g., ib0) corresponds to the mlx5_x device.
Cross-check via:
Use either:
or
Look for:
To identify which switch and port the HCA is connected to:
Run topology discovery on the fabric:
or
Output will show mapping like:
This gives the node HCA → switch port mapping.
| mlx5_x | Port GUID (ibstat) | Linux netdev (ip a) | Speed | Connected Switch:Port |
|---|---|---|---|---|
| mlx5_0 | 0x248a070300abcd01 | ib0 | 400G | SW1:12 |
| mlx5_1 | 0x248a070300abcd02 | ib1 | 400G | SW2:14 |
| mlx5_2 | 0x248a070300abcd03 | ib2 | 200G⚠ | SW3:18 |
| mlx5_3 | 0x248a070300abcd04 | ib3 | 200G⚠ | SW4:20 |
⚠️ Indicates ports running below expected speed.
mlx5_x = Linux HCA device name.
Use ibstat to fetch Port GUID and speed.
Use ip a or /sys/class/infiniband to map to Linux netdev (ib0, ib1, etc.).
Use ibnetdiscover / ibdiagnet to identify the connected switch and port.
Build a mapping table for each node to simplify troubleshooting.