7 ms·
Vramfs – GPU VRAM based file system for Linux
- riobard 4y agowould be interesting to combine this with `zram` to move compressed swap to vram instead
- drpixie 4y agoand you have all that GPU processing power for compressing & decompressing :)
- rbanffy 4y agoBut then you'd need to transfer uncompressed data over the PCIe bus.
- codeflo 4y agoI assume you're tongue in cheek, but just to make a serious point, it should never make sense to swap from cheap RAM to more expensive RAM. The whole point of swap is to move rarely used stuff into storage with a lower cost per GB. Otherwise, you would just buy more RAM in the first place.
- userbinator 4y agoVRAM will still be faster than HDD.
- dspillett 4y ago> you would just buy more RAM in the first place Unless you have hit the limit on how much "normal" RAM the current machine(s) can have/address, and/or you need extra memory for something now, etc. Or, of course, you are just playing with something cool but ultimately pointless!
- alexvoda 4y agoFor example, you might have a laptop with soldered RAM and a discrete GPU. There may be tasks where you don't need the dGPU but could use the extra RAM.
- citrin_ru 4y agoUnless you have a notebook/desktop with a powerful GPU and there were no option with all things staying the same but a cheaper GPU so you ended up which under-utilised GPU.
- unphased 4y agoIt's relatively fast (probably could be faster than NVMe if optimized, i did not rtfm) and it is available. it's not the most horrible of ideas. I am fairly fairly certain lots of applications will load assets into vram and then evict them from system memory. Why not leverage this for general purpose use if it makes sense (after taking into account the security implications of course)?
- ZiiS 4y agoIf you pay for GPU memory for the 10% of tasks you need it; it is cheaper then system RAM the rest of the time.
- riobard 4y agoYou need to factor in the compression ratio to see the benefits of swapping from RAM to RAM :P
- peter_d_sherman 4y agoAgreed! It would be interesting to implement this and a highly parallelizable GPU background data compression algorithm... It could be zram (zram would be a good choice!), it could be something else, it all depends on what kind of performance/compression is desired, and how parallelizable the compression algorithm is...
- KRAKRISMOTT 4y agoIntel Optane anyone?
- LargoLasskhyfv 4y agoI did that long ago with an IBM T60p, which had a 32bit Centrino, and only 3.25 or 3.5GB usable RAM out of 4GB. While the ATI FireGL had 256MB. At the time there was no ZRAM, but its predecessor compcache. IIRC I only needed about 2MB VRAM for the stuff I did, any capability the FireGL had wasn't supported by MESA/XORG/DRI at the times, apart from useless GLXGEARS. What can I say? After much fiddling it worked stable, resulting in running into the limits of that POS much later. Extending its usability. Not that much, but noticeable. Even Google Earth ran. Probably because it did anything in software anyways, on that combo of supported and exposed capabilities of the GPU at that time.
- userbinator 4y agoThe idea of using VRAM as general-purpose storage has been around for over a decade, although it usually makes more sense to put swap on it: https://forums.gentoo.org/viewtopic-t-395234-start-0.html https://forums.gentoo.org/viewtopic-t-395234-start-0.html https://www.pmenier.net/dotclear/docext/mtd/TIP_Use_memory_on_video_card_as_swap.html https://www.pmenier.net/dotclear/docext/mtd/TIP_Use_memory_o...
- jwilk 4y agoOver two decades, as you pointed out in https://news.ycombinator.com/item?id=11559869 https://news.ycombinator.com/item?id=11559869.
- userbinator 4y ago...and that was almost 7 years ago too, during which my second link there also died; but that was before the rise of all the AI stuff and its accompanying demand for GPUs with otherwise insane amounts of VRAM.
- gruturo 4y agoMake that three decades ago. In 1992 I was using a utility called VGADISK to create a 176K ramdisk in the VGA memory - this was on a 286 "laptop" (rather a luggable) with 1MB of RAM, and allowed me to fit entire programs in there as long as they didn't use VGA graphics (which would instantly corrupt the content of the ramdrive). Still online thanks to http://www.retroarchive.org/garbo/pc/memutil/index.html http://www.retroarchive.org/garbo/pc/memutil/index.html - a whopping 8KB zip archive, so about 30 seconds on my 2400bps modem (assuming V42 or MNP4)
- mobilio 4y agoOr this one https://wiki.archlinux.org/title/Swap_on_video_RAM https://wiki.archlinux.org/title/Swap_on_video_RAM
- Rediscover 4y agoOMG! I run in either text mode or very minimal graphics mode. This is a very appreciated comment. Now I am going to reconfigure my home machines to steal back that otherwise unused VRAM for swap. Thank You!!
- codeflo 4y agoI don't know if it's esoteric filesystem week on HN, but I love it. [1] Yesterday: TabFS – a browser extension that mounts the browser tabs as a filesystem, https://news.ycombinator.com/item?id=34847611 https://news.ycombinator.com/item?id=34847611 [2] The day before: Linux's SystemV Filesystem Support Being Orphaned, https://news.ycombinator.com/item?id=34818040 https://news.ycombinator.com/item?id=34818040
- OscarCunningham 4y agoIt's older than this week, but you might also enjoy 'Harder Drive': https://youtu.be/JcJSW7Rprio https://youtu.be/JcJSW7Rprio.
- loeg 4y agoTom7 is a national treasure.
- Svenstaro 4y agoI once posted memefs: https://news.ycombinator.com/item?id=17799547 https://news.ycombinator.com/item?id=17799547 I didn't get picked up very much, though.
- pyinstallwoes 4y agoThat’s really cool
- wpietri 4y agoHoly moly! TabFS is amazing and I missed it. Closing a tab by rming the dir is especially great. Thanks for mentioning it!
- voxadam 4y agoIt really does seem like a natural extension of the Unix maxim of "everything is a file"; I can imagine a modern browser embedded in a Plan 9 or Inferno style OS implementing a "tab as a file" style semantic.
- casual-dev 4y agoQuestion is, can I use my spare APU for this. On second thought, giving it more VRAM in BIOS only means using more RAM for it. So it would just be a RAM disk with extra steps. Nevertheless, neat!
- Taek 4y agoOne thing I'm not seeing mentioned is the security implications of running a filesystem in VRAM. Unless things have changed, GPU VRAM is basically free-for-all and any application can do read/write operations anywhere in the memory bank. There are certain scenarios where this is okay but lots of scenarios where it is not (example: webgl)
- londons_explore 4y agoWebgl gets to read memory that isn't its own? That can't be right... There would be massive info leaks...
- flohofwoe 4y agoYeah, it isn't right. In the very early WebGL days there have been a handful of implementation bugs where previous VRAM content was accidentally exposed in textures, but these things have been fixed quickly. AFAIK, most of this is now also taken care of down on the hardware and driver level.
- monocasa 4y agoThings have in fact changed. GPUs overwhelmingly have their own MMU to seperate different user contexts, including as accessed through their DMA engines. The few cases under Linux that don't such as the Raspberry PI's GPU instead use the kernel to wrap any submissions to the GPU where they can abstract and validate access to memory.
- nextaccountic 4y agoHow can I search for whether my GPU supports this? My GPU is a Radeon HD 8670M, on a very recent laptop Is this the IOMMU (which isn't generally supported, except on high end hardware [0]) or something else? I think my GPU doesn't support IOMMU [0] https://en.wikipedia.org/wiki/List_of_IOMMU-supporting_hardware https://en.wikipedia.org/wiki/List_of_IOMMU-supporting_hardw...
- 4y ago
- fwlr 4y agoI have lived to see man-made horrors beyond my comprehension
- rbanffy 4y agoThat's not too bad. Most desktop work require only a tiny fraction of the memory a discrete GPU has on-board. As long as the OS manages it well enough (letting programs use the remaining memory safely while keeping the VRAM filesystem safe), seems like a good solution.
- rwmj 4y agoIt would seem more natural to map VRAM to a block device, using nbdkit. Then you could create a regular filesystem like ext4 on top. Is there a specific reason why writing an esoteric FUSE filesystem is better?
- dusted 4y agoAm I reading that wrong, or is it slower than 25 Gbps ethernet ?
- dev_snd 4y agoThe readme states that currently it transfers around 2 gigabytes per second which is 16 gigabits per second. The rest I leave as an exercise to the reader.
- ptman 4y agoThroughput likely, but how about latency?
- redox99 4y agoIt's ancient hardware, and FUSE is very slow. A benchmark on modern hardware would be interesting.
- int0x80 4y agoNeat! The implementation is simple, clean and well structured -- a good way to understand in more detail how a FUSE filesystem is implemented.
- RobotToaster 4y agoJust need to use it with a thunderbolt to pcie adapter and a graphics card, put swap on it, and you can finally have external RAM.
- davidy123 4y agoWait'll you guys hear about buying more RAM and using it as a RAM disk.
- doublerabbit 4y agoWoah. Next you'll tell me I could increase the dimension size of my punchcard, to store more upon.
- rbanffy 4y agoYou can store twice as many puns on a 16" punchcard.
- anon___ 4y agoI have more RAM than I need, and just the other day I set up a RAM disk to put my /tmp directory on. My comic reader unpacks huge rar and zip archives into /tmp at every run, and I don't want it to wear out my SSD. I put this line in /etc/fstab: none /tmp tmpfs defaults,size=4G 0 0 It works like a charm. And in the worst case, if I run out of RAM anyway, it readily swaps out.
- bravetraveler 4y agoThis is a commonly recommended thing to do! It helps IPC performance in some ways - also makes sure nothing in there persists longer than intended. You might consider these common mount options for a little extra security: noexec,nosuid,nodev (and potential headaches, to be fair) While /tmp is a great world-writable place, these restrict it from being home to executables/devices -- common sources of abuse
- anon___ 4y agoThank you for the tips! It was just a quick hack and I never knew much about the mount options, but I guess it's time to learn.
- 4y ago
- deathclassic 4y agohmmm. Wonder what would happen if you configured a zfs pool with this as the l2arc vdev.
- LargoLasskhyfv 4y agoWould you like to when it's lacking ECC?
- lostmsu 4y agoHm, in 1 day nobody suggested this situates on the wrong abstraction level. E.g. why a file system, when it could be a virtual block device?