holoiso-eol / holoiso

SteamOS 3 (Holo) archiso configuration
Other
5.25k stars 262 forks source link

RX 590 Performance issue #294

Closed WTFPCStuff closed 2 years ago

WTFPCStuff commented 2 years ago

My RX 590 performs on par with the RDNA2 APU in best cases, sometimes worse. The overlay indicates the GPU is running at 300mhz. Power usage changes so it's measuring something, though unclear how accurate this is. Haven't found a work around, at this time. Testing in Desktop mode makes no difference in performance. Control, for example: Copied Digital Foundries settings where they got almost a constant 60FPS in 720p Ran my game and hovered between the low 30's and low 50's.

This may not be possible to fix on the HoloISO end and might be a matter of an issue with the Steam OS main software. Attempting to configure the GPU clocks in the Gamescope menu fails, it resets to 0 after a few seconds.

doxzilla commented 2 years ago

Had a similar issue with a RX480, had to look at info in #66 and #94 to get it resolved. This comment in #94 should solve your issue.

WTFPCStuff commented 2 years ago

Confirmed that comment as a work around. It's still buggy but using an overclocking tool in the background restores performance. It seems to be primarily a TDP limit placed on the system. I wouldn't call this a resolution, as I don't see a way to solve it in os permanently that works on the current versions. I didn't see other proposed or confirmed resolutions, either, but someone feel free to point to one, should one crop up. Note also in my case I have leave the overclocking software running. It sometimes holds the settings in non-steam titles, but launching steam title resets it.

doxzilla commented 2 years ago

I ended up editing the config.vdf based on the document linked in this comment in #94. GPU seems to be hitting the proper clock speed and the performance is about what I expected it to be.

pastaq commented 2 years ago

A better solution is to remove the polkit for the GPU TDP control. The reason this is happening is because SteamOS has both permission to adjust power1_cap and hard coded max TDP of 15w.

Edit the file /usr/bin/steamos-polkit-helpers/steamos-priv-write and delete line 42 (the one that mentions power1_cap)

Or delete the file entirely, but that will have additional effects that might not be desired.

cg9999 commented 2 years ago

Edit the file /usr/bin/steamos-polkit-helpers/steamos-priv-write and delete line 42 (the one that mentions power1_cap)

This is not enough in my case. Something still sets power1_cap to 15W

doing "echo 0 > /sys/class/hwmon/hwmon2/power1_cap" fixes this. (To 135W on my RX580)

pastaq commented 2 years ago

That's pretty odd. Are you able to echo that after editing that file and a reboot?

cg9999 commented 2 years ago

That's pretty odd. Are you able to echo that after editing that file and a reboot?

Yeah, I commented the section out:

#if [[ "$WRITE_PATH" == /sys/class/hwmon/hwmon*/power*_cap ]]; then
#   CommitWrite
#fi

then rebooted, switched to desktop mode. After that: $ cat /sys/class/hwmon/hwmon2/power1_cap 15000000

$ sudo echo 0 > /sys/class/hwmon/hwmon2/power1_cap

$ cat /sys/class/hwmon/hwmon2/power1_cap 135000000

pastaq commented 2 years ago

Hmm, I'll do some more investigating. That should have prevented user level access to that file, which the deckui needs so it can set the"default" TDP at boot. I'm let you know what I discover.

cg9999 commented 2 years ago

Thanks. For the echo command, it seems sudo isn't even necessary. The power1_cap file is r/w for all users. Maybe that's why removing the line on the file is not effective?

pastaq commented 2 years ago

That should be remade every boot, so without the polkit I have no idea whats doing that. Can you try `sudo chmod 755 /sys/class/hwmon/hwmon*/power1_cap" and see if that resolves before and after a reboot?

cg9999 commented 2 years ago

chmod works as expected, cannot echo anymore to the file, but after reboot the file is writable again and the 15W cap returns.

pastaq commented 2 years ago

what do you see if you ls -al /etc/polkit-1/rules.d/?

cg9999 commented 2 years ago

$ sudo ls -al /etc/polkit-1/rules.d/ total 0 drwxr-x--- 1 root polkitd 0 Jan 25 22:04 . drwxr-xr-x 1 root root 14 Jun 17 21:44 ..

no files there...

cg9999 commented 2 years ago

I investigated the issue a bit more and so far the cleanest solution I found is setting the "amdgpu.ppfeaturemask=0xffffffef" kernel parameter. This disables the power containment, aka TDP capping. No other changes to system were necessary.

edit: this seems to affect the fan control, so needs further investigating :( WARNING: don't do this. GPU may overheat because fan is running slowly

cg9999 commented 2 years ago

Ok, my current workaround is to patch the /usr/bin/steamos-polkit-helpers/steamos-priv-write file around line 42 as follows:

if [[ "$WRITE_PATH" == /sys/class/hwmon/hwmon*/power*_cap ]]; then
   echo "decline harder: $WRITE_VALUE -> $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p err
   # return 0=success so steam does not try to fix it...
   exit 0
fi

no problems seen so far, but this needs to be redone when system update overwrites the file.

The reason it did not work previously was due to two issues: -DeclineWrite function still tries to do the write. (Line 24) which seems like a bug on the script. -If the script returns fail status (exit 1), steam will try some sudo magic to make the nodes writable

pastaq commented 2 years ago

Ok, my current workaround is to patch the /usr/bin/steamos-polkit-helpers/steamos-priv-write file around line 42 as follows:

if [[ "$WRITE_PATH" == /sys/class/hwmon/hwmon*/power*_cap ]]; then
   echo "decline harder: $WRITE_VALUE -> $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p err
   # return 0=success so steam does not try to fix it...
   exit 0
fi

no problems seen so far, but this needs to be redone when system update overwrites the file.

The reason it did not work previously was due to two issues: -DeclineWrite function still tries to do the write. (Line 24) which seems like a bug on the script. -If the script returns fail status (exit 1), steam will try some sudo magic to make the nodes writable

Excellent work. What a silly bug. This is a better solution than editing the vdf because you could still use the UI to modify it by mistake. This prevents that.

If the jupiter-hw-support package gets updated this fix will probably get overwritten, so you need to be on top of that. You could remove the package, but you will lose a lot of the functionality of dekui if you do.

massatt212 commented 2 years ago

MY GPU and CPU run hotter and perform like about 10 to 20% less, any tweaks i can do?