FeralInteractive / gamemode

Optimise Linux system performance on demand
BSD 3-Clause "New" or "Revised" License
4.81k stars 186 forks source link

Gamemode fails to start on Gentoo Linux #349

Open hnhx opened 2 years ago

hnhx commented 2 years ago

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):

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!
Ardn0 commented 2 years ago

Same issue for me.

OS and version: Gentoo Linux, kernel: 5.15.11-gentoo
GameMode Version: 1.6.1
Techwolf commented 2 years ago

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

Mavincs commented 2 years ago

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

Nano-Ocelot commented 2 years ago

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

strace-enjoyer commented 2 years ago

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)

TotallyARobot commented 2 years ago

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.

kartoshe4ka27 commented 2 years ago

"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."

TotallyARobot commented 2 years ago

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

thesamesam commented 2 years ago

cc @chewi @kakra

chewi commented 2 years ago

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 commented 2 years ago

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.

kakra commented 2 years ago

@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        user@500.service -       -
:1.223                                                     819559 gamemoded       kakra :1.223        user@500.service -       -
:1.224                                                     819559 gamemoded       kakra :1.224        user@500.service -       -
com.feralinteractive.GameMode                              819559 gamemoded       kakra :1.222        user@500.service -       -

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).

strace-enjoyer commented 2 years ago

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.

Hlormar commented 3 months ago

Im having the same issue on devuan (both daedalus and excalibur) with openrc, elogind service, dbus and both wayland (started with greetd) and x11(started with startx, tbsm, ly). The only way I able to use gamemode is when Im starting X11 session with LightDM or XDM🤔 (Didn't tested other ones yet)