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

(github.com)

76 points | by tanelpoder 1 hour ago

13 comments

  • yjftsjthsd-h 1 hour ago
    > 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.

  • RachelF 9 minutes ago
    Nice idea, but something has gone very wrong here:

    >Sequential throughput: ~1.3 GB/s

    [on a RTX 3070 Laptop]

    This RTX 3070 chip is on PCIe 4.0 x16 which should give 64GB/s. The 8GB of GDDR6 is 448GB/s.

    Swapping to an NVMe drive would be twice as fast, but with higher latency.

  • xfalcox 50 minutes ago
    Given my dev machine has 32GB of RAM and 32GB of VRAM that sits mostly idle when I'm not running AI models, this is not that bad of an idea.
  • UnfitFootprint 6 minutes ago
    No software benchmarks? BAR for RAM is cool but I want to see how much it _actually_ beats pcie nvme
  • LouisvilleGeek 8 minutes ago
    Finally a use for the expensive ram when it's not needed in workloads!

    Now if it could be dynamically used and vacated on other GPU workloads?

  • dragontamer 30 minutes ago
    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.

  • willis936 21 minutes ago
    I'm more interested in the opposite. Nvidia linux drivers crash when you try to address more VRAM than you have. It'd be nice if they didn't.
    • SV_BubbleTime 11 minutes ago
      They already do that on windows and it kinda sucks. If you are targeting something like LMStudio or ComfyUI, both of those have superior methods to do exactly this.
  • hardwaresofton 28 minutes ago
    You want to waste VRAM, in this economy?
  • jcmfernandes 1 hour ago
    Q: Why? A: Why not?
  • effnorwood 13 minutes ago
    use your car for an anchor on a big boat!
    • SV_BubbleTime 11 minutes ago
      I mean, if you aren’t using the car while using the boat and it won’t really damage the car… yes?
  • bobsmooth 14 minutes ago
    RAM disks have always fascinated me. In a different timeline every PC has a 100gb of RAM and 50TB HDDs are the norm.
  • simonask 1 hour ago
    I mean, cool, but I’d rather not?
    • margalabargala 47 minutes ago
      So don't. Not everything is for you.
    • gchamonlive 47 minutes ago
      Wouldn't it be faster to swap to vram if you are sitting there with 8gigs of it unused than swapping to ssd and burning its write cycles, assuming you absolutely need swap
    • dspillett 51 minutes ago
      So, erm, don't?
  • Sohcahtoa82 1 hour ago
    [dead]