Natalie Vock of Valve’s Linux graphics driver team primarily working on the RADV Vulkan driver has come up with a new interesting creation: patches to the Linux kernel and KDE for sharply improving the gaming experience for those running systems with limited amounts of video memory. Such as for graphics cards with just 8GB of dedicated vRAM, the patches now available — initially on CachyOS for a nice out-of-the-box experience — provide a noticeably better Linux gaming experience.
Natalie Vock’s Linux kernel patches are for the DRM device memory cgroup controller support and changes to the TTM memory management code for how allocations and evictions are handled.
Over in user-space are new packages called dmemcg-booster and plasma-foreground-booster. The dmemcg-booster is a systemd service used for enabling and controlling DMEM cgroup limits for boosting foreground games. The KDE Plasma component enables vRAM prioritization for the foreground application (i.e. fullscreen game). If you aren’t using KDE Plasma as your desktop, the other option is to use newer versions of Valve’s Gamescope compositor.
Long story short, between these kernel and user-space patches it will ensure that the game running on your system has first dibs to the available dedicated video memory before any spilling/eviction comes to the system memory. For systems with ~8GB of vRAM, spilling to the GTT is common but the current default behavior often means some of the allocations made by games end up there rather than lower-priority background apps.
Natalie Vock in a blog post outlines all the technical details on this work and the successes now in runnign Cyberpunk 2077 with Steam Play on Linux with an 8GB vRAM graphics card. For now the easiest way to experience this is using CachyOS but with time hopefully these various components will work their way upstream into the Linux kernel and picked up as part of official KDE packages and other Linux desktop integration for giving games higher vRAM prioritization and dmem cgroup handling.
