TDP resets itself when increased beyond 15W on Steam Deck #163

Open
opened 2024-07-01 01:23:31 +01:00 by Tobe95 · 7 comments

Expected Behaviour

Having increased the maximum TDP from default 15W to 20W via BIOS and set up limits_override.ron accordingly, when starting a game and setting TDP beyond 15W, the increased TDP should be applied until the game is closed.

Actual Behaviour

After successfully setting TDP to for example 18W while in-game, it will seemingly random reset down to 15W again without the user doing anything.

Steps To Reproduce

  1. Launch a game and set the TDP to e.g. 18 or 20 watts with Powertools
  2. Run cat /sys/class/hwmon/hwmon4/power1_cap remotely via SSH to confirm that power1_cap and power2_cap actually reflect the increased TDP
  3. Play the game for a while, usually 1-2 minutes
  4. Run cat /sys/class/hwmon/hwmon4/power1_cap again to find out that the TDP has actually been reset to 15 watts again

Anything else?

This seems to happen mainly with demanding games where increased TDP usually comes in handy. I've experienced this in Witcher 3, WRC 10 and Titanfall 2 on Steam Deck LCD running Steam OS 3.5.x stable and after switching over to Bazzite.

Writing this I realize that this is not really a bug report, but possibly a feature request...

Nothing in powertools.log suggests that the TDP was reset, yet shortly after setting it to 20W, the game's performance decreased and cat /sys/class/hwmon/hwmon4/power1_cap returned 15000000 instead of 20000000.

I'm not sure what keeps changing the power cap, but would it be possible for powertools to make sure that the set TDP is reapplied in case it's changed by another process somehow?

Version

2.0.3-rls

Platform

SteamDeck

OS

SteamOS 3 (Stable)

### Expected Behaviour Having increased the maximum TDP from default 15W to 20W via BIOS and set up limits_override.ron accordingly, when starting a game and setting TDP beyond 15W, the increased TDP should be applied until the game is closed. ### Actual Behaviour After successfully setting TDP to for example 18W while in-game, it will seemingly random reset down to 15W again without the user doing anything. ### Steps To Reproduce 1. Launch a game and set the TDP to e.g. 18 or 20 watts with Powertools 2. Run _cat /sys/class/hwmon/hwmon4/power1_cap_ remotely via SSH to confirm that power1_cap and power2_cap actually reflect the increased TDP 3. Play the game for a while, usually 1-2 minutes 4. Run _cat /sys/class/hwmon/hwmon4/power1_cap_ again to find out that the TDP has actually been reset to 15 watts again ### Anything else? This seems to happen mainly with demanding games where increased TDP usually comes in handy. I've experienced this in Witcher 3, WRC 10 and Titanfall 2 on Steam Deck LCD running Steam OS 3.5.x stable and after switching over to Bazzite. Writing this I realize that this is not really a bug report, but possibly a feature request... Nothing in powertools.log suggests that the TDP was reset, yet shortly after setting it to 20W, the game's performance decreased and _cat /sys/class/hwmon/hwmon4/power1_cap_ returned 15000000 instead of 20000000. I'm not sure what keeps changing the power cap, but would it be possible for powertools to make sure that the set TDP is reapplied in case it's changed by another process somehow? ### Version 2.0.3-rls ### Platform SteamDeck ### OS SteamOS 3 (Stable)
Tobe95 added the
bug
label 2024-07-01 01:23:31 +01:00
Owner

Sounds related to #159 and #144
I'd guess everyone is only reporting the part that they notice and not testing out the full extent of the reset.

Sounds related to #159 and #144 I'd guess everyone is only reporting the part that they notice and not testing out the full extent of the reset.
NGnius added this to the Genry milestone 2024-07-02 22:27:53 +01:00
Author

I did some further testing and it appears Steam keeps reverting the TDP back to 15W mid-game.

There are some lines in /usr/bin/steamos-polkit-helpers/steamos-priv-write which allow Steam to control power1_cap and power2_cap, they might look slightly different on SteamOS compared to Bazzite:

if MatchFilenamePattern "$WRITE_PATH" "/sys/class/hwmon/hwmon*/power*_cap"; then
      if /usr/libexec/hwsupport/valve-hardware; then
          CommitWrite
      else
          Log "commit: Skipped $WRITE_VALUE -> $WRITE_PATH - Valve Hardware not detected"
      fi
 fi

By commenting out this whole block, Steam no longer randomly messes around with the TDP if I go beyond 15W with Powertools. This renders SteamOS' own TDP slider useless though.

While I've been having trouble with Powertools occasionally not loading profiles myself, I'm not sure if #144 and #159 are related to this.
If I set the CPU to run at a locked 3000 MhZ and TDP to 18W for example, it's only the TDP that is reset by Steam after some time, while CPU clocks remain unaffected.

I'm not sure if Powertools could really do anything about Steam changing the TDP, except for listening if the power*_cap files keep getting modified. It's probably up to the user to just edit steamos-priv-write if they want to consistently achieve a higher TDP.

I did some further testing and it appears Steam keeps reverting the TDP back to 15W mid-game. There are some lines in `/usr/bin/steamos-polkit-helpers/steamos-priv-write` which allow Steam to control _power1_cap_ and _power2_cap_, they might look slightly different on SteamOS compared to Bazzite: ``` if MatchFilenamePattern "$WRITE_PATH" "/sys/class/hwmon/hwmon*/power*_cap"; then if /usr/libexec/hwsupport/valve-hardware; then CommitWrite else Log "commit: Skipped $WRITE_VALUE -> $WRITE_PATH - Valve Hardware not detected" fi fi ``` By commenting out this whole block, Steam no longer randomly messes around with the TDP if I go beyond 15W with Powertools. This renders SteamOS' own TDP slider useless though. While I've been having trouble with Powertools occasionally not loading profiles myself, I'm not sure if #144 and #159 are related to this. If I set the CPU to run at a locked 3000 MhZ and TDP to 18W for example, it's only the TDP that is reset by Steam after some time, while CPU clocks remain unaffected. I'm not sure if Powertools could really do anything about Steam changing the TDP, except for listening if the `power*_cap` files keep getting modified. It's probably up to the user to just edit `steamos-priv-write` if they want to consistently achieve a higher TDP.

Sounds related to #159 and #144
I'd guess everyone is only reporting the part that they notice and not testing out the full extent of the reset.

It seems to happen mostly when the deck is fully charged or switches from charged to full it goes back to 15w.
It seems a state change occurs witch resets the tdp when fully charged.
Also hand held without charger connected ive never had the issue with setting and holding TDP.
If i play docked and force charge mode to discharge it never happens and the tdp stay set 20W.
After that i can play with increased tdp until fully charged.

So it seems the charge state is resetting the TDP.

> Sounds related to #159 and #144 > I'd guess everyone is only reporting the part that they notice and not testing out the full extent of the reset. > > It seems to happen mostly when the deck is fully charged or switches from charged to full it goes back to 15w. It seems a state change occurs witch resets the tdp when fully charged. Also hand held without charger connected ive never had the issue with setting and holding TDP. If i play docked and force charge mode to discharge it never happens and the tdp stay set 20W. After that i can play with increased tdp until fully charged. So it seems the charge state is resetting the TDP.

Is there any way for it to just persistently do the function of "Reapply settings" on an update cycle every few seconds or so? There's no lag spike or anything and it solves both the problem of not applying on launch and randomly unapplying in games.

Sometimes as well this button doesn't even fix the problem for me and i have to toggle powerplay limits off and back on regardless so maybe this could be thrown in as well?

Is there any way for it to just persistently do the function of "Reapply settings" on an update cycle every few seconds or so? There's no lag spike or anything and it solves both the problem of not applying on launch and randomly unapplying in games. Sometimes as well this button doesn't even fix the problem for me and i have to toggle powerplay limits off and back on regardless so maybe this could be thrown in as well?

Is there any way for it to just persistently do the function of "Reapply settings" on an update cycle every few seconds or so? There's no lag spike or anything and it solves both the problem of not applying on launch and randomly unapplying in games.

Sometimes as well this button doesn't even fix the problem for me and i have to toggle powerplay limits off and back on regardless so maybe this could be thrown in as well?

This could be a dirty solution bit a solution

> Is there any way for it to just persistently do the function of "Reapply settings" on an update cycle every few seconds or so? There's no lag spike or anything and it solves both the problem of not applying on launch and randomly unapplying in games. > > Sometimes as well this button doesn't even fix the problem for me and i have to toggle powerplay limits off and back on regardless so maybe this could be thrown in as well? This could be a dirty solution bit a solution
Owner

I have a better solution in mind, I just need to find some time (and motivation) to work on PowerTools again.

I've been slowly moving a lot of the core functionality of PowerTools into a separate library while also adding the ability for it to read (instead of just write) settings for various peripherals. Once that work is done and integrated into PowerTools, PowerTools can check if all of the settings are set correctly and only set the ones that aren't, if there are any. That check will still have to run on a loop, but it'll have a lot less side effects (e.g. the system journal won't get spammed, settings won't need to be touched at all if they haven't been before).

Maybe I'll get to it sometime this month...

I have a better solution in mind, I just need to find some time (and motivation) to work on PowerTools again. I've been slowly moving a lot of the core functionality of PowerTools into a [separate library](https://git.ngni.us/NGnius/powerbox) while also adding the ability for it to read (instead of just write) settings for various peripherals. Once that work is done and integrated into PowerTools, PowerTools can check if all of the settings are set correctly and only set the ones that aren't, if there are any. That check will still have to run on a loop, but it'll have a lot less side effects (e.g. the system journal won't get spammed, settings won't need to be touched at all if they haven't been before). Maybe I'll get to it sometime this month...

I hope you can find the time brother.
If you need any more feedback i try to give as detailed as i can.

Thank you for your work!

I hope you can find the time brother. If you need any more feedback i try to give as detailed as i can. Thank you for your work!
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: NG-SD-Plugins/PowerTools#163
No description provided.