Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Implement Feral GameMode integration on Linux #6732

Open
MateusRodCosta opened this issue Apr 27, 2024 · 1 comment
Open
Labels
enhancement New feature or request os:linux Issues affecting Linux exclusively

Comments

@MateusRodCosta
Copy link

Overview

From gamemode repo:

GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS and/or a game process.

GameMode was designed primarily as a stop-gap solution to problems with the Intel and AMD CPU powersave or ondemand governors, but is now host to a range of optimisation features and configurations.

Currently GameMode includes support for optimisations including:

CPU governor
I/O priority
Process niceness
Kernel scheduler (SCHED_ISO)
Screensaver inhibiting
GPU performance mode (NVIDIA and AMD), GPU overclocking (NVIDIA)
CPU core pinning or parking
Custom scripts

GameMode packages are available for Ubuntu, Debian, Solus, Arch, Gentoo, Fedora, OpenSUSE, Mageia and possibly more.

This daemon is run under the user (systemctl --user) and is responsible for applying many optimization.
On a system where the user is using the default example config file, the following optimizations apply while it's active:

  • performance governors
  • I/O priority
  • Inhibit screensaver
  • Disable split lock mitigation (discussion)

Smaller details

For reference, Cemu has GameMode support.

Cemu feature request: cemu-project/Cemu#790.
Cemu implementation PR: cemu-project/Cemu#796.

On Cemu, GameMode support is not connected with the emulator running, only with becoming active when specific game starts running.

Nature of request

Integration of a daemon focused on applying game optimizations while the game is running.

Why would this feature be useful?

Feral GameMode can improve perfomance a bit as well as alllowing the "Inhibit screensaver" feature to be added to the emulator via it.

While it should already be possible to launch an app with gamemode integration via gamemoderun <launch command for Ryujinx>, having it integrated in the emualtor itself would be way more convenient.

@piplup55 piplup55 added the enhancement New feature or request label Apr 27, 2024
@MateusRodCosta
Copy link
Author

For completeness, apparently there's is gamemode support via the gamemoderun command, but it might not work in the best way:

#!/bin/sh

SCRIPT_DIR=$(dirname "$(realpath "$0")")

if [ -f "$SCRIPT_DIR/Ryujinx.Headless.SDL2" ]; then
    RYUJINX_BIN="Ryujinx.Headless.SDL2"
fi

if [ -f "$SCRIPT_DIR/Ryujinx" ]; then
    RYUJINX_BIN="Ryujinx"
fi

if [ -z "$RYUJINX_BIN" ]; then
    exit 1
fi

COMMAND="env DOTNET_EnableAlternateStackCheck=1"

if command -v gamemoderun > /dev/null 2>&1; then
    COMMAND="$COMMAND gamemoderun"
fi

exec $COMMAND "$SCRIPT_DIR/$RYUJINX_BIN" "$@"

For example, this might not work if the command gamemoderun doesn't exist (which seems to be the case currently for the flatpak version).
Ideally the emulator should integrate the gamemode library in a similar way to what Cemu does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request os:linux Issues affecting Linux exclusively
Projects
None yet
Development

No branches or pull requests

3 participants