nbd-vram turns NVIDIA GPU VRAM into Linux swap for extra memory
Got 8GB VRAM idle? Swap to it at 1.3 GB/s instead of slow SSD.
nbd-vram, created by Sean Lobjoit (c0dejedi), is a daemon that allocates unused VRAM from any CUDA-capable NVIDIA GPU and exposes it as a swap device via the Network Block Device (NBD) protocol. It sidesteps the NVIDIA P2P API restrictions that lock direct VRAM paging to Quadro/datacenter SKUs by using standard cuMemcpyHtoD/DtoH calls. The result? On a test system (RTX 3070 Laptop with 16GB RAM and 8GB VRAM), allocating 7GB of VRAM for swap tripled the available memory to 46GB when combined with existing zram and SSD swap. Sequential write throughput reached 1.3 GB/s — faster than typical NVMe SSDs.
The tool is easy to install (git clone, install.sh), configurable via systemd environment variables (VRAM_SETUP_SIZE_MB, VRAM_SWAP_PRIORITY), and includes power-aware management that automatically stops the swap service on battery to conserve energy. It survives kernel and driver updates without rebuilding. The data path goes from kernel swap → nbd kernel driver → Unix socket → daemon → cuMemcpy → GPU VRAM. For laptops with soldered RAM and no upgrade path, this provides a practical way to repurpose idle VRAM. The project is MIT-licensed and hosted on GitHub.
- Uses any CUDA-capable NVIDIA GeForce/RTX GPU, no Quadro required
- Tripled addressable memory from 16GB to 46GB on an RTX 3070 Laptop test
- Built-in power management stops swap on battery; manual override respected
Why It Matters
Repurposes idle GPU VRAM as fast swap for memory-constrained laptops, delaying costly upgrades.