No description
  • Nix 68.4%
  • Python 19.2%
  • Shell 12.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-09 15:00:26 +01:00
docs STATUS: pd-r3-host32-pdq8-dva-night-ehq8-k8b4 (K8/V4 KV) deployed: pool 425,036 -> 545,183, gates pass, B8 parity, B1 4k -19% pre-tune-fix 2026-11-09 14:45:25 +01:00
nixos nv-rtx3080: P2P and large BAR on stock RTX 3080 (GA102), on NixOS 2026-10-30 08:51:17 +01:00
scripts nv-rtx3080: P2P and large BAR on stock RTX 3080 (GA102), on NixOS 2026-10-30 08:51:17 +01:00
LICENSE nv-rtx3080: P2P and large BAR on stock RTX 3080 (GA102), on NixOS 2026-10-30 08:51:17 +01:00
README.md docs: STATUS.md scoreboard for RTX decode and the P/D split 2026-11-02 14:43:24 +01:00

nv-rtx3080 — P2P and large BAR on stock RTX 3080 (GA102), on NixOS

Working notes and a reusable NixOS module for getting real GPU peer-to-peer (P2P) and a large resizable BAR on stock 10 GB RTX 3080 cards — no vBIOS flash, no memory mod — verified on a 4× RTX 3080 box.

Stock GeForce Ampere exposes no P2P: CUDA/NCCL stage every GPU→GPU copy through host RAM, tensor-parallel all-reduce collapses, nvidia-smi topo -m is all SYS, and llama.cpp refuses -sm row ("device does not support split buffers"). This repo documents how to turn P2P on anyway, and what it buys you.

Experimental. This uses an out-of-tree NVIDIA kernel-module patch that can hang the machine or corrupt memory, plus a PCI config-space override. Everything here is reversible by a power cycle (nothing is flashed), but do it on a machine where a GPU/host hang is acceptable, with physical/console access. Use at your own risk.

TL;DR results (4× RTX 3080, 10 GB, on a dual-NBIO EPYC / Gigabyte MZ32-AR0)

Test P2P OFF (stock) P2P ON
cudaDeviceCanAccessPeer, all pairs False True
Direct device→device copy (cards on x16) ~13 (host-staged) 26.2 GB/s
NCCL all-reduce 256 MB, 3× x16 cards 4.0 GB/s 23.5 GB/s (~5.9×)
BAR1 size per card 256 MB 16 GiB

No vBIOS flash. Reverts to stock on power-off. The one card sitting in an electrically-x8 slot caps at ~13.5 GB/s (Gen4 x8) rather than 26 — that's the slot, not the method.

How it works (two independent pieces)

  1. ReBAR unlock — stock RTX 3080 advertises a 256 MB BAR1. GA102 has a frame-buffer-size override in PCI config dword 0x610; armed before the driver binds, the card advertises a large Resizable BAR and the kernel resizes BAR1 (sysfs resource1_resize) to 16 GiB. Volatile config write — gone at power-off, re-applied at boot. See docs/mechanism.md. Based on noon-at-cgn/3080-20gb-rebar.

  2. P2P driver — a patched build of NVIDIA's open GPU kernel modules (pinned to 615.71.09) that gives real CUDA peer access via dynamic BAR1 windows. Needs the 16 GiB BAR + RMForceStaticBar1=0 per card; P2P is on by default for GA102 pairs. From noon-at-cgn/3080-20g-p2p, which builds on P2P work by tinygrad, aikitoria, Duanyll and dingiv.

Preconditions (check first, read-only)

Both unlocks only work if the silicon and BIOS cooperate. Confirm, per card:

  • Device id 10de:2206 (GA102 RTX 3080) — lspci -Dnn -d 10de::0300.
  • 0x60c bit 11 FB_SIZE_OVERRIDE = SUPPORTED — the override capability.
  • A Resizable-BAR capability and a resource1_resize sysfs file.
  • BIOS: Above 4G Decoding enabled and a large "Prefetchable MMIO Above 4G" window (enough 64-bit MMIO for a 16 GiB BAR per card).

Upstream's read-only rebar-check.sh prints all of this. On the reference box all four stock 10 GB cards passed, with 0x60c bit 11 set and a stock 0x610 of 00001001 — identical to the memory-modded cards the method was written for.

Layout

  • docs/STATUS.md — live scoreboard: RTX decode cells (ThinkingCap 27B int4, TP=4, MTP) and the TT-prefill → RTX-decode P/D split vs TT-only, every cell cited.
  • docs/mechanism.md — the ReBAR override and the P2P driver, register by register.
  • docs/nixos.md — deploying it on NixOS with the module here.
  • docs/verification.md — how to prove P2P is really on, with the exact commands and pitfalls (NCCL level, driver lib paths).
  • docs/hardware.md — GA102 / EPYC NBIO / MZ32-AR0 notes.
  • nixos/gpu-p2p.nix — a reusable NixOS module (pins the driver, swaps in the patched open source, arms the BAR at boot, sets the modprobe options).
  • scripts/ — small standalone benchmarks (peer-access probe, device-to-device bandwidth, NCCL all-reduce).

Credits

The hard work is upstream: noon-at-cgn (ReBAR override + the 615.71.09 dynamic-BAR1 P2P patch), building on tinygrad, aikitoria, Duanyll and dingiv. This repo is just a NixOS packaging of it plus measurements on stock 10 GB cards.