6/2/2026 at 11:36:32 PM
> 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.
by yjftsjthsd-h
6/3/2026 at 12:45:18 AM
Another possible reason that occurred to me: what if you have VRAM but you're not using it all the time? For example, let's say you bought a GPU because you like to play video games. When you're not actively gaming, you probably don't need 16 GB of VRAM just to render the desktop. Might as well use it for something else, right?Edit: Although, this is predicated on the system being able to release VRAM that is acting as swap when it's time to start a game. Can it do that?
by Wowfunhappy
6/3/2026 at 4:54:00 AM
I am catching up on commentsThe reason I wrote this is I run this laptop in hybrid (AMD display + NVIDIA as swap). So all at VRAM was going to waste.
On your question re: switchable swap. It's on my to-do list ;)
by c0dejedi
6/3/2026 at 1:38:05 PM
Wouldn't this prevent the nvidia GPU from being power gated since it's never "idle"? So like your battery life regresses?by kllrnohj
6/3/2026 at 1:38:00 AM
It's easy enough to 'offline' swap space on Linux normally so I suspect that would work fine, as long as you didn't instantly run out of RAM when doing so.by Saris
6/3/2026 at 4:30:05 AM
If you have enough swap on disk available, it should be fine.by eru
6/3/2026 at 7:19:42 AM
Best case is if gaming and productivity (with high memory use) activities are not concurrent, and productivity applications are stopped before gaming starts, then `swapoff` can easily release swap device without restart.by nuccy
6/3/2026 at 12:24:32 PM
> you probably don't need 16 GB of VRAM just to render the desktopMicrosoft: hold my beer
by ornornor
6/3/2026 at 7:38:28 AM
So can VRAM actually be used like regular RAM? E.g. if I have a 16GB module and my GPU has 16GB VRAM, could it be made so that my system reports 32GB RAM? What would be the implications of that?by Phelinofist
6/3/2026 at 7:49:06 AM
It behaves like slower ram I assume, due to the increased distance from the CPU and overhead. Still, it’s much faster than normal SWAP which uses a disk or SSD.How it is reported? As SWAP space, not as RAM.
by tobyhinloopen
6/3/2026 at 7:47:35 AM
Typical desktop GPU ram does not support being write-back cached by the CPU. With PCIe resizable BAR, you could map the area into ram, so you could technically fit 32GB to memory, but it would have to be uncached (or write-combine cached), which would make it really, really slow.There are a bunch of datacenter GPUs that support full cache coherency, but if you used them like that the VRAM would be very high latency from the CPU. So it would only be really slow.
by Tuna-Fish
6/3/2026 at 11:59:01 AM
I assume on Linux you could use something like daxctl to tell the kernel to treat the vRAM as normal RAM, but I think this would be Intel/AMD only.by ChocolateGod
6/3/2026 at 12:59:05 PM
I don't think it would help. It's not just a software issue that can be fixed in the kernel, the hardware fundamentally isn't part of the cache coherency system of the CPU.by Tuna-Fish
6/3/2026 at 12:28:23 PM
[flagged]by zmysysz
6/3/2026 at 7:18:56 AM
In the olden days we called that a "RAM Disk" and it made our Atari STs go really fast!On the old Amstrad PCWs that were everywhere at least in the UK in the mid 80s to mid 90s you could have up to 512kB of RAM, a fair chunk of which could be a RAM disk. This made compiling stuff in Turbo Pascal really fast too :-)
by ErroneousBosh
6/3/2026 at 10:21:40 AM
Except swap is, like, opposite of RAM disk.That said, still an nice and fun concept. Though caching got better since I assume :)
by 3form
6/3/2026 at 12:06:50 PM
RAM disk is, like, the brd module on Linux, which allocates and exposes a /dev/ram0 block device.From the project description this looks like it, exposing a raw block device backed by VRAM (with some trip through the nbd protocol, but that's an implementation detail to have it in userland, it could just as well have been implemented kernel side).
It's just that the usage of this mem-backed block device is different than the thing of yore (copy HD or floppy into RAM)
The more frequent alternative to brd, tmpfs, skips the block device part and does a filesystem directly. I wonder if it could be made so that it's swap directly and skip the block device part entirely like tmpfs.
by lloeki