gamemode icon indicating copy to clipboard operation
gamemode copied to clipboard

Gamemode fails to start on Gentoo Linux

Open hnhx opened this issue 2 years ago • 13 comments

Describe the bug Running gamemoded -t fails with: ERROR: gamemode_query_status failed to return other client connected (expected 1)! Running a game with gamemode either causes a crash or a memory leak.

To Reproduce Run gamemoded -t or start a game with gamemode.

Expected behavior Gamemode shouldn't fail.

System Info (please complete the following information):

  • OS and version: Gentoo Linux, kernel: 5.16.0-gentoo
  • GameMode Version: 1.6.1 and 9999 (pulled directly from github)

Additional context Full output of gamemoded -t:

: Loading config
Loading config file [/usr/share/gamemode/gamemode.ini]
: Running tests

:: Basic client tests
:: Passed

:: Dual client tests
gamemode request succeeded and is active
Quitting by request...
:: Passed

:: Gamemoderun and reaper thread tests
ERROR: gamemode_query_status failed to return other client connected (expected 1)!
...Waiting for child to quit...
...Waiting for reaper thread (reaper_frequency set to 5 seconds)...
:: Supervisor tests
:: Passed

: Client tests failed, skipping feature tests
: Tests Failed!

hnhx avatar Jan 15 '22 14:01 hnhx

Same issue for me.

OS and version: Gentoo Linux, kernel: 5.15.11-gentoo
GameMode Version: 1.6.1

Ardn0 avatar Jan 15 '22 19:01 Ardn0

I get the same error on my system. When I add gamemode to Proton, the game starts with a black screen and nothing else.

gamemode version: v1.6.1

$ cat /proc/version Linux version 5.9.16-zen (root@laptop) (gcc (Gentoo 10.3.1_p20211126 p0) 10.3.1 20211126, GNU ld (Gentoo 2.37_p1 p1) 2.37) #2 ZEN SMP PREEMPT Wed Jan 12 15:42:34 EST 2022

Techwolf avatar Jan 19 '22 22:01 Techwolf

Same issue on Artix Linux. Kernel: 5.16.8-xanmod1-1 Gamemode: 1.6.1-1

Mavincs avatar Feb 12 '22 03:02 Mavincs

Same issue on Tumbleweed Gamemode: 1.6.1-25.32 Kernel: 5.16.15-1

Nano-Ocelot avatar Mar 28 '22 20:03 Nano-Ocelot

I got it to reproduce (kernel 5.15.48-gentoo-dist, gamemode 1.6.1) and will see if I can try to debug the issue.

update: I'm not very skilled with gdb so this might be very slow. update2: on a vm it's surprisingly annoying to have to deal with mouse desync update3: i gave up, complications between gdb and vm mouse desync and everything, and anyway people may have already found the cause (see below)

strace-enjoyer avatar Jul 07 '22 20:07 strace-enjoyer

I get the same thing even after building with elogind and using 1.7

This is probably because systemd is a requirement to bulid gamemode, but building with elogind should fix that so I expect that there are just errors in the build process. There are still some things to try out though so I'll continue experimenting.

TotallyARobot avatar Jul 29 '22 03:07 TotallyARobot

"Maybe you have missing a dbus user session, how are you running your wm/DE? with a DM? xinitrc? If with xinitrc, make sure the last line is exec dbus-run-session and the dbus system service is enabled."

kartoshe4ka27 avatar Jul 29 '22 20:07 kartoshe4ka27

I tried it and it still does not work on my system.

TotallyARobot avatar Jul 30 '22 15:07 TotallyARobot

cc @chewi @kakra

thesamesam avatar Aug 07 '22 01:08 thesamesam

FWIW both 1.6.1 and 1.7 have been working fine for me on Gentoo. I use it regularly. My system uses elogind.

chewi avatar Aug 07 '22 08:08 chewi

I get exactly the same output from env -u DBUS_SESSION_BUS_ADDRESS gamemoded -t, which effectively nobbles the D-Bus environment. In short, either you're not using D-Bus or you're not running in a D-Bus environment. If the DBUS_SESSION_BUS_ADDRESS variable is not present from running via dbus-run-session or similar (most desktops will do this for you) then this is just not going to work. Plenty of other things will be broken too.

chewi avatar Aug 07 '22 08:08 chewi

@chewi It works fine here in Gentoo: running gamemode-simulate-game successfully triggers the service via dbus. But I don't use elogind but rather systemd with dbus-broker installed and properly configured.

But I can image that the graphical session is not properly launching a session bus but maybe a user bus? I think the latter configuration mode has been deprecated for a while.

# busctl --user list | grep gamemode
:1.222                                                     819559 gamemoded       kakra :1.222        [email protected] -       -
:1.223                                                     819559 gamemoded       kakra :1.223        [email protected] -       -
:1.224                                                     819559 gamemoded       kakra :1.224        [email protected] -       -
com.feralinteractive.GameMode                              819559 gamemoded       kakra :1.222        [email protected] -       -

On Gentoo, there should be an executable file /etc/X11/xinit/xinitrc.d/80-dbus which launches the dbus session. Depending on how you start your session, it may work more or less well (e.g. graphical login vs. startx from text console).

kakra avatar Aug 07 '22 11:08 kakra

BTW I can confirm that using dbus-run-session sway instead of sway works fine.

On Aug 7, 2022, at 7:03 AM, Kai Krakow @.***> wrote:

 @chewi It works fine here in Gentoo: running gamemode-simulate-game successfully triggers the service via dbus. But I don't use elogind but rather systemd with dbus-broker installed and properly configured.

But I can image that the graphical session is not properly launching a session bus but maybe a user bus? I think the latter configuration mode has been deprecated for a while.

busctl --user list | grep gamemode

:1.222 819559 gamemoded kakra :1.222 @.*** - - :1.223 819559 gamemoded kakra :1.223 @.*** - - :1.224 819559 gamemoded kakra :1.224 @.*** - - com.feralinteractive.GameMode 819559 gamemoded kakra :1.222 @.*** - - On Gentoo, there should be an executable file /etc/X11/xinit/xinitrc.d/80-dbus which launches the dbus session. Depending on how you start your session, it may work more or less well (e.g. graphical login vs. startx from text console).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

strace-enjoyer avatar Aug 10 '22 23:08 strace-enjoyer