3. BAR1 128 GiB on every card, behind PCIe switches

Russian: 03-bar1-128g.ru.md

Why: a large BAR1 is a precondition for P2P and RDMA. It is not needed for pipeline-parallel inference. P2P itself is not done: nvidia-smi topo -p2p r still reports GNS.

Platform

Gigabyte G292-Z20, UEFI boot, Above 4G decoding on. Each root bus has a 64-bit window of about 1.7 TB, but the firmware gives each switch only 224 MiB because the cards announce a 64 MiB BAR1 at power-on. There is enough address space; the windows only have to be redistributed.

What works

  1. Block automatic loading of nvidia: server/modprobe/cmp-nvidia-hold.conf (install nvidia /bin/false and the same for uvm, modeset, drm). A plain blacklist did not stop the module.
  2. cmp-bar1set <bdf> 128 on every card, with no driver bound: - COMMAND=0002 (memory decode on), - BAR0+0x88724 = 0x30, - BAR0+0x88DCC = 0x8000000B (0x8000000A for 64 GiB), - the ReBAR capability then reads 0x003ffc00; set ReBAR control (config 0xbc0) bits 13:8 to 17 (16 for 64 GiB), - COMMAND=0000.
  3. Remove the root ports above the switches and rescan: echo 1 > /sys/bus/pci/devices/<root port>/remove; echo 1 > /sys/bus/pci/rescan. A stock Debian 6.12 kernel then lays the windows out again (384 GiB per switch here). No kernel patch and no shim module.
  4. Check Region 1 ... size=128G on every card.
  5. Only then modprobe --ignore-install nvidia nvidia_uvm.

cmp-bar1-boot does all five steps as an early service (cmp-bar1-boot.service, before nvidia-persistenced and cmp-pcie-boot). BAR1 plus driver load takes about 35 s.

Where the register offsets come from: they are the ReBAR unlock registers used by community BAR1 work (the unlocker's BAR1 patch, cmp170hx-rebar-shim). We did not discover them. Exact provenance: not verified.

Rules that keep the host alive

Checking

nvidia-smi -q | grep -A3 'BAR1 Memory' | grep Total        # 131072 MiB
lspci -s <bdf> -vv | grep 'Region 1'                        # size=128G

Not verified