54 Commits

Author SHA1 Message Date
Anjune
29b4148a00 Make system revert to previous governor instead of "powersave"
See issue 214.
2020-05-06 11:32:10 +01:00
Stephan Lachnit
094905f7f8 rename example to gamemode-simulate-game
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2020-05-06 11:02:29 +01:00
Ahsan Fayaz
40702d3fed Update version back to 1.6 post-release 2020-03-03 16:35:37 +00:00
Ahsan Fayaz
616dca659a Update version to 1.5.1 2020-03-03 16:18:48 +00:00
Ahsan Fayaz
065454bb4e Update version to 1.6 post-release 2020-01-22 14:51:00 +00:00
Ahsan Fayaz
d58c59c183 Update version to 1.5 2020-01-22 14:19:26 +00:00
Jason Ekstrand
688373a260 Add an option for using a different governor for integrated GPUs
This commit adds two new configuration options: igpu_desiredgov and
igpu_power_threshold which allow for a different CPU governor when the
Intel integrated GPU is under load.  This currently only applies to
Intel integrated GPUs and not AMD APUs because it uses the Intel RAPL
infrastructure for getting power information.  If on a platform that
without an Intel integrated GPU or where the kernel does not support
RAPL, the new options will be ignored and it will fall back to the old
behavior.

One of the core principals of gamemoded to date has been that, when
playing a game, we want to use the "performance" CPU governor to
increase CPU performance and prevent CPU-limiting.  However, when the
integrated GPU is under load, this can be counter-productive because the
CPU and GPU share a thermal and power budget.  By throwing the CPU
governor to "performance" game mode currently makes the CPU frequency
management far too aggressive and it burns more power than needed.  With
a discrete GPU, this is fine because the worst that happens is a bit
more fan noise.  With an integrated GPU, however, the additional power
being burned by the CPU is power not available to the GPU and this can
cause the GPU to clock down and lead to significantly worse performance.

By using the "powersave" governor instead of the "performance" governor
while the integrated GPU is under load, we can save power on the CPU
side which lets the GPU clock up higher.  On my Razer Blade Stealth 13
with an i7-1065G7, this improves the performance of "Shadow of the Tomb
Raider" by around 25-30% according to its internal benchmark mode.
2020-01-09 10:49:19 -06:00
Alex Smith
24687f960b Update version to 1.5-dev post-release 2019-07-21 10:39:11 +01:00
Alex Smith
acb57735fc Update version to 1.4 2019-07-21 10:24:18 +01:00
Marc Di Luzio
c276f760c7 Add comment about the reaper thread dealing with config file changes 2019-05-19 11:15:47 +01:00
Alex Smith
95c365076f Update to version 1.4-dev post-release 2019-03-15 16:11:57 +00:00
Alex Smith
10a31f8dec Update copyright years to 2019 2019-03-14 16:59:30 +00:00
Alex Smith
5ee2f3c06a Adjust reaper_freq to match the default value set in code 2019-03-14 15:58:28 +00:00
Alex Smith
4306660918 Adjust renice documentation 2019-03-14 15:11:10 +00:00
Alex Smith
2ab46df4c3 Disable softrealtime (SCHED_ISO) and renice by default
SCHED_ISO is not supported by upstream kernels, so don't try to use this by
default since for most users it will result in an error log that trying to
set the scheduling policy fails.

Without extra system configuration, we will also not have permission to renice
processes by default, so out of the box doing this will fail as well.

Users that wish to use these features can enable them from the config once
they have configured their system appropriately.
2019-03-14 15:00:49 +00:00
Marc Di Luzio
fec32ac53d Remove the nv_perf_level config option and figure it out programmatically
This also fixes the instances in testing where we don't have the nv overclock in use, but we do have the mode set

	Solves issues explaining the what the perf_level actually meant, and future proofs for any PR that wants to set individual perf levels
2019-03-10 15:19:34 +00:00
Marc Di Luzio
5e5cae31d3 Explain a little more about nv_perf_level
We think this was a little confusing, so explain some more.
2019-03-10 12:38:31 +00:00
Marc Di Luzio
eb9bb0cdf7 Add notes on values for nv_powermizer_mode
Instead of just suggesting values
2019-03-10 11:54:54 +00:00
Alex Smith
26ec6ad2b4 Document script_timeout 2019-03-10 10:49:06 +00:00
Marc Di Luzio
834a18aab4 Implement nv_powermizer_mode option to allow setting the Nvidia powermizer mode 2019-03-10 10:32:08 +00:00
Marc Di Luzio
9ade4481c3 Change AMD overclocking to simply be setting the power_dpm_force_performance_level file for now
This covers the MVP for now, and simply allows pinning the power level to "high"

	Full overclocking set up is somewhat more complicated, and it'll be better to implement that at the same time as the same for Nvidia, where we're currently only really setting the top end power level
2019-03-10 10:32:08 +00:00
Alex Smith
3c28e84700 Merge pull request #105 from mdiluz/auto-detect-vendor
Detect the GPU vendor automatically
2019-03-04 08:43:58 +00:00
Marc Di Luzio
a5543880f3 Clarify ini file description
As requested in #105
2019-03-01 18:13:58 +00:00
Marc Di Luzio
1430c0b831 Implement supervisor features using new config variables
This allows direct control over who can make requests on behalf of other processes

	require_supervisor can also be used to allow a supervisor to take direct control of gamemode on the system (perhaps a GUI, or game launcher)
2019-02-21 17:34:20 +00:00
Marc Di Luzio
0847d3b452 Remove the vendor config value in prep for it to be auto-detected 2019-02-21 17:26:14 +00:00
Marc Di Luzio
c7da9ff9ea Reword advice in the example ini file to clear up confusion with the PCI ID 2019-02-15 18:20:52 +00:00
Marc Di Luzio
142b2fb32d Also add nv_perf_level for nvidia (needed as a parameter to nvidia-xsettings) 2019-02-12 08:55:23 +00:00
Marc Di Luzio
6b268e8349 Convert "apply_gpu_optimisations" to a string with a special key 2019-02-12 08:55:23 +00:00
Marc Di Luzio
7bdbc1adc5 Add more helper comments to the config ini 2019-02-12 08:55:23 +00:00
Marc Di Luzio
ad2c218ab3 Allow setting the device value with a hex string
Also stops erroring on 0 value longs
2019-02-12 08:55:23 +00:00
Marc Di Luzio
cee2351c55 Add config for vendor and device 2019-02-12 08:55:23 +00:00
Marc Di Luzio
b1bf33d386 Add config parameters for GPU clocking 2019-02-12 08:55:23 +00:00
Marc Di Luzio
ba49055519 Set up inhibit_screensaver config option to disable the feature 2019-02-03 15:45:11 +00:00
Kai Krakow
ebf177bebe daemon-config: Add ioprio configuration option
Signed-off-by: Kai Krakow <kai@kaishome.de>
2018-10-01 19:34:46 +02:00
Alex Smith
fdfc6edfd9 Comment out some sections in the example configuration file
Avoid potential issues if the config file is copied without modification.
2018-07-23 17:10:32 +01:00
Alex Smith
2ae86fabd6 Update to version 1.3-dev post-1.2 release 2018-07-21 09:48:40 +01:00
Kai Krakow
57c6bbb444 config: Allow renice configuration
This commit adds configuration support for the renice value and amends
documentation and examples. This commit by itself does nothing, the
following commit is needed to actually apply the new settings.

Signed-off-by: Kai Krakow <kai@kaishome.de>
2018-06-10 09:33:02 +02:00
Kai Krakow
9dfd718807 config: Introduce new setting "softrealtime"
This adds support for a new configuration option "softrealtime" to be
read from the general section. This commit alone does nothing, the
following commit adds actually making use of the value.

Signed-off-by: Kai Krakow <kai@kaishome.de>
2018-05-24 22:41:04 +02:00
Marc Di Luzio
fec4732740 Add an example .desktop file
As seen in Issue #45 (thanks OlliC)

This can be placed in ~/.local/share/applications/ to allow easier (re)launching of gamemode, in particular when the DISPLAY param is needed
2018-05-16 08:42:19 +01:00
Marc Di Luzio
5ebc77a0f1 Add defaultgov and desiredgov config settings
Allows users to choose which governor settings they want.

	Should provide some future compatibility for other governor settings.
2018-05-15 17:04:31 +01:00
Marc Di Luzio
d9072607d9 Label master as 1.2-dev 2018-05-11 14:53:30 +01:00
Marc Di Luzio
fb2f3c628a Update to 1.1 ready for release 2018-04-25 15:50:05 +01:00
Marc Di Luzio
d88168d39c Update the current example config file 2018-04-24 17:14:12 +01:00
Leonard
752d877196 Minor C cleanup (#27)
* Minor C cleanup

 - some symbols can be made static:
    1. set_gov_state
    2. everything in gamemode_client.h
 - daemonize() can also take a const char*, since the name is only
   passed to printf() or syslog()
 - prevent shadowing of variables
 - use explicit (void) as parameter-list more consistently
 - use some more const.
   Move cast to more appropriate place and document that execv() behaves
   as if args where of type const *char and we trust on that.
 - example: Just use main(void), which is also an acceptable ISO-C decl
 - example: Use stderr for errors

* Fix -Wold-style-declaration issue
2018-04-16 17:21:35 +01:00
grmat
66e805c481 doc/examples: remove 'ninja' as explicit dep (#4)
as it's already required by meson.
Also use the default unit file path (/usr/lib/systemd/user/) for
packaged versions. /etc/systemd/user is intended for manually installed
services.

arch-meson is just a Meson wrapper with correct arch packaging prefixes set.
2018-04-13 10:28:00 +01:00
Ikey Doherty
69db9c2a61 Conformance: Update copyright range to include 2018
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2018-04-10 13:23:38 +01:00
Marc Di Luzio
4f14c807ba 1.0: Finalised for release
Updating the README.md to bring it ready for wider release:
* Removed some points that were more implementation details
* Added Contributions section
* Simplified the usage section
* Expanded initial explanation
* Fixed steam launch command to allow the overlay to still work

Others:
* Mark as 1.0
* Update the license file for 2018
2018-04-04 10:06:23 +01:00
Marc Di Luzio
759cbc3c40 Add config file parsing
Checks for a gamemode.ini in /usr/share/gamemode/ (or in the cwd for debugging)

	Currently allows for blacklisting and whitelisting clients based on rudimentary needle-haystack executable name checks

	See the example/gamemode.ini file for expected syntax

	Using the BSD licensed inih library (with additional meson.build file)
2018-03-23 16:59:15 +00:00
Minze Zwerver
24a192d594 Added an example PKBUILD file for Arch 2018-03-23 16:59:15 +00:00
Ikey Doherty
e90bd98d64 Enforce strict compiler warnings
This exposed a bunch of issues that needed dealing with to ensure the
code is clean and sane. Notably the dlopen/dlsym routine has been altered
to closer match the LSI approach of safe symbol binding, by not attempting
to directly cast the result of a dlsym operation. Instead, if we succeed
in getting the dlsym() pointer, we memcpy this to the target and ensure
we have the correct constraints.

Note that in sanitizing the log helpers, I opted to remove the varargs
ability from FATAL_ERRNO given this is used exactly like perror() and
there are no examples currently using varargs with this in the tree.
This allowed me to keep the log helpers as macros and not have to implement
wrapper functions.

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
2018-03-05 17:32:26 +00:00