Use your Nvidia GPU's VRAM as swap space on Linux
72 points
1 hour ago
| 12 comments
| github.com
| HN
yjftsjthsd-h
1 hour ago
[-]
> Built for laptops with soldered memory and no upgrade path. If you have an RTX card sitting there with 8GB of VRAM and you're getting swapped to SSD, this puts that VRAM to work.

Well, that does at least answer my immediate question about why I would ever swap from expensive RAM to really expensive RAM:) Feels niche, but when you want it it's a good idea.

reply
RachelF
5 minutes ago
[-]
Nice idea, but something has gone very wrong here:

>Sequential throughput: ~1.3 GB/s

[on a RTX 3070 Laptop]

This RTX 3070 chip is on PCIe 4.0 x16 which should give 64GB/s. The 8GB of GDDR6 is 448GB/s.

Swapping to an NVMe drive would be twice as fast, but with higher latency.

reply
UnfitFootprint
2 minutes ago
[-]
No software benchmarks? BAR for RAM is cool but I want to see how much it _actually_ beats pcie nvme
reply
xfalcox
46 minutes ago
[-]
Given my dev machine has 32GB of RAM and 32GB of VRAM that sits mostly idle when I'm not running AI models, this is not that bad of an idea.
reply
LouisvilleGeek
4 minutes ago
[-]
Finally a use for the expensive ram when it's not needed in workloads!

Now if it could be dynamically used and vacated on other GPU workloads?

reply
dragontamer
26 minutes ago
[-]
Remember how 16GBs used to be an enterprise level database mainframe?

Well, GPUs also have stupid amounts of compute on them. I have to imagine that there is some kind of database format that's useful with GPU compute attached.

Since the data is already in VRAM, the GPU can sort, join, or otherwise manipulate data as needed.

reply
Nate75Sanders
2 minutes ago
[-]
Possibly LSM compaction.
reply
willis936
17 minutes ago
[-]
I'm more interested in the opposite. Nvidia linux drivers crash when you try to address more VRAM than you have. It'd be nice if they didn't.
reply
SV_BubbleTime
7 minutes ago
[-]
They already do that on windows and it kinda sucks. If you are targeting something like LMStudio or ComfyUI, both of those have superior methods to do exactly this.
reply
hardwaresofton
24 minutes ago
[-]
You want to waste VRAM, in this economy?
reply
jcmfernandes
57 minutes ago
[-]
Q: Why? A: Why not?
reply
effnorwood
9 minutes ago
[-]
use your car for an anchor on a big boat!
reply
SV_BubbleTime
6 minutes ago
[-]
I mean, if you aren’t using the car while using the boat and it won’t really damage the car… yes?
reply
bobsmooth
9 minutes ago
[-]
RAM disks have always fascinated me. In a different timeline every PC has a 100gb of RAM and 50TB HDDs are the norm.
reply
simonask
1 hour ago
[-]
I mean, cool, but I’d rather not?
reply
margalabargala
43 minutes ago
[-]
So don't. Not everything is for you.
reply
gchamonlive
43 minutes ago
[-]
Wouldn't it be faster to swap to vram if you are sitting there with 8gigs of it unused than swapping to ssd and burning its write cycles, assuming you absolutely need swap
reply
dspillett
47 minutes ago
[-]
So, erm, don't?
reply