Open-source tool repurposes NVIDIA GPU VRAM as Linux swap space
A new GitHub utility allows Linux users to utilise unused video RAM as system swap, effectively increasing addressable memory without hardware upgrades.
A newly released open-source project on GitHub, nbd-vram, enables Linux users to repurpose unused NVIDIA GPU video RAM as system swap space. Designed primarily for laptops featuring soldered memory with no upgrade path, the tool aims to increase available addressable memory by absorbing data overflow before it is written to solid-state drives or compressed via zram.
The utility utilises the Network Block Device (NBD) protocol over a Unix socket to expose VRAM as a block device, thereby bypassing the need for custom kernel modules. This approach circumvents specific limitations within NVIDIA’s consumer GeForce drivers, which typically return an EINVAL error for the persistent page pinning required by other methods. These restrictions are enforced at the Resource Manager level, which gates such features to Quadro or datacentre SKUs.
In testing conducted on an RTX 3070 Laptop (GA104M) with 8GB of VRAM, using driver 580.159.03 and kernel 6.17 on Pop!_OS, the tool allocated 7GB of VRAM for swap. When combined with RAM, zram, and SSD swap, this resulted in a total addressable memory of approximately 46GB. The data path prioritises RAM first, followed by VRAM via PCIe, then zram for CPU compression, and finally the SSD only when other resources are exhausted.
The project sidesteps the ineffectiveness of direct memory mapping, which fails because the GPU’s internal page tables typically map only a small portion of the BAR1 physical address for the display framebuffer. Instead, nbd-vram uses the CUDA driver API to allocate VRAM and serves it via the NBD protocol. The kernel’s built-in nbd driver connects to the daemon, exposing the device as a standard swap partition that survives kernel and driver updates without requiring a rebuild.
To manage power consumption, the daemon includes optional power-aware management that automatically stops the service when the laptop is on battery and restarts it when AC power is restored. The installer configures the service to start automatically on boot, with a fallback mechanism that reduces the requested VRAM size in 512MB increments if the GPU has insufficient free memory due to the display compositor.


