gamemoded.8 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. .\" Manpage for gamemoded.
  2. .\" Contact linux-contact@feralinteractive.com to correct errors or typos.
  3. .TH gamemoded 8 "21 July 2018" "1.3-dev" "gamemoded man page"
  4. .SH NAME
  5. gamemoded \- optimises system performance on demand
  6. .SH SYNOPSIS
  7. \fBgamemoded\fR [\fB\-d\fR] [\fB\-l\fR] [\fB\-h\fR] [\fB\-v\fR]
  8. .SH DESCRIPTION
  9. \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.
  10. 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.
  11. \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.
  12. .SH OPTIONS
  13. .TP 8
  14. .B \-d
  15. Run the daemon as a separate process (daemonize it)
  16. .TP 8
  17. .B \-l
  18. Log to syslog
  19. .TP 8
  20. .B \-r
  21. Request gamemode and wait for any signal
  22. .TP 8
  23. .B \-s
  24. Query the current status of gamemode
  25. .TP 8
  26. .B \-h
  27. Print help text
  28. .TP 8
  29. .B \-v
  30. Print the version
  31. .SH USAGE
  32. \fBlibgamemodeauto.so.0\fR can be pre-loaded into any program to request \fBgamemoded\fR begin or end the mode, like so:
  33. .RS 4
  34. LD_PRELOAD=/usr/\e$LIB/libgamemodeauto.so.0 \./game
  35. .RE
  36. Or by setting the steam launch options for a game:
  37. .RS 4
  38. LD_PRELOAD=$LD_PRELOAD:/usr/\e$LIB/libgamemodeauto.so.0 %command%
  39. .RE
  40. The \fBgamemode_client.h\fR header can be used by developers to build the requests into a program:
  41. .RS 4
  42. .nf
  43. #include "gamemode_client.h"
  44. if( gamemode_request_start() < 0 ) {
  45. fprintf( stderr, "gamemode request failed: %s\\n", gamemode_error_string() )
  46. }
  47. /* run the process */
  48. /* Not required, gamemoded can clean up after game exits */
  49. gamemode_request_end();
  50. .fi
  51. .RE
  52. Atlernatively developers can define \fBGAMEMODE_AUTO\fR to mimic the behaviour of \fBlibgamemodeauto.so.0\fR:
  53. .RS 4
  54. .nf
  55. #define GAMEMODE_AUTO
  56. #include "gamemode_client.h"
  57. .fi
  58. .RE
  59. Or, distribute \fBlibgamemodeauto.so.0\fR and either link with \fB\-lgamemodeauto\fR or inject it as above with \fBLD\_PRELOAD\fR.
  60. .SH CONFIG
  61. \fBgamemoded\fR will load and merge \fBgamemode.ini\fR config files from these directories in the following order:
  62. .RS 4
  63. /usr/share/gamemode/
  64. .RE
  65. .RS 4
  66. /etc/
  67. .RE
  68. .RS 4
  69. $XDG_CONFIG_HOME or $HOME/.config/
  70. .RE
  71. .RS 4
  72. $PWD
  73. .RE
  74. Behaviour of the config file can be explained by presenting a commented example:
  75. .RS 4
  76. .nf
  77. [general]
  78. ; The reaper thread will check every 10 seconds for exited clients
  79. reaper_freq=10
  80. ; The desired governor is used when entering GameMode instead of "performance"
  81. desiredgov=performance
  82. ; The default governer is used when leaving GameMode instead of restoring the original value
  83. defaultgov=powersave
  84. ; By default, GameMode changes the scheduler policy to SCHED_ISO with 4 or more CPU cores,
  85. ; force enable or disable with "on" or "off"
  86. softrealtime=auto
  87. ; By default, GameMode renices the client to -4, you can put any value between 1 and 20 here,
  88. ; the value will be negated and applied as a nice value
  89. renice = 4
  90. [filter]
  91. ; If "whitelist" entry has a value(s)
  92. ; gamemode will reject anything not in the whitelist
  93. ;whitelist=RiseOfTheTombRaider
  94. ; Gamemode will always reject anything in the blacklist
  95. blacklist=HalfLife3
  96. glxgears
  97. [custom]
  98. ; Custom scripts (executed using the shell) when gamemode starts and ends
  99. start=notify-send "GameMode started"
  100. /home/me/bin/stop_ethmining.sh
  101. end=notify-send "GameMode ended"
  102. /home/me/bin/start_ethmining.sh
  103. .fi
  104. .RE
  105. 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.
  106. .SH SEE ALSO
  107. systemd(1)
  108. .SH ABOUT
  109. GameMode source can be found at \fIhttps://github.com/FeralInteractive/gamemode.git\fR
  110. .SH AUTHOR
  111. Feral Interactive (linux-contact@feralinteractive.com)