1gamemoded(8)                  gamemoded man page                  gamemoded(8)
2
3
4

NAME

6       gamemoded - optimises system performance on demand
7

SYNOPSIS

9       gamemoded [OPTIONS...]
10

DESCRIPTION

12       GameMode is a daemon/lib combo for Linux that allows games to request a
13       set of optimisations be temporarily applied to the host OS.
14
15       The design has a clear cut abstraction  between  the  host  daemon  and
16       library (gamemoded and libgamemode), and the client loaders (libgamemo‐
17       deauto and gamemode_client.h) that allows for safe usage without worry‐
18       ing  about whether the daemon is installed or running. This design also
19       means that while the host  library  currently  relies  on  systemd  for
20       exchanging  messages  with the daemon, it's entirely possible to imple‐
21       ment other internals that still work with the same clients.
22
23       GameMode was designed primarily as a stop-gap solution to problems with
24       the  Intel and AMD CPU powersave or ondemand governors, but is intended
25       to be expanded beyond just CPU governor states, as there are  a  wealth
26       of automation tasks one might want to apply.
27

OPTIONS

29       -r[PID], --request=[PID]
30               Toggle  gamemode  for  process.   When  no  PID given, requests
31               gamemode and pauses
32
33       -s[PID], --status=[PID]
34               Query the status of gamemode for process  When  no  PID  given,
35               queries the status globally
36
37       -d, --daemonize
38               Run the daemon as a separate process (daemonize it)
39
40       -l, --log-to-syslog
41               Log to syslog
42
43       -h, --help
44               Print help text
45
46       -t, --test
47               Run diagnostic tests on the current installation
48
49       -v, --version
50               Print the version
51
52

USAGE

54       libgamemodeauto.so.0  can  be  pre-loaded  into  any program to request
55       gamemoded begin or end the mode, like so:
56
57           gamemoderun ./game
58
59       Or by setting the Steam launch options for a game:
60
61           gamemoderun %command%
62
63       The library can be manually preloaded if needed:
64
65           LD_PRELOAD=$LD_PRELOAD:/usr/\$LIB/libgamemodeauto.so.0 ./game
66
67       It is possible to set additional start commands to gamemoderun by  set‐
68       ting the environment variable:
69
70           GAMEMODERUNEXEC="command"
71
72       When  this  is  set, gamemoderun will execute the command given by that
73       environment variable, and the command line passed to  gamemoderun  will
74       be passed as arguments to that command. GameMode will not be applied to
75       the wrapper command, just the game itself.
76
77       The gamemode_client.h header can be used by  developers  to  build  the
78       requests into a program:
79
80           #include "gamemode_client.h"
81
82               if( gamemode_request_start() < 0 ) {
83                   fprintf( stderr, "gamemode request failed: %s\n", gamemode_error_string() )
84               }
85
86               /* run the process */
87
88               /* Not required, gamemoded can clean up after game exits */
89               gamemode_request_end();
90
91       Atlernatively  developers  can define GAMEMODE_AUTO to mimic the behav‐
92       iour of libgamemodeauto.so.0:
93
94           #define GAMEMODE_AUTO
95           #include "gamemode_client.h"
96
97       Or, distribute libgamemodeauto.so.0 and either link with -lgamemodeauto
98       or inject it as above with LD_PRELOAD.
99
100

CONFIG

102       gamemoded  will  load  and  merge  gamemode.ini config files from these
103       directories in the following order:
104
105           /usr/share/gamemode/
106           /etc/
107           $XDG_CONFIG_HOME or $HOME/.config/
108           $PWD
109
110       Behaviour of the config file can be explained by presenting a commented
111       example:
112
113           [general]
114           ; The reaper thread will check every 5 seconds for exited clients and for config file changes
115           reaper_freq=5
116
117           ; The desired governor is used when entering GameMode instead of "performance"
118           desiredgov=performance
119           ; The default governer is used when leaving GameMode instead of restoring the original value
120           defaultgov=powersave
121
122           ; GameMode can change the scheduler policy to SCHED_ISO on kernels which support it (currently
123           ; not supported by upstream kernels). Can be set to "auto", "on" or "off". "auto" will enable
124           ; with 4 or more CPU cores. "on" will always enable. Defaults to "off".
125           softrealtime=off
126
127           ; GameMode can renice game processes. You can put any value between 0 and 20 here, the value
128           ; will be negated and applied as a nice value (0 means no change). Defaults to 0.
129           renice=0
130
131           ; By default, GameMode adjusts the iopriority of clients to BE/0, you can put any value
132           ; between 0 and 7 here (with 0 being highest priority), or one of the special values
133           ; "off" (to disable) or "reset" (to restore Linux default behavior based on CPU priority),
134           ; currently, only the best-effort class is supported thus you cannot set it here
135           ioprio=0
136
137           ; Sets whether gamemode will inhibit the screensaver when active
138           ; Defaults to 1
139           inhibit_screensaver=1
140
141           [filter]
142           ; If "whitelist" entry has a value(s)
143           ; gamemode will reject anything not in the whitelist
144           ;whitelist=RiseOfTheTombRaider
145
146           ; Gamemode will always reject anything in the blacklist
147           ;blacklist=HalfLife3
148           ;    glxgears
149
150           [gpu]
151           ; Here Be Dragons!
152           ; Warning: Use these settings at your own risk
153           ; Any damage to hardware incurred due to this feature is your responsibility and yours alone
154           ; It is also highly recommended you try these settings out first manually to find the sweet spots
155
156           ; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
157           ;apply_gpu_optimisations=0
158
159           ; The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/
160           ;gpu_device=0
161
162           ; Nvidia specific settings
163           ; Requires the coolbits extension activated in nvidia-xconfig
164           ; This corresponds to the desired GPUPowerMizerMode
165           ; "Adaptive"=0 "Prefer Maximum Performance"=1 and "Auto"=2
166           ; See NV_CTRL_GPU_POWER_MIZER_MODE and friends in https://github.com/NVIDIA/nvidia-settings/blob/master/src/libXNVCtrl/NVCtrl.h
167           ;nv_powermizer_mode=1
168
169           ; These will modify the core and mem clocks of the highest perf state in the Nvidia PowerMizer
170           ; They are measured as Mhz offsets from the baseline, 0 will reset values to default, -1 or unset will not modify values
171           ;nv_core_clock_mhz_offset=0
172           ;nv_mem_clock_mhz_offset=0
173
174           ; AMD specific settings
175           ; Requires a relatively up to date AMDGPU kernel module
176           ; See: https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring
177           ; It is also highly recommended you use lm-sensors (or other available tools) to verify card temperatures
178           ; This corresponds to power_dpm_force_performance_level, "manual" is not supported for now
179           ;amd_performance_level=high
180
181           [supervisor]
182           ; This section controls the new gamemode functions gamemode_request_start_for and gamemode_request_end_for
183           ; The whilelist and blacklist control which supervisor programs are allowed to make the above requests
184           ;supervisor_whitelist=
185           ;supervisor_blacklist=
186
187           ; In case you want to allow a supervisor to take full control of gamemode, this option can be set
188           ; This will only allow gamemode clients to be registered by using the above functions by a supervisor client
189           ;require_supervisor=0
190
191           [custom]
192           ; Custom scripts (executed using the shell) when gamemode starts and ends
193           ;start=notify-send "GameMode started"
194           ;    /home/me/bin/stop_ethmining.sh
195
196           ;end=notify-send "GameMode ended"
197           ;    /home/me/bin/start_ethmining.sh
198
199           ; Timeout for scripts (seconds). Scripts will be killed if they do not complete within this time.
200           ;script_timeout=10
201
202

SEE ALSO

204       systemd(1)
205
206

ABOUT

208       GameMode   source  can  be  found  at  https://github.com/FeralInterac
209       tive/gamemode.git
210
211

AUTHOR

213       Feral Interactive (linux-contact@feralinteractive.com)
214
215
216
2171.4                              21 July 2019                     gamemoded(8)
Impressum