123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- .\" Manpage for gamemoded.
- .\" Contact linux-contact@feralinteractive.com to correct errors or typos.
- .TH gamemoded 8 "21 July 2018" "1.3-dev" "gamemoded man page"
- .SH NAME
- gamemoded \- optimises system performance on demand
- .SH SYNOPSIS
- \fBgamemoded\fR [\fB\-d\fR] [\fB\-l\fR] [\fB\-h\fR] [\fB\-v\fR]
- .SH DESCRIPTION
- \fBGameMode\fR is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS.
- The design has a clear cut abstraction between the host daemon and library (\fBgamemoded\fR and \fBlibgamemode\fR), and the client loaders (\fBlibgamemodeauto\fR and \fBgamemode_client.h\fR) that allows for safe usage without worrying about whether the daemon is installed or running. This design also means that while the host library currently relies on systemd for exchanging messages with the daemon, it's entirely possible to implement other internals that still work with the same clients.
- \fBGameMode\fR was designed primarily as a stop-gap solution to problems with the Intel and AMD CPU powersave or ondemand governors, but is intended to be expanded beyond just CPU governor states, as there are a wealth of automation tasks one might want to apply.
- .SH OPTIONS
- .TP 8
- .B \-d
- Run the daemon as a separate process (daemonize it)
- .TP 8
- .B \-l
- Log to syslog
- .TP 8
- .B \-r
- Request gamemode and wait for any signal
- .TP 8
- .B \-s
- Query the current status of gamemode
- .TP 8
- .B \-h
- Print help text
- .TP 8
- .B \-t
- Run diagnostic tests on the current installation
- .TP 8
- .B \-v
- Print the version
- .SH USAGE
- \fBlibgamemodeauto.so.0\fR can be pre-loaded into any program to request \fBgamemoded\fR begin or end the mode, like so:
- .RS 4
- gamemoderun \./game
- .RE
- Or by setting the steam launch options for a game:
- .RS 4
- gamemoderun %command%
- .RE
- The library can be manually preloaded if needed:
- .RS 4
- LD_PRELOAD=$LD_PRELOAD:/usr/\e$LIB/libgamemodeauto.so.0 ./game
- .RE
- The \fBgamemode_client.h\fR header can be used by developers to build the requests into a program:
- .RS 4
- .nf
- #include "gamemode_client.h"
- if( gamemode_request_start() < 0 ) {
- fprintf( stderr, "gamemode request failed: %s\\n", gamemode_error_string() )
- }
- /* run the process */
- /* Not required, gamemoded can clean up after game exits */
- gamemode_request_end();
- .fi
- .RE
- Atlernatively developers can define \fBGAMEMODE_AUTO\fR to mimic the behaviour of \fBlibgamemodeauto.so.0\fR:
- .RS 4
- .nf
- #define GAMEMODE_AUTO
- #include "gamemode_client.h"
- .fi
- .RE
- Or, distribute \fBlibgamemodeauto.so.0\fR and either link with \fB\-lgamemodeauto\fR or inject it as above with \fBLD\_PRELOAD\fR.
- .SH CONFIG
- \fBgamemoded\fR will load and merge \fBgamemode.ini\fR config files from these directories in the following order:
- .RS 4
- /usr/share/gamemode/
- .RE
- .RS 4
- /etc/
- .RE
- .RS 4
- $XDG_CONFIG_HOME or $HOME/.config/
- .RE
- .RS 4
- $PWD
- .RE
- Behaviour of the config file can be explained by presenting a commented example:
- .RS 4
- .nf
- [general]
- ; The reaper thread will check every 10 seconds for exited clients
- reaper_freq=10
- ; The desired governor is used when entering GameMode instead of "performance"
- desiredgov=performance
- ; The default governer is used when leaving GameMode instead of restoring the original value
- defaultgov=powersave
- ; By default, GameMode changes the scheduler policy to SCHED_ISO with 4 or more CPU cores,
- ; force enable or disable with "on" or "off"
- softrealtime=auto
- ; By default, GameMode renices the client to -4, you can put any value between 1 and 20 here,
- ; the value will be negated and applied as a nice value
- renice = 4
- ; By default, GameMode adjusts the iopriority of clients to BE/0, you can put any value
- ; between 0 and 7 here (with 0 being highest priority), or one of the special values
- ; "off" (to disable) or "reset" (to restore Linux default behavior based on CPU priority),
- ; currently, only the best-effort class is supported thus you cannot set it here
- ioprio = 0
- [filter]
- ; If "whitelist" entry has a value(s)
- ; gamemode will reject anything not in the whitelist
- ;whitelist=RiseOfTheTombRaider
- ; Gamemode will always reject anything in the blacklist
- blacklist=HalfLife3
- glxgears
- [custom]
- ; Custom scripts (executed using the shell) when gamemode starts and ends
- start=notify-send "GameMode started"
- /home/me/bin/stop_ethmining.sh
- end=notify-send "GameMode ended"
- /home/me/bin/start_ethmining.sh
- .fi
- .RE
- This config file will currently reject any games that match \fIHalfLife3\fR or \fIglxgears\fR, but can be modified to only accept \fIRiseOfTheTombRaider\fR by removing the semicolon preceding the fourth line.
- .SH SEE ALSO
- systemd(1)
- .SH ABOUT
- GameMode source can be found at \fIhttps://github.com/FeralInteractive/gamemode.git\fR
- .SH AUTHOR
- Feral Interactive (linux-contact@feralinteractive.com)
|