GameMode

From ArchWiki
(Redirected from 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 gamemode and lib32-gamemode.

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:

  1. /etc/gamemode.ini for system-wide configuration;
  2. $XDG_CONFIG_HOME/gamemode.ini for user-local configuration;
  3. ./gamemode.ini for directory-local configuration.
Tip: An example configuration file with comments can be found on FeralInteractive's GitHub.
Note: /usr/share/gamemode/gamemode.ini should not be created by users, as it's reserved for manual configuration by package maintainers. See file-hierarchy(7) for more details.

Renicing

GameMode can optionally adjust the priority of game processes (see renice(1)) to beyond the regular user lower limit of 0.

This is controlled by the following configuration option:

[general]
renice=0

Unlike renicing a process with the renice command, GameMode uses a positive value and negates it before applying it to the process, ie, 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.

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 -t

Run a single game

To run a game with GameMode start it like this:

$ gamemoderun ./game

Use 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 -s
Note: The gamemoded.service user unit is started on demand by dbus [1].

Run a single Steam game

To make Steam start a game with GameMode, right click the game in the Library, select Properties..., then in the Launch Options text box enter:

gamemoderun %command%

Run Steam with GameMode

To avoid having to change launch options for all Steam games, you may launch Steam directly with GameMode:

$ gamemoderun steam-runtime

The 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:

/etc/security/limits.d/10-gamemode.conf
@gamemode - nice -19