https://github.com/FeralInteractive/gamemode
Optimise Linux system performance on demand
https://github.com/FeralInteractive/gamemode
linux videogames
Last synced: 26 days ago
JSON representation
Optimise Linux system performance on demand
- Host: GitHub
- URL: https://github.com/FeralInteractive/gamemode
- Owner: FeralInteractive
- License: bsd-3-clause
- Created: 2018-04-10T09:43:19.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-03-14T10:23:06.000Z (about 1 month ago)
- Last Synced: 2025-03-19T06:16:22.464Z (26 days ago)
- Topics: linux, videogames
- Language: C
- Size: 853 KB
- Stars: 5,078
- Watchers: 93
- Forks: 193
- Open Issues: 191
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- stars - FeralInteractive/gamemode
- awesome-useful-projects - <img src="https://icon.horse/icon/github.com" height="20px" align="center"/>/FeralInteractive/gamemode - Optimize Linux performance (Games / Other)
- awesome-useful-projects - <img src="https://icon.horse/icon/github.com" height="20px" align="center"/>/FeralInteractive/gamemode - Optimize Linux performance (Jump To / Games)
- fucking-Awesome-Linux-Software -  (Utilities / Advanced)
- Awesome-Linux-Software -  is an example of what this file would look like, with explanations for all the variables.
Configuration files are loaded and merged from the following directories, from highest to lowest priority:
1. `$PWD` ("unsafe" - **`[gpu]` settings take no effect in this file**)
2. `$XDG_CONFIG_HOME` or `$HOME/.config/` ("unsafe" - **`[gpu]` settings take no effect in this file**)
3. `/etc/`
4. `/usr/share/gamemode/`---
## Note for Hybrid GPU usersIt's not possible to integrate commands like optirun automatically inside GameMode, since the GameMode request is made once the game has already started. However it is possible to use a hybrid GPU wrapper like optirun by starting the game with `gamemoderun`.
You can do this by setting the environment variable `GAMEMODERUNEXEC` to your wrapper's launch command, so for example `GAMEMODERUNEXEC=optirun`, `GAMEMODERUNEXEC="env DRI_PRIME=1"`, or `GAMEMODERUNEXEC="env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only"`. This environment variable can be set globally (e.g. in /etc/environment), so that the same prefix command does not have to be duplicated everywhere you want to use `gamemoderun`.
GameMode will not be injected to the wrapper.
---
## Development [](https://github.com/FeralInteractive/gamemode/actions/workflows/build-and-test.yml)The design of GameMode has a clear-cut abstraction between the host daemon and library (`gamemoded` and `libgamemode`), and the client loaders (`libgamemodeauto` and `gamemode_client.h`) that allows for safe use 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.
See repository subdirectories for information on each component.
### Install Dependencies
GameMode depends on `meson` for building and `systemd` for internal communication. This repo contains a `bootstrap.sh` script to allow for quick install to the user bus, but check `meson_options.txt` for custom settings.#### Ubuntu/Debian (you may also need `dbus-user-session`)
```bash
apt install meson libsystemd-dev pkg-config ninja-build git libdbus-1-dev libinih-dev build-essential
```On Ubuntu 18.04, you'll need to install `python3` package and install the latest meson version from `pip`.
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install meson
```Later you can deactivate the virtual environment and remove it.
```bash
deactivate
rm -rf .venv
```#### Arch
```bash
pacman -S meson systemd git dbus libinih
```
#### Fedora
```bash
dnf install meson systemd-devel pkg-config git dbus-devel
```
#### Gentoo
Gentoo has an ebuild which builds a stable release from sources. It will also pull in all the dependencies so you can work on the source code.
```bash
emerge --ask games-util/gamemode
```
You can also install using the latest sources from git:
```bash
ACCEPT_KEYWORDS="**" emerge --ask ~games-util/gamemode-9999
```### Build and Install GameMode
Then clone, build and install a release version of GameMode at 1.8.2:```bash
git clone https://github.com/FeralInteractive/gamemode.git
cd gamemode
git checkout 1.8.2 # omit to build the master branch
./bootstrap.sh
```
To test GameMode installed and will run correctly:
```bash
gamemoded -t
```To uninstall:
```bash
systemctl --user stop gamemoded.service
ninja uninstall -C builddir
```### Pull Requests
Pull requests must match with the coding style found in the `.clang-format` file, please run this before committing:
```
clang-format -i $(find . -name '*.[ch]' -not -path "*subprojects/*")
```### Maintained by
Feral InteractiveSee the [contributors](https://github.com/FeralInteractive/gamemode/graphs/contributors) section for an extended list of contributors.
---
## LicenseCopyright © 2017-2025 Feral Interactive and the GameMode contributors
GameMode is available under the terms of the BSD 3-Clause License (Revised)
The "inih" library is distributed under the New BSD license