gamemoded.8.in 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. .\" Manpage for gamemoded.
  2. .\" Contact linux-contact@feralinteractive.com to correct errors or typos.
  3. .TH gamemoded 8 "21 July 2019" "1.5-dev" "gamemoded man page"
  4. .SH NAME
  5. gamemoded \- optimises system performance on demand
  6. .SH SYNOPSIS
  7. \fBgamemoded\fR [OPTIONS...]
  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 \-r[PID], \-\-request=[PID]
  15. Toggle gamemode for process.
  16. When no PID given, requests gamemode and pauses
  17. .TP 8
  18. .B \-s[PID], \-\-status=[PID]
  19. Query the status of gamemode for process
  20. When no PID given, queries the status globally
  21. .TP 8
  22. .B \-d, \-\-daemonize
  23. Run the daemon as a separate process (daemonize it)
  24. .TP 8
  25. .B \-l, \-\-log-to-syslog
  26. Log to syslog
  27. .TP 8
  28. .B \-h, \-\-help
  29. Print help text
  30. .TP 8
  31. .B \-t, \-\-test
  32. Run diagnostic tests on the current installation
  33. .TP 8
  34. .B \-v, \-\-version
  35. Print the version
  36. .SH USAGE
  37. \fBlibgamemodeauto.so.0\fR can be pre-loaded into any program to request \fBgamemoded\fR begin or end the mode, like so:
  38. .RS 4
  39. gamemoderun \./game
  40. .RE
  41. Or by setting the Steam launch options for a game:
  42. .RS 4
  43. gamemoderun %command%
  44. .RE
  45. The library can be manually preloaded if needed:
  46. .RS 4
  47. LD_PRELOAD=$LD_PRELOAD:/usr/\e$LIB/libgamemodeauto.so.0 ./game
  48. .RE
  49. It is possible to set additional start commands to gamemoderun by setting the environment variable:
  50. .RS 4
  51. GAMEMODERUNEXEC="command"
  52. .RE
  53. When this is set, gamemoderun will execute the command given by that environment variable, and the command line passed to gamemoderun will be passed as arguments to that command. GameMode will not be applied to the wrapper command, just the game itself.
  54. The \fBgamemode_client.h\fR header can be used by developers to build the requests into a program:
  55. .RS 4
  56. .nf
  57. #include "gamemode_client.h"
  58. if( gamemode_request_start() < 0 ) {
  59. fprintf( stderr, "gamemode request failed: %s\\n", gamemode_error_string() )
  60. }
  61. /* run the process */
  62. /* Not required, gamemoded can clean up after game exits */
  63. gamemode_request_end();
  64. .fi
  65. .RE
  66. Atlernatively developers can define \fBGAMEMODE_AUTO\fR to mimic the behaviour of \fBlibgamemodeauto.so.0\fR:
  67. .RS 4
  68. .nf
  69. #define GAMEMODE_AUTO
  70. #include "gamemode_client.h"
  71. .fi
  72. .RE
  73. Or, distribute \fBlibgamemodeauto.so.0\fR and either link with \fB\-lgamemodeauto\fR or inject it as above with \fBLD\_PRELOAD\fR.
  74. .SH CONFIG
  75. \fBgamemoded\fR will load and merge \fBgamemode.ini\fR config files from these directories in the following order:
  76. .RS 4
  77. /usr/share/gamemode/
  78. .RE
  79. .RS 4
  80. /etc/
  81. .RE
  82. .RS 4
  83. $XDG_CONFIG_HOME or $HOME/.config/
  84. .RE
  85. .RS 4
  86. $PWD
  87. .RE
  88. Behaviour of the config file can be explained by presenting a commented example:
  89. .RS 4
  90. .nf
  91. @GAMEMODE_EXAMPLE_CONFIG@
  92. .fi
  93. .RE
  94. .SH SEE ALSO
  95. systemd(1)
  96. .SH ABOUT
  97. GameMode source can be found at \fIhttps://github.com/FeralInteractive/gamemode.git\fR
  98. .SH AUTHOR
  99. Feral Interactive (linux-contact@feralinteractive.com)