feat: VRAM booster for every supported GPU, not only the Steam Machine

This commit is contained in:
theupriser committed 2026-09-27 12:51:47 +02:00
1 parent fd162c1e2e
commit 3f97c85c3c
8 files changed
+53 -40

No files matched your search

+11 -5
View File
@@ -1,9 +1,10 @@
#!/bin/bash
# "VRAM booster" menu item (vram), a sub-option of Steam Machine support
# ticked along with it (opt-out), like SteamOS 3.9's dGPU VRAM management:
# the game in front keeps its VRAM, background apps are evicted first, so a
# game on the 8 GB GPU doesn't spill into system RAM and stutter. The kernel
# side is the dmem cgroup controller (7.2); CachyOS packages the userspace
# "VRAM booster" menu item (vram), ticked by default, like SteamOS 3.9's
# dGPU VRAM management: the game in front keeps its VRAM, background apps
# are evicted first, so a game that needs most of it doesn't spill into
# system RAM and stutter. The kernel side is the dmem cgroup controller
# (7.2; amdgpu and xe register their VRAM, NVIDIA's driver doesn't), so it's
# only offered when the kernel lists a region. CachyOS packages the userspace
# side: dmemcg-booster (a system service that enables the controller and
# sets the limits, plus a user service) and plasma-foreground-booster, which
# tells it which window is in front on the desktop. The latter only starts
@@ -12,6 +13,11 @@
VRAM_PKGS=(dmemcg-booster plasma-foreground-booster)
vram_available() {
# cgroupfs files have size 0, so read it.
grep -q . /sys/fs/cgroup/dmem.capacity 2>/dev/null || vram_status
}
vram_status() {
pacman -Q "${VRAM_PKGS[@]}" >/dev/null 2>&1 &&
systemctl is-enabled -q dmemcg-booster-system.service 2>/dev/null &&