ArchWiki / GameMode
ArchWiki / GameMode
ja:Gamemode pl:GameMode zh-hans:GameMode
GameMode is a daemon and library combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS and/or a game process.
Installation
Install the gamemode package. Since many old games are 32-bit-only, enable the multilib repository and install the lib32-gamemode package as well.
Add yourself to the gamemode user group. Without it, the GameMode user daemon will not have rights to change CPU governor or the niceness of processes.
Configuration
GameMode is configured via the following files, which are read and then merged in the following order:
/etc/gamemode.inifor system-wide configuration;$XDG_CONFIG_HOME/gamemode.inifor user-local configuration;./gamemode.inifor directory-local configuration.
FeralInteractive's GitHub repository contains an example configuration file.
/usr/share/gamemode/gamemode.ini should not be created by users, as it is reserved for manual configuration by package maintainers. See file-hierarchy(7) for more details.
The Arch Linux official packages do not include such filehttps://github.com/FeralInteractive/gamemode/blob/c54d6d4243b0dd0afcb49f2c9836d432da171a2b/meson.build#L197-L200https://gitlab.archlinux.org/archlinux/packaging/packages/gamemode/-/blob/4d3e60ac2bfd06fa58373c4e061f689ff5e981f6/PKGBUILD#L42https://gitlab.archlinux.org/archlinux/packaging/packages/lib32-gamemode/-/blob/2ac9dc463fc3ebca36fb1cae39d7828e65137394/PKGBUILD#L41; the defaults are sourced from the software's code defaultshttps://github.com/FeralInteractive/gamemode/blob/c54d6d4243b0dd0afcb49f2c9836d432da171a2b/daemon/gamemode-config.c#L373-L385, which have the same values as the example configuration file.
Renicing
GameMode can optionally adjust the priority of game processes (see renice(1)) beyond the regular user lower limit of 0.
This is controlled by the following configuration option:
[general]
renice=0Unlike renicing a process with the renice command, GameMode uses a positive value then negates it before applying it to the process. For example, a value of 10 will renice the game process to -10.
Overclocking
GameMode can optionally overclock your GPU when it is running, but requires special configuration on part of the user.
Independently of the used GPU, the apply_gpu_optimizations and gpu_device configuration options must be set appropriately.
Settings in [gpu] will not be applied if they are specified in $XDG_CONFIG_HOME/gamemode.ini or ./gamemode.ini, as those are considered "unsafe" config files. These settings will have to be specified in /etc/gamemode.ini to take effect. See the Configuration section on FeralInteractive's GitHub page.
AMD
To alter the performance level of AMD GPUs, overclocking must be manually enabled, and the amd_performance_level configuration option must be set.
NVIDIA
To alter the performance level of NVIDIA GPUs, overclocking must be manually enabled, and the nv_powermizer_mode, nv_core_clock_mhz_offset, and the nv_mem_clock_mhz_offset configuration options must be set.
Usage
Test configuration
Verify if the settings in the configuration file are working:
$ gamemoded -tRun a single game
To run a game with GameMode start it like this:
$ gamemoderun ./gameUse with MangoHud
See MangoHud#Use with GameMode
Verify that GameMode is running
When you have started your game you can verify that GameMode is running with the command:
$ gamemoded -sThe gamemoded.service user unit is started on demand by dbus https://github.com/FeralInteractive/gamemode/pull/62.
Run a single Steam game
To make Steam start a game with GameMode, set its launch command:
gamemoderun %command% [additional launch options]Run Steam with GameMode
To avoid having to change launch options for all Steam games, you may launch Steam directly with GameMode:
$ gamemoderun steamThe downside of this approach is that GameMode will be running for as long as the Steam process is open, instead of only when a game is opened.
Troubleshooting
Renicing fails when set to less than -10
By default, GameMode provides PAM limits that allow changing the scheduling priority up to a maximum of -10. If the renice setting in the configuration file is set to an unsupported value, renicing of the process will fail entirely.
You can adjust the requested value or adjust the maximum scheduling priority GameMode can set by editing /etc/security/limits.d/10-gamemode.conf. The example below configures -19 as the maximum scheduling priority GameMode can set:
@gamemode - nice -19/etc/security/limits.d/10-gamemode.conf