AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Before you orderOffer from Amazon

Get workout gear delivered free with Prime

  • Fast, free delivery on millions of items
  • Prime Video, Amazon Music and more included
  • Member-only deals all year
Start your free Prime trial Free trial for eligible customers · Cancel anytime
As an affiliate, we earn on qualifying purchases.

Researchers have developed a method to use Nvidia GPU VRAM as swap space on Linux systems. This approach utilizes the CUDA driver API and NBD protocol, providing a high-priority, high-speed swap alternative for hybrid laptops with soldered memory. Performance benchmarks show it can significantly expand effective memory, though with some limitations compared to traditional SSD swap.

Linux users with Nvidia GPUs can now use their GPU’s VRAM as swap space thanks to a new open-source daemon that leverages the CUDA driver API and the NBD protocol. This development addresses hardware limitations in hybrid laptops with soldered memory, offering a high-priority, high-speed swap alternative that can significantly expand available memory.

The method involves a small daemon that allocates VRAM via the CUDA API and exposes it as a block device through the NBD protocol. This device is then used as swap space, bypassing traditional kernel limitations and driver restrictions that prevent direct VRAM pinning on consumer GPUs.

Tested on an AMD/ATI + Nvidia RTX 3070 laptop running Pop!_OS with kernel 6.17 and driver 580.159.03, the setup allocated 7 GB of VRAM as swap, increasing total addressable memory to approximately 46 GB when combined with zram and SSD swap. Benchmarks show that VRAM swap has lower latency than NVMe for sporadic access but is slower for large sequential transfers due to overhead from socket and CUDA calls.

Why It Matters

This development could improve performance and usability for users with hybrid laptops or systems with soldered memory, as it allows more efficient use of existing hardware resources. It also offers a workaround for driver and hardware limitations that restrict direct VRAM access, potentially enabling higher memory capacities without hardware upgrades.

However, the approach is not suitable for high-throughput, sustained swap workloads, where NVMe remains faster. Its primary benefit lies in reducing memory pressure and improving responsiveness during sporadic memory demands.

Products Worth Considering

Withings BPM Vision Blood Pressure Monitor with Wi-Fi and Bluetooth

Withings BPM Vision Blood Pressure Monitor with Wi-Fi and Bluetooth

Fitbit Versa Smart Watch – Black Aluminum, One Size (S & L Bands Included)

Fitbit Versa Smart Watch – Black Aluminum, One Size (S & L Bands Included)

As an affiliate, we earn on qualifying purchases.

Background

Hybrid laptops with soldered RAM often face limitations in expanding memory, and existing solutions like zram or SSD swap have performance trade-offs. Previous attempts to directly pin VRAM for swap via the NVIDIA P2P API failed due to driver restrictions, especially on consumer GPUs. This new method circumvents these issues by using CUDA’s memcpy functions and the NBD protocol, which do not require kernel modules or special permissions.

The approach has been tested on specific hardware configurations, with benchmarks indicating its advantages and limitations. It builds on ongoing efforts to optimize resource utilization in Linux systems with hybrid graphics setups.

“This method allows Linux users to effectively turn unused Nvidia VRAM into high-priority swap, expanding memory capacity without hardware upgrades.”

— Author of the project

“While VRAM swap offers lower latency for sporadic access, it is slower for sustained large transfers compared to NVMe SSDs, due to the overhead involved.”

— Hardware performance analyst

What Remains Unclear

It is not yet clear how well this approach scales across different Nvidia GPU models or Linux distributions. Compatibility with future driver updates and kernel versions remains uncertain, as does long-term stability under various workloads.

What’s Next

Further testing across a wider range of hardware and Linux environments is expected. Developers may refine the daemon, improve performance, and explore integration into mainstream Linux distributions. User feedback and real-world usage will determine its broader adoption.

Key Questions

Can I use this method on any Nvidia GPU?

It works on consumer CUDA-enabled Nvidia GPUs, including RTX and GTX series, but performance and compatibility may vary depending on the specific model and driver version.

Does this approach impact system stability?

Since it uses standard CUDA API functions and a user-space daemon, it is designed to be stable, but as with any experimental feature, users should test thoroughly before relying on it for critical workloads.

Will this replace traditional swap devices?

No, VRAM-based swap is intended as a supplementary high-priority memory pool for sporadic use, not a full replacement for SSD or HDD swap devices, especially for sustained high-throughput workloads.

How easy is it to set up?

The setup involves installing the daemon, configuring systemd services, and allocating VRAM as swap, which requires some command-line familiarity but is documented in the project’s README.

Source: Hacker News

You May Also Like

Can Connected Recovery Tools Support Better Sleep Habits?

AIThis post was created with the assistance of artificial intelligence (AI).Connected recovery…

How Connected Recovery Tools Appeal to Desk Workers

By integrating ergonomic support and wellness prompts, connected recovery tools help desk workers stay healthier and more focused—discover how they can transform your workday.

Why Infrared Saunas Are Becoming a Home Wellness Upgrade

Many are discovering how infrared saunas can revolutionize home wellness, but what makes them truly the ultimate upgrade?

Why Recovery Tech Is Becoming Part of Everyday Fitness

Lifting your recovery game with innovative tech can transform your fitness routine, but the real benefits may surprise you—continue reading to find out why.