Live data from Hacker News

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

github.com

21–30 of 142 posts

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

#21

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.

oh god please don't create more demand for GPUs

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

#23

> 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.

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?

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

#24

RAM disks have always fascinated me. In a different timeline every PC has a 100gb of RAM and 50TB HDDs are the norm.

Back when HDDs were all there was ramdisks were interesting, but SSDs pretty much killed most of that as they have massively increased IOPS over disks.

Hard drives that huge scare me as it would take days to backup all the data off them.

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

#27

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.

GPU-accelerated databases have a long history. I founded HeavyAI (previously MapD/OmniSci) in 2013, but there are or have been many other startups in this space, such as Voltron Data, Kinetica, Sqream, etc. And now you have major players like IBM, Starburst, and Microsoft (which just announced Fabric SQL on GPU today) working on their own GPU-accelerated systems. GPUs have a huge advantage in terms of compute, memory, and interconnect bandwidth over CPU, as long as you can keep them fed with data.

I believe within 2-3 years databases and data warehouses on GPU will be common. The widespread use of agents to query data will be a part of this, as there will be a need to run far more queries at lower latency than needed for the ETL and BI workloads of the past.

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

#28

Does anyone these days really use swap for anything than S4 suspend ?

https://news.ycombinator.com/item?id=40697318

This HN comment and the linked post brought up a lot of good points. The main takeaway is that swap should primarily be considered a mechanism for equality of reclamation, not for emergency extra memory, where equality of reclamation means file-backed pages and anonymous pages are subject to similar criteria for being evicted from physical memory.

I used to have zero swap on my Linux desktop and this convinced me to add at least a small swap partition.

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

#29

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?

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

#30

Does anyone these days really use swap for anything than S4 suspend ?

It really depends on what you run and how much RAM you have to do it in. I run some machines into swap just by running a couple browsers and some containers in the background on a 16GB laptop. I've also run a single light browser and essentially nothing else on 4GB and been fine:)
Post reply on HN