gamemoded.1 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. .\" Manpage for gamemoded.
  2. .\" Contact linux-contact@feralinteractive.com to correct errors or typos.
  3. .TH gamemoded 1 "6 March 2018" "1.1" "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\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 \./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 %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\fR:
  53. .RS 4
  54. .nf
  55. #define GAMEMODE_AUTO
  56. #include "gamemode_client.h"
  57. .fi
  58. .RE
  59. Or, distribute \fBlibgamemodeauto.so\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. [filter]
  81. ; If "whitelist" entry has a value(s)
  82. ; gamemode will reject anything not in the whitelist
  83. ;whitelist=RiseOfTheTombRaider
  84. ; Gamemode will always reject anything in the blacklist
  85. blacklist=HalfLife3
  86. glxgears
  87. [custom]
  88. ; Custom scripts (executed using the shell) when gamemode starts and ends
  89. start=notify-send "GameMode started"
  90. /home/me/bin/stop_ethmining.sh
  91. end=notify-send "GameMode ended"
  92. /home/me/bin/start_ethmining.sh
  93. .fi
  94. .RE
  95. 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.
  96. .SH SEE ALSO
  97. systemd(1)
  98. .SH ABOUT
  99. GameMode source can be found at \fIhttps://github.com/FeralInteractive/gamemode.git\fR
  100. .SH AUTHOR
  101. Feral Interactive (linux-contact@feralinteractive.com)