gamemode: Gamemode 1.8.1 can't set CPU governor and GPU Optimisation

Describe the bug Update gamemode to 1.8.1 and get this when install

warning: directory permissions differ on /usr/share/polkit-1/rules.d/
filesystem: 750  package: 755

Run gamemoded -t and it would fail with this message

:: Feature tests
::: Verifying CPU governor setting
ERROR: Governor was not set to performance (was actually schedutil)!
::: Failed!
::: Verifying Scripts
::: Passed (no scripts configured to run)
::: Verifying GPU Optimisations
ERROR: Current AMD GPU performance level during gamemode does not match requested value!
	expected:high was:auto
::: Failed!

To Reproduce Steps used to reproduce the behavior:

  1. Update gamemod to 1.8.1
  2. Run gamemoded -t
  3. Tests Failed!

Expected behavior : All Tests Passed! after running gamemoded -t

System Info (please complete the following information):

  • OS and version: ArchLabs - 6.6.8-2-cachyos
  • GameMode Version 1.8.1

Additional context Downgrade to GameMode version 1.7 and it work again.

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Reactions: 2
  • Comments: 45

Most upvoted comments

I got it to work, the solution is to create the following .pkla in /etc/polkit-1/localauthority/50-local.d:

[Enable gamemode requests]
Identity=unix-group:gamemode
Action=com.feralinteractive.GameMode.governor-helper;com.feralinteractive.GameMode.gpu-helper;com.feralinteractive.GameMode.cpu-helper;com.feralinteractive.GameMode.procsys-helper
ResultAny=yes
ResultInactive=yes
ResultActive=yes

Basically, it’s the same as the gamemode.rules file but in the older format accepted by the outdated polkit in Ubuntu 22.04.

image

From the new gamemode.ini file

; GameMode can renice game processes. You can put any value between 0 and 20 here, the value ; will be negated and applied as a nice value (0 means no change). Defaults to 0. ; To use this feature, the user must be added to the gamemode group (and then rebooted): ; sudo usermod -aG gamemode $(whoami) renice=0

So I ran the command and added my username to the group gamemode, and now gamemode 1.8.1 work normally. I did not intend to use the renice function though.

Yes. I added me user to the gamemode group with “sudo usermod -aG gamemode sascha” in the terminal , reboot and do install again gamemode-1.8.1 because there was no effect by test gamemode with gamemoded -t in the console. The CPU Governor can’t change from gamemode-1.8.1 but the rest of the test are successfully as it was before.

Can confirm this very issue also happens to me. I’m using gamemode 1.8.1 (happened on 1.8 too, not on 1.7), Pop OS! 22.04 (kernel 6.6.6), already tried adding my user to gamemode group and restarting. Issue still remains.

I faced the same problem, but in slightly different conditions, as it seemed to me, however, the solution https://github.com/FeralInteractive/gamemode/issues/452#issuecomment-1986861524 It helped me.

OS: Linux Mint 21.3 x86_64
Host: 82UH Legion 7 16ARHA7
Kernel: 6.8.4-stvoid
Shell: bash 5.1.16
DE: Cinnamon 6.0.4
CPU: AMD Ryzen 9 6900HX with Radeon Graphics (16) @ 4.935GHz
GPU: AMD ATI Radeon RX 6700/6700 XT / 6800M
GPU: AMD ATI 37:00.0 Rembrandt

By default, the version from the standard Ubuntu “1.6.1-1 build2” repository was installed.

I wanted to put together a more recent version. Fortunately, everything worked out the first time, although I often have errors with the assembly of some modules and other things, because I am building an up-to-date stable kernel with clang-18, so the variables CC=clang-18 CXX=clang-18 LLVM=-18 were set in my environment (I don’t know if it could does this affect a successful build, but suddenly someone will encounter).

Immediately after successful completion ./bootstrap.sh I ran the “gamemoded -t” test and got this error.

At first I tried to add myself to the gamemode group, but it didn’t work because there was no such group. However, this was not a problem for version 1.6.1.

After the reboot, I added myself to the group again and this time the group already existed. However, this did not eliminate the problem with passing the tests. Therefore, I created the file /etc/polkit-1/localauthority/50-local.d/gamemode.pkla by logging in as root (pkaction version 0.105). After that, I rebooted, ran the tests and they worked.


At the moment, I am observing errors in the log, more specifically, I am interested in what is said about IGPU, can I ignore it and everything is fine or does it need to be solved?

апр 05 23:47:59 space pkexec[10216]: pam_unix(polkit-1:session): session opened for user root(uid=0) by (uid=1000)
апр 05 23:47:59 space gamemoded[10185]: ERROR: Configured iGPU power threshold value '-1.000000' is invalid, ignoring iGPU default governor.
апр 05 23:47:59 space gamemoded[10185]: ERROR: Failed to open file for read /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0/energy_uj
апр 05 23:47:59 space pkexec[10219]: pam_unix(polkit-1:session): session opened for user root(uid=0) by (uid=1000)
апр 05 23:47:59 space gamemoded[10185]: ERROR: Skipping ioprio on client [10215,10215]: ioprio was (0) but we expected (4)
апр 05 23:47:59 space gamemoded[10185]: ERROR: Skipping ioprio on client [10223,10223]: ioprio was (0) but we expected (4)
апр 05 23:47:59 space gamemoded[10185]: ERROR: Addition requested for already known client 10223 [/home/stvoid/.local/share/Steam/ubuntu12_32/steam-launch-wrapper].
апр 05 23:47:59 space gamemoded[10185]:     -- This may happen due to using exec or shell wrappers. You may want to
апр 05 23:47:59 space gamemoded[10185]:     -- blacklist this client so GameMode can see its final name here.
апр 05 23:47:59 space gamemoded[10185]: ERROR: Skipping ioprio on client [10226,10226]: ioprio was (0) but we expected (4)
gamemoded -s
> gamemode is active

Hi @ralmachado, you are right, i try to make this .pkla file at the right position as you say and it’s work for me with the gamemode 1.8.1. Thank you very much

I found out the issue. It’s the fact that in /etc/security/limits.d/10-gamemode.conf it’s set to -10 not -20. The odd thing is that despite me now changing it to -20 gamemoded renice is still failing with anything past 10. Do I need to do something to update polkit configs?

After more testing the max I can set is -19. -20 doesn’t work for somereason despite setting -20 in gamemode.conf

This is a niceness problem, not really related to this issue, but yes, you should only let usermode processes renice to -19 for safety reasons. Root should be able to renice to -20 to kill any hung processes.

In any case, setting the limit to -19 should be enough, otherwise disable renice in gamemode config.

I’ve tried what you pasted, and it still doesn’t work for me. id

uid=1000(justcausewhynot) gid=1000(justcausewhynot) groups=1000(justcausewhynot),10(wheel),18(audio),27(video),85(usb),97(input),100(users),250(portage),272(plugdev),385(gamemode)

gamemode version: v1.8.1 pkaction version 124

My solution was intended only for outdated polkit versions (used in Ubuntu LTS), which doesn’t support the shipped polkit rules file.

I tried a clean build in an arch based distro with polkit 124 and it worked. Check journalctl output after a gamemoded -t to see if the issue is in fact polkit 😃

I don’t get any directory permissions issue, but I do get the ERROR: Governor was not set to performance (was actually schedutil)! I ran built and installed with bootstrap.sh, added myself to the gamemode group, and rebooted. No errors were reported until I ran gamemoded -t.

$ 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
...Waiting for child to quit...
...Waiting for reaper thread (reaper_frequency set to 5 seconds)...
:: Passed

:: Supervisor tests
:: Passed

:: Feature tests
::: Verifying CPU governor setting
ERROR: Governor was not set to performance (was actually powersave)!
::: Failed!
::: Verifying Scripts
::: Passed (no scripts configured to run)
::: Verifying GPU Optimisations
::: Passed (gpu optimisations not configured to run)
::: Verifying renice
::: Passed (no renice configured)
::: Verifying ioprio
::: Passed
ERROR: :: Failed!
: Tests Failed!

I built:

8cea4c2 (HEAD -> master, origin/master, origin/HEAD) Fix hybrid CPU core pinning
4a82094 Fix build with musl
5180d89 (tag: 1.8.1) Update version to 1.8.1
$ id
uid=1000(marc) gid=1000(marc) groups=1000(marc),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),133(lxd),134(sambashare),998(gamemode)
$ uname -a
Linux samus2 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Hi, try to open a Terminal (Strg + Alt + t) and type into it

cd /home/$USER/gamemode

then make the uninstall steps again, also

systemctl --user stop gamemoded.service ninja uninstall -C builddir

It shuld now find the Builddir to uninstall it. Greetings

From the new gamemode.ini file

; GameMode can renice game processes. You can put any value between 0 and 20 here, the value ; will be negated and applied as a nice value (0 means no change). Defaults to 0. ; To use this feature, the user must be added to the gamemode group (and then rebooted): ; sudo usermod -aG gamemode $(whoami) renice=0

So I ran the command and added my username to the group gamemode, and now gamemode 1.8.1 work normally. I did not intend to use the renice function though.

stumbled upon the same issue today and adding myself to the gamemode group fixed it for me.

In my case that worked not for me. Gamemode can´t change the Governor. I added me to the group gamemode but no success.