by tristor · 5y ago · 0 comments
Back when 32GB was a lot (about a decade ago), I had 32GB of RAM in my desktop and would take whatever game I was competitively focused on at that time and install it to a RAM disk which would be written out to SSD occasionally and loaded back from SSD on boot. Loading times were essentially non-existent since it became an in-memory copy. I was limited to games under 12GB in size requirements, which now a days is nothing. Most AAA titles are 200GB+ on disk.
With 1TB of RAM you could set aside 128GBish for use as normal memory and 850GB as a RAM disk you can use for copy-back installations. Combining this with the fastest available PCI-E 4.0 nVME SSDs, it would even be pleasant considering the "long" boot times. You could have a 1TB fast SSD set aside just as your copy-back target.
Even though SSDs have gotten much much faster than they were a decade ago, they're still slower than RAM. Obviously for server uses with databases there's a need, and large numbers of VMs / containers for density, but in a more desktop-oriented use case it's not that you "need" this much RAM, but you can certainly find really great ways to use it to make your life easier and put you to the next level of performance.
A PCIe4 NVMe can read at around 7 GB/s.
You'll likely find that few applications can actually manage that in practice, because you have to do something with all that stuff: uncompress it, process it into various in-memory data structures, etc. You need a high end CPU to go along with it, as well as software written to do all that decoding in parallel. It may require planning ahead of time just to ensure that it's possible to uncompress data that fast on existing hardware.
Many programs and games aren't going to bother because it massively increases complexity and the benefit isn't a lot for many applications. Eg, having a game load a level in 1 second rather than 15 on a 16 core CPU -- that's neat, but you were going to stay in that level for half an hour anyway, and it's a potential source for bugs.
You're only likely to see code take good advantage of such hardware if it was especially made for it, like you have an enormous world with a very high detail level that can't be preloaded and the code relies on constantly streaming it.
https://www.pcgamer.com/anthem-load-times-tested-hdd-vs-ssd-...
https://hardforum.com/threads/nvme-m-2-ram-drive-raid-sata-i...
Like you said about requiring a bunch of processing, DirectStorage[0] should be able to skip a lot of processing when loading from NVMe. I haven't read that DirectStorage works with RAM disks, but even if it was, there might not be a difference in load times between them. You'd be better off buying more NVMe than RAM, if game load times are your only use case for a RAM drive.
[0] https://devblogs.microsoft.com/directx/directstorage-is-comi...
Exactly. The reason why they don't shown any difference is because games are not optimised for it yet. PS5 and Xbox now set the baseline for storage standard there will be lots of work going into that.
For AAA titles this is pretty commonplace, with progressive loading to eliminate loading zones. The exception is MMOs and single-map multiplayer games (CoD, etc) which have a loading point which they also synchronize users.
For League of Legends, in particular, it was interesting back in the day because it shows you how long it takes each person to load, I'd always be first by a large margin with a RAM drive. Of course it didn't help since you had to wait for everyone to load before you started, but in single-player games it was a huge benefit, especially epic RPGs which had minimal loading zones.
Anything not specifically intended for that scenario will probably load data too slowly for a RAM disk to improve matters, and anything made for a NVMe is going to be made to stream data in real time where it won't make a noticeable difference.
You could run several electron apps at the same time.
You don't really need ram disks, you can preload things to cache[0] and it will work just as if it were a ramdisk.
[0] https://serverfault.com/questions/43383/caching-preloading-f...
And everything is f***ing FAST!1!! :-)
They should just try to build an Open Street Map world map and they would dream of that much RAM!
Intel was doing some interesting work with Optane in this area, using performant SSDs with large RAM caches as DIMMs, seen by the system as memory, but able to be controlled via drivers to act as disks. There's obviously a place at a certain point to blur the lines. The biggest challenge is RAM is not persistent, disk is persistent, and that implies many things both for data structures as well as for how we interact with it and what sort of constraints we can assume.
The nice thing about good RAM disk software is that it's a bit-for-bit representation in memory persisted to disk, which means at least once it's loaded into RAM any processing becomes your only real limiting factor for the copying required to load a file.
I don't think this would be true for linux. since linux's page cache is unified across all mounted file systems, and with linux's tmpfs using the page cache directly for storing files, it doesn't make much sense that it would need to copy files for use.
if you formatted and mounted some other filesystem into the ram, sure. but tmpfs should avoid any such issue.
You'll still need some "scratch space" for the dynamic game state (because you don't want to duplicate the entire image as savegame files), but for asset data I think it makes a lot of sense and could simplify and speed up asset "loading" dramatically.
PS: it would make even more sense to map most asset data directly into GPU memory, don't know how far off affordable 512 GB video cards are though ;)
Is there a tool that can do that?