Live data from Hacker News

Use your Nvidia GPU's VRAM as swap space on Linux

github.com

131–140 of 142 posts

Re: Use your Nvidia GPU's VRAM as swap space on Linux

#131

Earlier quoted context omitted.

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…

> you probably don't need 16 GB of VRAM just to render the desktop Microsoft: hold my beer

You mean Chrome? (Looking at the 5GiB usage here...)

Re: Use your Nvidia GPU's VRAM as swap space on Linux

#132

Earlier quoted context omitted.

Actually not that crazy of a spread. E.g. I have 48 GB + 32 GB in my gaming PC because if you go beyond 48 GB you start having to trade off more and more performance to keep the memory controller from falling over, so you really have to have a good reason to want to load more. Server platforms, like Epyc, it tends not to matter as much because you have so many channels for bandwidth and a beefier memory controller to…

I’ve got 64GB with a 3950x working great, although the speeds are not high. Just 3200MHz, IIRC.

Exactly, that's the tradeoff. I have one consumer machine running 192 GB but the latency and bandwidth is terrible compared to when it runs 48 GB.

Re: Use your Nvidia GPU's VRAM as swap space on Linux

#133

Earlier quoted context omitted.

Actually not that crazy of a spread. E.g. I have 48 GB + 32 GB in my gaming PC because if you go beyond 48 GB you start having to trade off more and more performance to keep the memory controller from falling over, so you really have to have a good reason to want to load more. Server platforms, like Epyc, it tends not to matter as much because you have so many channels for bandwidth and a beefier memory controller to…

What's this trade off about? I thought it was a simple 2 dims are probably better than 4, but unsure how you'd ever land on 48?

More capacity is also harder to drive, even on the same number of channels, but needing to go from 2 to 4 channels is also a (bigger) drag.

You can go up to 64 GB per DIMM on the current consumer offerings (max of 256 GB total across 4 DIMMs). So you could could 128 GB over 2 DIMMs, but it's still going to perform worse than 2x24 GB or 2x16 GB.

Re: Use your Nvidia GPU's VRAM as swap space on Linux

#134
post #87

Earlier quoted context omitted.

What's this trade off about? I thought it was a simple 2 dims are probably better than 4, but unsure how you'd ever land on 48?

Not that simple. 4 dimms were getting higher clocks on 2 CCD Ryzen models (12 & 16 cores) compared to those with one CCD. Motherboard topology is a factor too.

But there is no single configuration where having 4 DIMMs populated gives higher speeds than when 4 DIMMs are populated on the same configuration. This is because while the higher end parts tend to have the higher binned components they still inly have 1 shared memory die between the CCD and the motherboard topology is either it has 4 slots or it doesn't, but no matter how they are ran it's still better to only use 1 rank of each channel.

Re: Use your Nvidia GPU's VRAM as swap space on Linux

#135
post #131

Earlier quoted context omitted.

> you probably don't need 16 GB of VRAM just to render the desktop Microsoft: hold my beer

You mean Chrome? (Looking at the 5GiB usage here...)

Google Chrome is using 5 GB of VRAM?! Are you running something with WebGPU or something?

Re: Use your Nvidia GPU's VRAM as swap space on Linux

#136
post #131

Earlier quoted context omitted.

You mean Chrome? (Looking at the 5GiB usage here...)

Google Chrome is using 5 GB of VRAM ?! Are you running something with WebGPU or something?

It's called prerendering tabs or something :V

At 4k it adds up, especially since if you look into DevTools Chrome actually renders more at least vertically if not across major scroll regions.

Re: Use your Nvidia GPU's VRAM as swap space on Linux

#137

Earlier quoted context omitted.

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?

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…

Isn't the problem with write back cache mode just due to the GPU being unable to invalidate cache lines in the CPU?
Post reply on HN