Live data from Hacker News

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

github.com

81–90 of 142 posts

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

#82

Earlier quoted context omitted.

this is the pcmasterrace equivalent of being all upper body and with scrawny legs lol

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?

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

#84

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.

Can we somehow make them work with 1 TB PCIes so we can churn through way more data?

linux has P2P-DMA for this. The drivers, devices and bus topology need to support it though.

https://docs.kernel.org/driver-api/pci/p2pdma.html

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

#86

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?

DRAM chips aren't always manufactured in power of two sizes. It's been common for years to have non power of two capacities for LPDDR used in phones, and has started to show up in other DRAM types with the current generation standards: DDR5 for desktops/servers and GDDR7 for GPUs. That's how there have been 24GB single-rank DIMMs and 48GB dual-rank DIMMs for desktops and 96GB RDIMMs for servers for a few years, and how a mobile RTX 5090 has 24GB VRAM vs mobile RTX 5080 having only 16GB VRAM despite both GPUs being different bins of the same silicon and both configurations using a 256-bit memory bus.

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

#87

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?

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.

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

#88
post #59

Earlier quoted context omitted.

Swapping to a NVMe will also consume PE cycles on your NAND, ie wearing it out over time. RAM/VRAM don’t degrade from use.

flash is a consumable, yes. but flash endurance isn't a strong argument here. you probably have O(TB) of flash, and aren't going to produce PB of swap writes any time soon. if you do a lot of swapping to a small flash device, it'll happen sooner. I'm typing from a quite old 4GB laptop, which swaps heavily to a 250G SATA ssd. sure, it's not great, but it also costs zero. currently 9GB of swap is used, and it's not rea…

I guess you haven’t tried AMD’s composable kernel on Gentoo, or qtwebkit. I have a special env for the former called half-the-threads because it eats 2.5GB per thread. I removed the latter as soon as I was able to. I even add 32GB (half my RAM) of ZRAM for CK, and the Gentoo ebuild has a check for enough RAM per thread that stops the build if unmet, it wasn’t there before and I’ve had my system lock up because of OOM which OOMD wasn’t quick enough to catch.

All of this is to say that, it does have a potential impact on flash, if you rebuild often, which tends to happen on Gentoo.

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

#89

Earlier quoted context omitted.

this is the pcmasterrace equivalent of being all upper body and with scrawny legs lol

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.

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

#90
post #84

Earlier quoted context omitted.

Can we somehow make them work with 1 TB PCIes so we can churn through way more data?

linux has P2P-DMA for this. The drivers, devices and bus topology need to support it though. https://docs.kernel.org/driver-api/pci/p2pdma.html

I think GP means 1TB of PCIe bandwidth, instead of 1TB of PCIe NVMe drives.
Post reply on HN