1. Driver: nvidia-open 615.71.09 + cmpunlocker + the 80 GB patch

Russian: 01-driver-80gb.ru.md

What you need to know first

On a fuse-burned 8 GB card the memory and PCIe limits are gone in hardware, but an older patched driver can still force the old limits in software. On our server the cards showed 64 GB and Gen2 until the driver was replaced: the unlocker build for 610.43.02 wrote a fixed 64 GiB geometry, and the unlocker's gen2.service held the link at Gen2.

What our cards report (read with server/tools/fuses.py, read-only): 10 of 12 FBPs active (off mask 0x840) on all 8; GEN3_SPD_DIS=0, BOOT_GEN3_DIS=0, BOOT_GEN23_DIS=0, MAGIC_D=0x14680000.

Components

Part Version Author
nvidia-open 615.71.09 (NVIDIA apt repository, pinned with nvidia-driver-pinning-615.71.09) NVIDIA
cmpunlocker commit 2c7e2ec amoghmunikote, GPL-2.0
fb-geometry-80g.patch from cmp170hx-8gb-vfi-tools, driver/ darkmaniac7, MIT
cmpunlocker-local.patch this repository, server/cmpunlocker/ ours

The 80 GB patch picks the geometry from the card's own masks. Registry key CmpFbGeometry: absent = automatic (80 GiB where the masks allow it), 2 = log only, 0 = off (64 GiB everywhere).

Our local changes to cmpunlocker (cmpunlocker-local.patch)

  1. Registers fb-geometry-80g.patch in common/constants.yaml and in PATCH_ORDER of driver/build.sh.
  2. Debian build fix: kernel headers are split into a -common (source) and an -amd64 (build) package, so the module build gets SYSSRC=/lib/modules/<kver>/source SYSOUT=<build dir>.
  3. Disables the unlocker's CMP BAR1 resize in nv-pci.c (one sed after the patches are applied). Reason, on a platform with two cards behind each PCIe switch: - with the resize active, the card is resized at probe time while the bridge window handed out by the firmware is still occupied by the neighbour; only one card of each pair fits. We saw 4 of 8 cards (BAR 1: can't assign; no space); - turning the resize off with NVreg_EnableResizableBar=0 while the ReBAR register writes stay is worse: the card believes BAR1 is 64 GiB while the kernel has 64 MiB mapped, and the first CUDA context hangs for good (UVM channel_pool_add, every nvidia-smi in D state, no Xid; only a power cycle helps).

We size BAR1 ourselves before the driver loads, see 03-bar1-128g.md.

Build

server/install.sh does all of this. By hand, as root:

git clone https://github.com/amoghmunikote/cmpunlocker /root/cmpunlocker
cd /root/cmpunlocker && git checkout 2c7e2ecd7944e791fec040d2680036beb4a9327b
curl -fsSL -o driver/patches/fb-geometry-80g.patch \
  https://raw.githubusercontent.com/darkmaniac7/cmp170hx-8gb-vfi-tools/f422f80a716fff2c1dc112abcf2e9d43a04b6614/driver/fb-geometry-80g.patch
patch -p1 < /path/to/server/cmpunlocker/cmpunlocker-local.patch
install -m 0644 /path/to/server/modprobe/cmp-nvidia-hold.conf /etc/modprobe.d/     # BEFORE the build, see below
CMPUNLOCKER_DRIVER_VERSION=615.71.09 CMPUNLOCKER_CARD_PROFILE=8gb ./driver/build.sh

Do not run the unlocker's own install.sh on such a machine: it rewrites the modprobe file and re-enables gen2.service.

The patch was checked to apply to commit 2c7e2ec. The clone-and-patch sequence above was not run end to end: our server was built from a working tree that already had the same changes.

Module parameters

/etc/modprobe.d/cmp-pcie-gen2.conf (an example is in server/modprobe/):

options nvidia NVreg_RegistryDwords="RmForceEnableGen2=1"
options nvidia NVreg_RegistryDwordsPerDevice="pci=0000:03:00.0;RMPcieLinkSpeed=0x5;pci=0000:04:00.0;RMPcieLinkSpeed=0x5;..."

One pci=<BDF>;RMPcieLinkSpeed=0x5 entry per card. When cards move to other slots, update the list, run update-initramfs -u and do a cold power cycle.

Kernel command line: pcie_port_pm=off pci=realloc amd_iommu=on iommu=pt iomem=relaxed. iomem=relaxed is required: without it, mapping BAR0 with the driver loaded fails with EINVAL and the PCIe tools do not work. pcie_port_pm=off avoids a soft lockup on lspci -vv with empty switches in D3hot on this board.

Things that bit us