Maze Linux / Wiki

Gaming

Steam, GameMode, MangoHud and gamescope come installed. The maze-gaming package sets them up so games start faster and run smoother, without changing how the system behaves when no game is running.


What maze-gaming does

PartWhat it changes
Steam shader pre-compileSteam compiles Vulkan shaders on all CPU threads instead of a few (at most one thread per 2 GB of RAM, so smaller machines do not run out of memory). "Processing Vulkan shaders" finishes much sooner.
Shader cachesNVIDIA and Mesa shader caches can grow up to 12 GB, so one large game does not push out the shaders of another and they are not compiled again on every launch. The cache only grows as needed.
GameModeWhile a game runs under GameMode: performance CPU governor, screensaver blocked, split-lock mitigation off.
Gaming schedulerWhile a game runs under GameMode, the scx_lavd CPU scheduler (sched_ext) is started for lower latency, and stopped when the last game exits. If you already run a sched_ext scheduler of your own, it is left alone.
ntsyncThe ntsync kernel module is loaded at boot, so Wine/Proton 10+ can handle Windows sync objects in the kernel — less CPU overhead, fewer stutters.
MangoHudFPS and frame-time overlay, ready to use.

None of this is active outside a game except the shader cache sizes and the ntsync module.


Check what is active

maze-gaming status

It shows the shader cache sizes, Steam's shader thread setting, whether /dev/ntsync exists, the sched_ext state and GameMode's status.

If the shader cache lines say unset, log out and back in once.


Steam launch options

GameMode (and with it the gaming scheduler) only starts for games launched through it. In Steam, right-click a game → Properties → General → Launch Options and enter:

gamemoderun %command%

With the MangoHud overlay as well:

gamemoderun mangohud %command%

Settings — /etc/maze-gaming.conf

sudo nano /etc/maze-gaming.conf
SettingDefaultMeaning
MAZE_GAMING_SCX_SCHEDscx_lavdScheduler started during games. Other choices: scx_bpfland, scx_cosmos, scx_flash, scx_p2dq, scx_rusty. Empty = never touch the CPU scheduler.
MAZE_GAMING_SCX_MODEgamingMode passed to the scheduler.
MAZE_GAMING_SHADER_THREADSautoThreads Steam may use for shader pre-compilation. auto = all CPU threads, at most one per 2 GB of RAM. A number sets it exactly; empty = leave Steam's setting alone.

Scheduler changes apply on the next game launch; shader thread changes on the next login. A shader thread value you set by hand in Steam's steam_dev.cfg is never overwritten.

Shader cache sizes are set in /usr/lib/environment.d/60-maze-gaming.conf. To change them, put a file with the same variable in ~/.config/environment.d/ — yours wins.


32-bit games

Many games and Proton itself need 32-bit libraries. These come from Arch's [multilib] repository, which is enabled on Maze. For GameMode and MangoHud in 32-bit native games:

sudo pacman -S lib32-gamemode lib32-mangohud

Non-Steam games

For Lutris, Heroic and other launchers, umu-launcher runs games with Proton outside Steam:

sudo pacman -S umu-launcher

The larger shader caches apply to these games too.


See also