nbd-vram: Use your NVIDIA GPU's VRAM as swap space on Linux.
Posted by anh0516@reddit | linux | View on Reddit | 30 comments
Posted by anh0516@reddit | linux | View on Reddit | 30 comments
BemusedBengal@reddit
For the price of a modern GPU I will personally hold your swap for you
margooey@reddit
it always amazes me how people can look at something objectively cool and go "well why would you ever do something like that" as if there is no value in doing weird or unnecessary things
vk6_@reddit
How is this any better than the already existing vramfs? In fact, the old vramfs appears to be faster, more versatile, and supports more than just Nvidia GPUs. This one looks like it got vibe coded as well.
anh0516@reddit (OP)
This one exposes a block device that can be simply
mkswapped instead of a FUSE filesystem that would need to contain a swap file, which would add unnecessary layers. And swap may not work reliably on a FUSE filesystem in the first place.vk6_@reddit
This actually is going to have more overhead than a FUSE filesystem, because you're going through a NBD block device as well as a UNIX socket. The advertised throughput figures are not very impressive (1.3GB/s on
nbd-vramwith an RTX 3070 laptop compared to 2.0GB/s onvramfswith a much older AMD R9 290).Also, this uses a userspace daemon too so it shares the same weakness as
mkswap, which is that the system will hang if the daemon gets swapped out.edgmnt_net@reddit
My initial hunch is this is going to be easier to optimize than FUSE. Maybe I haven't looked for a while, but performance used to be horrendous for FUSE and hadn't changed much in the past. While something like a UNIX socket and NBD is more likely to be improved by just a bit of splicing or other zero-copy magic.
But seeing how this still requires a userspace daemon, I'm not sure.
Lower-Limit3695@reddit
That's unfortunate, if they decide to they can explicitly exclude the background daemon from swap using
MemorySwapMax=0in its systemd unit file.anh0516@reddit (OP)
Oh yeah that is pretty bad then.
Flashy_Pollution_996@reddit
Hmmmm too bad I have 32 gigs of ram and don’t really need this
EVMad@reddit
Oh? I'll raise you 512GB. How needs swap anyway?
free -h
Mem: 503Gi 49Gi 195Gi 587Mi 261Gi 453Gi
adoodle83@reddit
rookie numbers. i got blades with 2TB RAM
EVMad@reddit
This is my home workstation, but I run machines at work that are up to 6TB RAM with capacity for 12. 2TB is the bare minimum these days.
RetroGrid_io@reddit
32 GB of RAM. DDR4 perhaps?
You know, you could sell that and buy your own private island someplace, right?
Flashy_Pollution_996@reddit
I need it for those chrome tabs
unfurlingraspberry@reddit
🤣🤣🤣
Flashy_Pollution_996@reddit
Swap is for broke ppl
INITMalcanis@reddit
8GB isn't a very big swap file
the_humeister@reddit
It's not about size
adoodle83@reddit
depends on the usecase
Junior_Common_9644@reddit
😄
ipsirc@reddit
If you are using 8GB swap already then you need to get more ram asap.
Darkstar_111@reddit
Finally, a reason to buy an Nvidia pro 6000!
rlaptop7@reddit
This is an interesting thing to experiment with at least.
So many haters in here.
Alarmed_Contest8439@reddit
that is such a terrible idea, so much overhead, so much latency, its just stupid, why the fuck does it exist really?
DustyAsh69@reddit
I have swap on both ram and disk. I don't think that my PC has ever used the swap on disk.
Shad0wAVM@reddit
What about power consumption? I would like to test, but I do not want to have my GPU always working for 6gb of extra swap space.
spaceman_@reddit
Erm. *checks notes* It's bad.
I don't know how modern GPUs do, but I used to have a Dell Precision with an RTX 3080Ti and when some program for some reason didn't let go of their handle to some GL context or whatever on the Nvidia, power consumption was around 22W higher than normal.
RetiredApostle@reddit
Technically, llama.cpp could offload weights to swap much faster.
Sad_Violinist1555@reddit
Modern problem needs this
Realityishardmode@reddit
Lol. Lmao, even