<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-used-my-nvidia-gpu-s-vram-as-system-swap-and-it-freed-me-from-buying-more-memory-a8fwsyueo" -->

---
title: I used my Nvidia GPU's VRAM as system swap, and it freed...
description: An open-source tool called nbd-vram lets you use Nvidia GPU VRAM as swap space by allocating memory via the CUDA driver API and serving it as a network block...
canonical: https://daily.dev/posts/i-used-my-nvidia-gpu-s-vram-as-system-swap-and-it-freed-me-from-buying-more-memory-a8fwsyueo
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I used my Nvidia GPU's VRAM as system swap, and it freed me from buying more memory | daily.dev
og:description: An open-source tool called nbd-vram lets you use Nvidia GPU VRAM as swap space by allocating memory via the CUDA driver API and serving it as a network block...
og:url: https://daily.dev/posts/i-used-my-nvidia-gpu-s-vram-as-system-swap-and-it-freed-me-from-buying-more-memory-a8fwsyueo
og:image: https://api.daily.dev/og/posts/a8FwSyueO.png
og:image:alt: I used my Nvidia GPU's VRAM as system swap, and it freed me from buying more memory
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I used my Nvidia GPU's VRAM as system swap, and it freed me from buying more memory

**[XDA Developers](https://daily.dev/sources/xda-developers)** · 7 min read · 0 upvotes · 0 comments

## Summary

An open-source tool called nbd-vram lets you use Nvidia GPU VRAM as swap space by allocating memory via the CUDA driver API and serving it as a network block device over a Unix socket, bypassing Nvidia's consumer-GPU restriction on direct VRAM-to-CPU mapping. Testing it on WSL2 required the VRAM_NO_MLOCK=1 dev flag to work around a paravirtualization hang, and while it worked, the virtualization overhead crushed the performance gains seen on bare-metal laptops: 46,900 IOPS versus 425,000 IOPS for the VHDX-backed swap under heavy load, though VRAM swap did offer more consistent latency. The tool remains a strong fit for soldered-RAM hybrid-GPU laptops but offers little benefit inside WSL2 on a desktop.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.xda-developers.com/used-my-nvidia-gpus-vram-as-system-swap-freed-me-from-buying-more-memory>

## Questions this post answers

### How do I use nbd-vram to turn my Nvidia GPU's VRAM into swap space on WSL2?

Install and run the nbd-vram daemon, then load the NBD kernel module with sudo modprobe nbd, available since WSL 2.5 because kernel modules now ship with the kernel and the NBD driver is included in the WSL2 6.18 kernel. If the daemon hangs after loading CUDA, run it with the VRAM_NO_MLOCK=1 flag to skip the mlockall call that conflicts with WSL2's /dev/dxg GPU paravirtualization handshake, which is a testing workaround, not a permanent fix.

_daily.dev surfaces practical WSL2 and GPU configuration fixes like this for developers optimizing memory-constrained dev environments._

### Why is VRAM swap so much faster than NVMe swap on a laptop but not on a desktop running WSL2?

On laptops, NVMe drives enter power-saving sleep between sporadic accesses and must wake up each time, creating a large latency gap that VRAM swap avoids, producing roughly 34x lower latency (microseconds versus milliseconds). On a desktop, NVMe never sleeps and WSL2's VHDX-backed swap file is cached by Windows in abundant host RAM, so the two options measured nearly identical average latency: 331.5 microseconds for VRAM versus 307.7 microseconds for the VHDX file.

_Developers weighing storage and memory tradeoffs in virtualized dev setups can track this kind of benchmarking on daily.dev._

### Can Nvidia consumer GeForce GPUs map VRAM directly for the CPU to use as swap?

No, direct VRAM mapping for CPU addressing uses a peer-to-peer API that Nvidia restricts to Quadro, RTX Pro, and datacenter cards. The nbd-vram tool works around this on consumer GeForce GPUs by allocating VRAM through the CUDA driver API, which works on all Nvidia chips, and exposing that allocation as a network block device over a Unix socket that the Linux kernel's NBD driver connects to as /dev/nbd0.

_daily.dev helps developers stay on top of workarounds for GPU vendor API restrictions like this one._

## Similar posts on daily.dev

- [NBD-VRAM Provides Swap Space On Your NVIDIA GeForce GPUs](https://daily.dev/posts/nbd-vram-provides-swap-space-on-your-nvidia-geforce-gpus-45xxi5r4k) · Phoronix · 2 upvotes · 0 comments
- [Open-Source "GreenBoost" Driver Aims To Augment NVIDIA GPUs vRAM With System RAM & NVMe To Handle Larger LLMs](https://daily.dev/posts/open-source-greenboost-driver-aims-to-augment-nvidia-gpus-vram-with-system-ram-nvme-to-handle-la-ytw0mcaj5) · Phoronix · 1 upvotes · 0 comments
- [Linux just made 8GB VRAM feel like enough for the Steam Machine](https://daily.dev/posts/linux-just-made-8gb-vram-feel-like-enough-for-the-steam-machine-gq7ecqznd) · XDA Developers · 1 upvotes · 1 comments
- [I Put a Datacenter GPU in My Gaming PC for £200](https://daily.dev/posts/i-put-a-datacenter-gpu-in-my-gaming-pc-for-200-fsqh3pkrd) · Lobsters · 5 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux), [#microsoft](https://daily.dev/tags/microsoft), [#nvidia](https://daily.dev/tags/nvidia), [#cuda](https://daily.dev/tags/cuda)

[View this post on daily.dev](https://daily.dev/posts/i-used-my-nvidia-gpu-s-vram-as-system-swap-and-it-freed-me-from-buying-more-memory-a8fwsyueo)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I used my Nvidia GPU's VRAM as system swap, and it freed me from buying more memory","url":"https://daily.dev/posts/i-used-my-nvidia-gpu-s-vram-as-system-swap-and-it-freed-me-from-buying-more-memory-a8fwsyueo","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-used-my-nvidia-gpu-s-vram-as-system-swap-and-it-freed-me-from-buying-more-memory-a8fwsyueo"},"datePublished":"2026-08-15T16:02:00.533Z","dateModified":"2026-08-15T16:27:24.635Z","description":"An open-source tool called nbd-vram lets you use Nvidia GPU VRAM as swap space by allocating memory via the CUDA driver API and serving it as a network block...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/26ddce4ccb508ff13713040e1c7d65b2?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/26ddce4ccb508ff13713040e1c7d65b2?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"XDA Developers","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"XDA Developers","logo":"https://media.daily.dev/image/upload/s--kCg6yyAP--/f_auto,q_auto/v1774964407/logos/xda-developers?_a=BAMAMiWQ0","url":"https://daily.dev/sources/xda-developers"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-used-my-nvidia-gpu-s-vram-as-system-swap-and-it-freed-me-from-buying-more-memory-a8fwsyueo","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux,microsoft,nvidia,cuda","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"XDA Developers","item":"https://daily.dev/sources/xda-developers"},{"@type":"ListItem","position":3,"name":"I used my Nvidia GPU's VRAM as system swap, and it freed me from buying more memory"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-used-my-nvidia-gpu-s-vram-as-system-swap-and-it-freed-me-from-buying-more-memory-a8fwsyueo#faq","mainEntity":[{"@type":"Question","name":"How do I use nbd-vram to turn my Nvidia GPU's VRAM into swap space on WSL2?","acceptedAnswer":{"@type":"Answer","text":"Install and run the nbd-vram daemon, then load the NBD kernel module with sudo modprobe nbd, available since WSL 2.5 because kernel modules now ship with the kernel and the NBD driver is included in the WSL2 6.18 kernel. If the daemon hangs after loading CUDA, run it with the VRAM_NO_MLOCK=1 flag to skip the mlockall call that conflicts with WSL2's /dev/dxg GPU paravirtualization handshake, which is a testing workaround, not a permanent fix. daily.dev surfaces practical WSL2 and GPU configuration fixes like this for developers optimizing memory-constrained dev environments."}},{"@type":"Question","name":"Why is VRAM swap so much faster than NVMe swap on a laptop but not on a desktop running WSL2?","acceptedAnswer":{"@type":"Answer","text":"On laptops, NVMe drives enter power-saving sleep between sporadic accesses and must wake up each time, creating a large latency gap that VRAM swap avoids, producing roughly 34x lower latency (microseconds versus milliseconds). On a desktop, NVMe never sleeps and WSL2's VHDX-backed swap file is cached by Windows in abundant host RAM, so the two options measured nearly identical average latency: 331.5 microseconds for VRAM versus 307.7 microseconds for the VHDX file. Developers weighing storage and memory tradeoffs in virtualized dev setups can track this kind of benchmarking on daily.dev."}},{"@type":"Question","name":"Can Nvidia consumer GeForce GPUs map VRAM directly for the CPU to use as swap?","acceptedAnswer":{"@type":"Answer","text":"No, direct VRAM mapping for CPU addressing uses a peer-to-peer API that Nvidia restricts to Quadro, RTX Pro, and datacenter cards. The nbd-vram tool works around this on consumer GeForce GPUs by allocating VRAM through the CUDA driver API, which works on all Nvidia chips, and exposing that allocation as a network block device over a Unix socket that the Linux kernel's NBD driver connects to as /dev/nbd0. daily.dev helps developers stay on top of workarounds for GPU vendor API restrictions like this one."}}]}
```

