Ryujinx
Ryujinx copied to clipboard
[Feature Request] Implement Feral GameMode integration on Linux
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: https://github.com/cemu-project/Cemu/issues/790. Cemu implementation PR: https://github.com/cemu-project/Cemu/pull/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.
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.
+1