Multi-GPU PCIe P2P & 200GbE RoCEv2 Troubleshooting: Fixing NCCL P2P Deadlocks (iommu=pt / ACS), DGX Spark ConnectX-7 TCP Fallback, and Multi-Card R9700 Hangs
Step-by-step root-cause diagnostics and verified fixes for multi-GPU vLLM Tensor Parallel hangs (`iommu=pt`, PCIe ACS BAR1 P2P blocks), 2-node DGX Spark ConnectX-7 200GbE silent fallback to 1GbE TCP (`NET/Socket`), RoCEv2 MTU/GID errors (`ibv_modify_qp`), and multi-card AMD Radeon AI PRO R9700 RCCL deadlocks.
2x NVIDIA DGX Spark (ConnectX-7 200GbE QSFP112) | Dual RTX 5090 / RTX PRO 6000 on AMD Threadripper / Ryzen X870E | Dual AMD Radeon AI PRO R9700 (64GB)
All PCIe topology checks, GRUB kernel flags, and RoCEv2 GID/MTU repairs run locally without internet access.
- Consumer motherboards (AMD X870E/B850, Intel Z890) wiring the second GPU slot through the chipset PCH instead of CPU PCIe lanes cannot use direct BAR1 P2P DMA; they must run with `NCCL_P2P_DISABLE=1` (using host SHM).
- Switchless 200GbE QSFP112 RoCEv2 between two DGX Sparks requires matching `mtu 9000` and `NCCL_IB_GID_INDEX=3` on both nodes; mismatched MTU causes `ibv_modify_qp` or silent retry timeouts on payloads >1024 bytes.
1. Fixing Multi-GPU `vLLM` Tensor Parallel Deadlocks (`iommu=pt`, PCIe ACS & `HSA_ENABLE_SDMA=0`)
# 1. Check whether direct PCIe P2P is blocked between GPU 0 and GPU 1: nvidia-smi topo -p2p r 2>/dev/null || rocm-smi --showtopo # 2. Immediate 5-second workaround (routes Tensor Parallel over host SHM, no reboot needed): export NCCL_P2P_DISABLE=1 export NCCL_SHM_DISABLE=0 # 3. For Multi-Card AMD Radeon AI PRO R9700 (gfx1201) on ROCm vLLM, also disable async SDMA P2P: export HSA_ENABLE_SDMA=0 export NCCL_IB_DISABLE=1 export NCCL_P2P_LEVEL=PHB # 4. Permanent full-speed PCIe P2P fix: add iommu=pt to GRUB and reboot: sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="iommu=pt /' /etc/default/grub sudo update-grub
2. Fixing 2-Node DGX Spark ConnectX-7 200GbE Silent TCP Fallback & `ibv_modify_qp` Errors
| Platform / Topology | Symptom / Error Log | Root Cause | Verified Fix |
|---|---|---|---|
| Dual/Quad NVIDIA PCIe GPUs (`TP=2/4`) | Hangs at `Initializing distributed environment` / `ncclAllReduce` | CPU IOMMU translation or PCIe ACS blocks BAR1 P2P DMA | Add `iommu=pt` to GRUB (or `export NCCL_P2P_DISABLE=1`) |
| 2x AMD Radeon AI PRO R9700 (`gfx1201`) | RCCL hang or `HSA_STATUS_ERROR_MEMORY_APERTURE_VIOLATION` | Async SDMA P2P fault across PCIe Root Complex | `export HSA_ENABLE_SDMA=0 NCCL_P2P_LEVEL=PHB` (or Vulkan split) |
| 2x NVIDIA DGX Spark (200GbE QSFP112) | Runs at <3 tok/s; log shows `NCCL INFO NET/Socket : Using wlan0` | Ray/NCCL bound to management LAN instead of ConnectX-7 RDMA | `export NCCL_IB_HCA=mlx5_0:1 NCCL_SOCKET_IFNAME=enp1s0f0np0` |
| 2x NVIDIA DGX Spark (ConnectX-7 RoCEv2) | `NET/IB : ibv_modify_qp failed` or `retry counter exceeded (12)` | RoCEv1/v2 GID index mismatch or MTU 1500 vs 9000 drop | `export NCCL_IB_GID_INDEX=3` + `sudo ip link set mtu 9000` |
3. Automated Multi-GPU PCIe P2P & 200GbE RoCEv2 Doctor Script
Frequently Asked Questions & Edge Cases
Q: How much performance do I lose if I set `NCCL_P2P_DISABLE=1` on a dual-GPU workstation?
Surprisingly little for single-stream inference! On PCIe 4.0/5.0 x8 or x16 slots, routing NCCL all-reduce through host shared memory (`SHM`) instead of BAR1 P2P adds only **~8% to 12% latency** on `--tensor-parallel-size 2`, and **0% overhead** if you use Pipeline Parallelism (`--pipeline-parallel-size 2`) or `llama.cpp --split-mode layer`.
Q: Why does `ib_write_bw` work on my 2-node DGX Spark, yet `vLLM` still falls back to slow `NET/Socket`?
Because `ib_write_bw` talks directly to the RDMA device (`-d rocep1s0f0`), whereas **Ray and vLLM** first discover peers over standard IP sockets! If `ray start` was launched without `--node-ip-address=192.168.10.1` or without `NCCL_SOCKET_IFNAME=enp1s0f0np0`, NCCL initializes bootstrap on your Wi-Fi/LAN subnet and disables IB/RoCE when the subnet doesn’t match `mlx5_0:1`.
Multi-GPU PCIe P2P (`iommu=pt` / ACS) & 200GbE RoCEv2 Diagnostic Script
Audits kernel cmdline for iommu=pt, checks PCIe ACS redirection bits that deadlock multi-GPU vLLM, and verifies ConnectX-7 200GbE MTU 9000 & RoCEv2 GID index 3.
#!/usr/bin/env bash # Tinker AI — Multi-GPU PCIe P2P & ConnectX-7 200GbE RoCEv2 Doctor (Guide #32) set -euo pipefail IFACE="enp1s0f0np0" TARGET_MTU="9000" echo "=== [1/4] Auditing Kernel IOMMU Passthrough (iommu=pt) ===" CMDLINE=$(cat /proc/cmdline) echo "Kernel cmdline: $CMDLINE" if echo "$CMDLINE" | grep -q "iommu=pt"; then echo "[OK] iommu=pt is active (direct PCIe BAR1 P2P DMA enabled)." else echo "[WARN] iommu=pt is MISSING! Multi-GPU vLLM (TP>=2) on AMD/Intel boards may deadlock. Add iommu=pt to GRUB or set export NCCL_P2P_DISABLE=1." fi echo "=== [2/4] Checking PCIe ACS Redirection & GPU P2P Matrix ===" if command -v nvidia-smi >/dev/null 2>&1; then nvidia-smi topo -p2p r || true elif command -v rocm-smi >/dev/null 2>&1; then rocm-smi --showtopo || true fi sudo lspci -vvv 2>/dev/null | grep -E "ACSCtl:.*SrcValid\+" | head -n 5 && echo "[INFO] PCIe ACS is enabled on bridge ports; if NCCL hangs, export NCCL_P2P_DISABLE=1 or disable ACS in BIOS." || true echo "=== [3/4] Checking ConnectX-7 / RDMA Devices & Interface MTU ($IFACE -> $TARGET_MTU) ===" if ip link show "$IFACE" >/dev/null 2>&1; then ip -br link show "$IFACE" ip link show "$IFACE" | grep -q "mtu $TARGET_MTU" && echo "[OK] $IFACE MTU is $TARGET_MTU" || echo "[WARN] $IFACE MTU is not $TARGET_MTU! Run: sudo ip link set dev $IFACE mtu $TARGET_MTU" fi echo "=== [4/4] Inspecting RoCEv2 GID Index Table ===" if command -v show_gids >/dev/null 2>&1; then show_gids | grep -i "v2" | head -n 8 || true echo "Recommended NCCL env: export NCCL_IB_HCA=mlx5_0:1 NCCL_IB_GID_INDEX=3 NCCL_SOCKET_IFNAME=$IFACE" fi