Why RoCE and GID index 3 change to index 4?

I am running vLLM across 2x DGX nodes connected via NVIDIA ConnectX-7 adapters using RoCE v2. During workloads, the multinode connection suddenly drops, causing the LLM serving process to hang or crash completely.

Upon debugging the RDMA state using show_gids, I discovered that the kernel dynamically restructures the GID table while vLLM is running. The active RoCE v2 mapping originally at index 3 suddenly gets cleared out to all zeros (0000:0000...), while the fresh RoCE v2 IPv4 entry shifts down to index 4.

Because our environment hardcodes NCCL_IB_GID_INDEX=3, vLLM crashes with the following error:

[glm53-exl3] head GID index 3 is EMPTY on rocep1s0f0
[glm53-exl3] worker GID index 3 is EMPTY on rocep1s0f0
…
[glm53-exl3] ERROR: set NCCL_IB_GID_INDEX (same index both ranks) or HEAD_GID/WORKER_GID (per rank) in .env to populated indices

Currently, the only way I can recover from this is by completely rebooting the systems or manually updating the .env configuration to index 4.

Has anyone else encountered this transient interface flapping/GID index drift on ConnectX-7 cards during heavy training or inference workloads? Is it something wrong with the driver/kernal? Any solution for this? Thank you.

Bobo


Suddenly … all missing even after reboot.

➜ ~ show_gids
DEV PORT INDEX GID IPv4 VER DEV


rocep1s0f0 1 0 fe80:0000:0000:0000:4ebb:47ff:fe29:8158 v1 enp1s0f0np0
rocep1s0f0 1 1 fe80:0000:0000:0000:4ebb:47ff:fe29:8158 v2 enp1s0f0np0
rocep1s0f1 1 0 fe80:0000:0000:0000:4ebb:47ff:fe29:8159 v1 enp1s0f1np1
rocep1s0f1 1 1 fe80:0000:0000:0000:4ebb:47ff:fe29:8159 v2 enp1s0f1np1
roceP2p1s0f0 1 0 fe80:0000:0000:0000:4ebb:47ff:fe29:815c v1 enP2p1s0f0np0
roceP2p1s0f0 1 1 fe80:0000:0000:0000:4ebb:47ff:fe29:815c v2 enP2p1s0f0np0
roceP2p1s0f1 1 0 fe80:0000:0000:0000:4ebb:47ff:fe29:815d v1 enP2p1s0f1np1
roceP2p1s0f1 1 1 fe80:0000:0000:0000:4ebb:47ff:fe29:815d v2 enP2p1s0f1np1
n_gids_found=8

GID index changes when a CX7 IP is added or removed, so if the link is flapping, this could affect the indexing.
Some suggestions:

  1. Stop hard-coding the GID index. Unset NCCL_IB_GID_INDEX and let NCCL choose (recent NCCL versions select the GID automatically). If needed, pin the selection criteria rather than the index:
NCCL_IB_ROCE_VERSION_NUM=2
NCCL_IB_ADDR_FAMILY=AF_INET
NCCL_IB_ADDR_RANGE=<subnet>/<len>   # optional

If something must take an index, compute it at launch:

p=/sys/class/infiniband/mlx5_0/ports/1
for g in $p/gids/*; do i=${g##*/}; [[ $(cat $p/gid_attrs/types/$i 2>/dev/null) == "RoCE v2" ]] && grep -q ffff "$g" && echo $i && break; done
  1. Use static IPs instead of link-local on the CX7 ports, as in the Spark “connect two Sparks” playbook. For example, netplan with 192.168.100.x/24 and ignore-carrier: true. This keeps the address, and its GID, through brief carrier drops.