gamemode icon indicating copy to clipboard operation
gamemode copied to clipboard

AMD Performance Level was not set

Open EduFrazao opened this issue 3 years ago • 8 comments

Describe the bug GPU Optmization "amd_performance_level" was not working as expected.

To Reproduce

  1. Configure gamemoderun allowing it apply GPU Optimizations: `[gpu] ; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks apply_gpu_optimisations=accept-responsibility

; The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/ gpu_device=0

amd_performance_level=high ` 2. Run gamemoded -t to check config:

`eduardo ~ $ gamemoded -t : Loading config Loading config file [/usr/share/gamemode/gamemode.ini] Loading config file [/etc/gamemode.ini] Loading config file [/home/eduardo/.config/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 ::: Passed ::: 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! ::: Verifying renice ::: Passed ::: Verifying ioprio ::: Passed ERROR: :: Failed! : Tests Failed!`

  1. Launch any game, and monitoring with sensors or mangohud, and you will see that the GPU clocks are on "auto" (my default config).

Expected behavior Its expected that gamemode sets /sys/class/drm/card0/device/power_dpm_force_performance_level to "high" instead of "auto"

System Info (please complete the following information):

  • Gentoo Base Layout 2.7 (Kernel 5.10.4)
  • GameMode Version: 1.6

EduFrazao avatar Jan 02 '21 16:01 EduFrazao

Has anyone found how to fix this?

Mathew-D avatar Jul 15 '21 05:07 Mathew-D

I also see this on Arch, when I check journalctl I see other messages from gamemode but no indication that it's even trying to set the performance level.

Hrothen avatar Dec 16 '21 17:12 Hrothen

Has anyone found how to fix this?

Check out Issue #351 and see if that fix works.

mdjose avatar Jan 23 '22 16:01 mdjose

That fix works for me. Changing the performance level doesn't require that kernel parameter since it's just writing to a file. I'm guessing that gamemode has all gpu specific settings gated behind a check for the parameter and that's what's causing this.

Hrothen avatar Jan 23 '22 22:01 Hrothen

@Hrothen Seems like so.

To the devs:

Changing GPU performance modes is one of the most useful features from GameMode (for example to circumvent this Radeon RX 6000 series problem), and it's just a simple write to a file. I suggest removing the kernel parameter requirement to avoid users from needing to resort to dangerous kernel parameters just to change a standard GPU performance mode.

nfp0 avatar Mar 18 '22 16:03 nfp0

Which configuration file did you edit the [gpu] section in? The user locations are considered "unsafe" and don't allow editing those values: https://github.com/FeralInteractive/gamemode/blob/06f01938a91af921cae513a2d0ecba65d57a6922/daemon/gamemode-config.c#L376-L385

This means you need to edit /usr/share/gamemode/gamemode.ini or /etc/gamemode.ini instead. I can confirm editing the former works on Fedora 36, but make sure to also set the GPU device ID as there is no implicit default of 0 (despite what the example looks like): https://github.com/FeralInteractive/gamemode/issues/351#issuecomment-1278251075

Calinou avatar Oct 13 '22 23:10 Calinou

I have my settings on /etc/gamemode.ini and my file looks like this:

[general]
renice=10

[gpu]
apply_gpu_optimisations=accept-responsibility
gpu_device=0
amd_performance_level=high

I'm on Manjaro and the kernel parameter is set to amdgpu.ppfeaturemask=0xffffffff. I have not touched the config since. I don't know what changed, or when, for this to stop working, but it was working before.

I can easily change the performance level manually by doing echo "high" > /sys/class/drm/card0/device/power_dpm_force_performance_level as a super user.

nfp0 avatar Oct 14 '22 00:10 nfp0

It seems my issue was quite particular to my system because of a Systemd system unit I had installed. You can check specifics here: https://github.com/FeralInteractive/gamemode/issues/381#issuecomment-1280127807

Also, it seems the amdgpu.ppfeaturemask=0xffffffff is not needed anymore for me. But I don't know when or what changed this.

@EduFrazao Can you please confirm if your issue is fixed or not? If not, please tell us the output of journalctl --user -u gamemoded -b

nfp0 avatar Oct 18 '22 14:10 nfp0