Use your Nvidia GPU's VRAM as swap space on Linux
AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Prime Big Deal Days · Oct 6–7Offer from Amazon

Get the latest gadgets delivered free — and shop member deals

  • Fast, free delivery on millions of items
  • Access to Prime Big Deal Days deals on October 6–7
  • Prime Video, Amazon Music and more included
Start your free Prime trial Free trial for eligible customers · Cancel anytime
As an affiliate, we earn on qualifying purchases.

Linux users with Nvidia GPUs can now convert VRAM into swap space using a user-space daemon that leverages CUDA APIs. This approach enhances total addressable memory, especially for hybrid graphics laptops, without kernel module changes. Performance varies depending on workload type.

Linux users with Nvidia GPUs can now utilize their GPU’s VRAM as swap space through a user-space daemon that communicates directly with the CUDA driver API, bypassing kernel module limitations. This development provides a way to significantly increase available memory on hybrid graphics laptops without kernel modifications, which is particularly relevant for systems with soldered, non-upgradable memory.

The method involves a small daemon that allocates VRAM via the CUDA driver API and exposes it as a block device using the NBD (Network Block Device) protocol over a Unix socket. This device is then used as swap space by the Linux kernel. The approach avoids kernel module dependencies and does not require NVIDIA kernel symbols, making it resilient to driver updates. Tested on an AMD/ATI + RTX 3070 laptop with 16 GB RAM and 8 GB VRAM, the setup allocates up to 7 GB of VRAM as swap, effectively tripling total addressable memory when combined with zram and SSD swap. Benchmarks indicate that VRAM-based swap offers lower latency for sporadic, small I/O operations but slower throughput for large sequential transfers compared to NVMe SSDs.

Why It Matters

This development matters because it offers a practical solution for extending system memory on laptops with soldered VRAM, which cannot be upgraded. It enables more demanding applications and multitasking without hardware changes. Additionally, it sidesteps longstanding issues with NVIDIA’s peer-to-peer API restrictions and kernel module dependencies, simplifying implementation and maintenance.

Amazon

Nvidia GPU VRAM as swap space

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Prior to this, using GPU memory as swap was limited by NVIDIA driver restrictions and the complexity of direct memory pinning. Existing approaches like nvidia_p2p_get_pages_persistent API often failed on consumer GPUs, returning errors or being gated behind Quadro/datacenter SKUs. The new method leverages CUDA’s memory copy APIs, which are available across consumer GPUs, and implements a user-space daemon to expose VRAM as a block device, effectively creating a high-priority swap device without kernel modifications.

“This approach allows Linux to use Nvidia VRAM as swap without kernel module dependencies or driver modifications, surviving driver updates seamlessly.”

— Developer of the nbd-vram project

“Allocating 7 GB of VRAM as swap tripled the total addressable memory, improving multitasking and application performance.”

— User testing on a laptop with RTX 3070

Amazon

Linux GPU memory extension tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It remains unclear how this approach performs under sustained high load or in different hardware configurations. Compatibility with all Nvidia consumer GPUs and across various Linux distributions has not been exhaustively tested. Additionally, the long-term stability and potential side effects on GPU operation and power management are still being evaluated.

Amazon

CUDA API GPU memory management

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Further testing across different Nvidia GPU models and Linux distributions is expected. Developers may optimize the daemon for better performance and lower latency. Future updates might include more user-friendly configuration tools and integration with system management utilities. The community will likely explore extending this approach to other GPU brands or integrating it into mainstream Linux distributions.

Amazon

Network Block Device Linux

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Can I use this method on all Nvidia GPUs?

It works on consumer CUDA-enabled Nvidia GPUs, including RTX and GTX series. Compatibility with older or specialized GPUs has not been fully confirmed.

Does this impact GPU performance or stability?

Initial tests show it does not interfere with normal GPU operation. However, long-term effects and stability under heavy workloads are still being studied.

Is this method safe for my hardware?

Using the CUDA APIs as described is generally safe, but as with any experimental feature, there is a risk of instability. Users should test carefully and back up critical data.

How do I set up this VRAM swap on my Linux system?

Installation involves cloning the GitHub repository, running the provided install script, and configuring systemd services. Detailed instructions are included in the project’s documentation.

Source: Hacker News

HALLOWEEN

Halloween Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

Accelerate

Haskell’s Accelerate project releases new features for high-performance parallel array computations on GPUs and multicore CPUs, enhancing scientific computing.

Games Total: O/U 3.5

A new betting market titled ‘Games Total: O/U 3.5’ has been launched on Polymarket, with a 50% YES/NO split, reflecting current betting interest.

Future-Proof Your Tech With These 10 AI Processors In 2026

Discover the leading AI processors in 2026 that promise enhanced performance, efficiency, and future-proofing for your tech needs.

Orthrus-Qwen3: up to 7.8×tokens/forward on Qwen3, identical output distribution

Orthrus-Qwen3 enhances large language model inference, offering up to 7.8× faster generation while maintaining exact output fidelity, using dual-architecture diffusion approach.