Use your Nvidia GPU's VRAM as swap space on Linux
79 points by tanelpoder 2 hours ago | 22 comments
xfalcox 59 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.
replyRachelF 19 minutes ago
Nice idea, but something has gone very wrong here:
reply>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.
dragontamer 40 minutes ago
Remember how 16GBs used to be an enterprise level database mainframe?
replyWell, 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.
willis936 31 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.
replySV_BubbleTime 21 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.
replyLouisvilleGeek 17 minutes ago
Finally a use for the expensive ram when it's not needed in workloads!
replyNow if it could be dynamically used and vacated on other GPU workloads?
UnfitFootprint 16 minutes ago
No software benchmarks? BAR for RAM is cool but I want to see how much it _actually_ beats pcie nvme
replyeffnorwood 22 minutes ago
use your car for an anchor on a big boat!
replySV_BubbleTime 20 minutes ago
I mean, if you aren’t using the car while using the boat and it won’t really damage the car… yes?
replybobsmooth 23 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.
replysimonask 2 hours ago
I mean, cool, but I’d rather not?
replygchamonlive 57 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
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.