NGnius / PowerTools

Moved to
https://git.ngni.us/NG-SD-Plugins/PowerTools
GNU General Public License v3.0
414 stars 29 forks source link

Last core running above max frequency when SMT is off #43

Closed vbaenal closed 1 year ago

vbaenal commented 2 years ago

Expected Behaviour All cores should be running between the ranges of minimum frequency and max frequency.

Actual Behaviour Setting GPU clock frequency from Gamemode interface causes the 6th core to run at more frequency than the maximum specified when SMT is off after a full Steam Deck restart.

To Reproduce Steps to reproduce the behavior:

  1. Set GPU clock frequency on gamemode interface
  2. Set SMT off and max core frequency on Powertools
  3. Fully restart Steam Deck
  4. Last core runs above maximum frequency.

Screenshots, etc. Screenshot 1: GPU freq: 400 MHz, CPU freq: 1600MHz Screenshot_1 Screenshot 2: GPU freq: 600 MHz, CPU freq: 1500 MHz Screenshot_2

vbaenal commented 2 years ago

This issue happens on v1.0.4. I will check if it's still happening on v1.0.5 once it is released on the plugin store.

NGnius commented 2 years ago

Can you send the config that you're using (should be one of the files in ~/.config/powertools, probably default_settings.json) and also the log file (/tmp/powertools-rs.log) from when you see the incorrect CPU limits?

Also, I doubt v1.0.5 will fix this

vbaenal commented 2 years ago

This is the config file for the first game (not default_settings.json)

{
  "version": 0,
  "name": "The Legend of Heroes: Trails from Zero",
  "persistent": true,
  "cpus": [
    {
      "online": true,
      "clock_limits": {
        "max": 1500,
        "min": 1400
      },
      "governor": "userspace"
    },
    {
      "online": false,
      "clock_limits": {
        "max": 1500,
        "min": 1400
      },
      "governor": "userspace"
    },
    {
      "online": true,
      "clock_limits": {
        "max": 1500,
        "min": 1400
      },
      "governor": "userspace"
    },
    {
      "online": false,
      "clock_limits": {
        "max": 1500,
        "min": 1400
      },
      "governor": "userspace"
    },
    {
      "online": true,
      "clock_limits": {
        "max": 1500,
        "min": 1400
      },
      "governor": "userspace"
    },
    {
      "online": false,
      "clock_limits": {
        "max": 1500,
        "min": 1400
      },
      "governor": "userspace"
    },
    {
      "online": true,
      "clock_limits": {
        "max": 1500,
        "min": 1400
      },
      "governor": "userspace"
    },
    {
      "online": false,
      "clock_limits": {
        "max": 1500,
        "min": 1400
      },
      "governor": "userspace"
    }
  ],
  "gpu": {
    "fast_ppt": null,
    "slow_ppt": null,
    "clock_limits": null,
    "slow_memory": false
  },
  "battery": {
    "charge_rate": null
  }
}

And this is the log file

19:14:15 [INFO] Starting back-end (powertools-rs v1.0.4)
19:14:15 [INFO] resume_worker starting...
19:14:15 [INFO] save_worker starting...
19:14:16 [INFO] Server::run; addr=127.0.0.1:44443
19:14:16 [INFO] listening on http://127.0.0.1:44443

Updating the frequency in powertools fixes the problem until the next restart

NGnius commented 2 years ago

Thanks, that all looks ok to me.

I wonder if the Steam client sets those values during startup, and it's just PowerTools being slightly faster than Steam that's causing the last core to get overridden... anyway, I'll figure that out when I find some time to look into this properly

Knurek-NC commented 1 year ago

I have the same issue (last core if SMT off and last two cores if SMT on) don't follow the minum CPU frequency setting. Toggling the frequency once up and down (or vice versa) fixes this for me. Just letting you know if this helps any.

NGnius commented 1 year ago

I haven't been able to reproduce this in the latest version, so I think it's been fixed as a side-effect of the architectural changes.