1gamemoded(8) gamemoded man page gamemoded(8)
2
3
4
6 gamemoded - optimises system performance on demand
7
9 gamemoded [OPTIONS...]
10
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
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
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
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, for config file changes, and for the CPU/iGPU power balance
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 ; The iGPU desired governor is used when the integrated GPU is under heavy load
123 igpu_desiredgov=powersave
124 ; Threshold to use to decide when the integrated GPU is under heavy load.
125 ; This is a ratio of iGPU Watts / CPU Watts which is used to determine when the
126 ; integraged GPU is under heavy enough load to justify switching to
127 ; igpu_desiredgov. Set this to -1 to disable all iGPU checking and always
128 ; use desiredgov for games.
129 igpu_power_threshold=0.3
130
131 ; GameMode can change the scheduler policy to SCHED_ISO on kernels which support it (currently
132 ; not supported by upstream kernels). Can be set to "auto", "on" or "off". "auto" will enable
133 ; with 4 or more CPU cores. "on" will always enable. Defaults to "off".
134 softrealtime=off
135
136 ; GameMode can renice game processes. You can put any value between 0 and 20 here, the value
137 ; will be negated and applied as a nice value (0 means no change). Defaults to 0.
138 renice=0
139
140 ; By default, GameMode adjusts the iopriority of clients to BE/0, you can put any value
141 ; between 0 and 7 here (with 0 being highest priority), or one of the special values
142 ; "off" (to disable) or "reset" (to restore Linux default behavior based on CPU priority),
143 ; currently, only the best-effort class is supported thus you cannot set it here
144 ioprio=0
145
146 ; Sets whether gamemode will inhibit the screensaver when active
147 ; Defaults to 1
148 inhibit_screensaver=1
149
150 [filter]
151 ; If "whitelist" entry has a value(s)
152 ; gamemode will reject anything not in the whitelist
153 ;whitelist=RiseOfTheTombRaider
154
155 ; Gamemode will always reject anything in the blacklist
156 ;blacklist=HalfLife3
157 ; glxgears
158
159 [gpu]
160 ; Here Be Dragons!
161 ; Warning: Use these settings at your own risk
162 ; Any damage to hardware incurred due to this feature is your responsibility and yours alone
163 ; It is also highly recommended you try these settings out first manually to find the sweet spots
164
165 ; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
166 ;apply_gpu_optimisations=0
167
168 ; The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/
169 ;gpu_device=0
170
171 ; Nvidia specific settings
172 ; Requires the coolbits extension activated in nvidia-xconfig
173 ; This corresponds to the desired GPUPowerMizerMode
174 ; "Adaptive"=0 "Prefer Maximum Performance"=1 and "Auto"=2
175 ; See NV_CTRL_GPU_POWER_MIZER_MODE and friends in https://github.com/NVIDIA/nvidia-settings/blob/master/src/libXNVCtrl/NVCtrl.h
176 ;nv_powermizer_mode=1
177
178 ; These will modify the core and mem clocks of the highest perf state in the Nvidia PowerMizer
179 ; They are measured as Mhz offsets from the baseline, 0 will reset values to default, -1 or unset will not modify values
180 ;nv_core_clock_mhz_offset=0
181 ;nv_mem_clock_mhz_offset=0
182
183 ; AMD specific settings
184 ; Requires a relatively up to date AMDGPU kernel module
185 ; See: https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring
186 ; It is also highly recommended you use lm-sensors (or other available tools) to verify card temperatures
187 ; This corresponds to power_dpm_force_performance_level, "manual" is not supported for now
188 ;amd_performance_level=high
189
190 [supervisor]
191 ; This section controls the new gamemode functions gamemode_request_start_for and gamemode_request_end_for
192 ; The whilelist and blacklist control which supervisor programs are allowed to make the above requests
193 ;supervisor_whitelist=
194 ;supervisor_blacklist=
195
196 ; In case you want to allow a supervisor to take full control of gamemode, this option can be set
197 ; This will only allow gamemode clients to be registered by using the above functions by a supervisor client
198 ;require_supervisor=0
199
200 [custom]
201 ; Custom scripts (executed using the shell) when gamemode starts and ends
202 ;start=notify-send "GameMode started"
203 ; /home/me/bin/stop_ethmining.sh
204
205 ;end=notify-send "GameMode ended"
206 ; /home/me/bin/start_ethmining.sh
207
208 ; Timeout for scripts (seconds). Scripts will be killed if they do not complete within this time.
209 ;script_timeout=10
210
211
213 systemd(1)
214
215
217 GameMode source can be found at https://github.com/FeralInterac‐
218 tive/gamemode.git
219
220
222 Feral Interactive (linux-contact@feralinteractive.com)
223
224
225
2261.5 22 Jan 2020 gamemoded(8)