flathub / flathub/com.valvesoftware.Steam
gamemoderun enables gamemode, but doesn't register process
- Dominant language
- Python
- Stars
- 421
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Description
Starting a game with gamemode enables gamemode, but doesn't register the game process to use gamemode. This prevents things like core pinning (I use a 7950X3D) from working.
I'm on Fedora 39 with the most up-to-date version of the Steam Flatpak from flathub.org, but I manually installed version 1.8.1 of Feral gamemode (Fedora 39 ships with 1.7, which doesn't support core pinning). Running `gamemoded -t` returns `: All Tests Passed!`. Launching for example `gfxgears` with `gamemoderun gfxgears` successfully activates gamemode and registers the process:
```
> gamemoded -s79042
gamemode is active and [79042] registered
```
Querying a game running via the Steam Flatpak returns this:
```
> gamemoded -s77895
gamemode is active but [77895] not registered
```
And as I said, core pinning doesn't work. When I manually register a running process using `gamemoded -r77895`, it works properly including core pinning, but I have to do this manually every time after launching the game.
Exiting the game properly disables gamemode if it was the only gamemode process active, so it does _something_, it just doesn't register the process properly.
I set the "Launch Options" in Steam to:
```
gamemoderun %command%
```
Tested with Baldur's Gate 3 (including `--skip-launcher`), PlateUp! and Valheim (both Proton and native Linux version) so far. None of them are registered.
Running the Steam Flatpak with `flatpak run --log-session-bus com.valvesoftware.Steam` shows that the `org.freedesktop.portal.GameMode` portal is called. This is the output after a simple session where I started Steam, then Valheim:
```
[...]
/bin/sh\0-c\0gamemoderun /home/bird/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=892970 -- /home/bird/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/bird/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/bird/.var/app/com.valvesoftware.Steam/.local/share/Steam/compatibilitytools.d/GE-Proton8-32'/proton waitforexitandrun '/home/bird/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Valheim/valheim.exe' -force-vulkan\0
[...]
C29: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.GameMode.RegisterGameByPIDFd at /org/freedesktop/portal/desktop
B6170: <- :1.24 return from C29
B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus
B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus
ERROR: ld.so: object '/home/bird/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
[...]
C29: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.GameMode.RegisterGameByPIDFd at /org/freedesktop/portal/desktop
B6174: <- :1.24 return from C29
gamemodeauto:
ERROR: ld.so: object '/home/bird/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[...]
C29: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.GameMode.RegisterGameByPIDFd at /org/freedesktop/portal/desktop
B6178: <- :1.24 return from C29
B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus
B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameOwnerChanged at /org/freedesktop/DBus
ERROR: ld.so: object '/home/bird/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[...]
C29: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.GameMode.RegisterGameByPIDFd at /org/freedesktop/portal/desktop
B6182: <- :1.24 return from C29
gamemodeauto:
ERROR: ld.so: object '/home/bird/.var/app/com.valvesoftware.Steam/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[...]
C29: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.GameMode.RegisterGameByPIDFd at /org/freedesktop/portal/desktop
B-1: <- org.freedesktop.DBus return from C19
[...]
C29: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.GameMode.RegisterGameByPIDFd at /org/freedesktop/portal/desktop
B6193: <- :1.24 return from C29
C30: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.GameMode.UnregisterGameByPIDFd at /org/freedesktop/portal/desktop
B6196: <- :1.24 return from C30
[...]
C29: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.GameMode.RegisterGameByPIDFd at /org/freedesktop/portal/desktop
B6200: <- :1.24 return from C29
C30: -> org.freedesktop.portal.Desktop call org.freedesktop.portal.GameMode.UnregisterGameByPIDFd at /org/freedesktop/portal/desktop
B6203: <- :1.24 return from C30
[...]
```
Running `gamemoderun` inside the Flatpak via `flatpak enter com.valvesoftware.Steam sh` properly registers the process that is run (I tested it with `top` even though that doesn't make sense for gamemode).
Any idea what could cause this not to work?
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce with Steam Flatpak using the Launch Option `gamemoderun %command%`, then compare `gamemoded -s` with a direct `gamemoderun` invocation inside the Flatpak. Inspect the `flatpak run --log-session-bus` output for GameMode portal registration and confirm done when the launched game process is registered and core pinning works without manual `gamemoded -r`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, shell
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100