[TRACKING] PPD v TLP for AMD Ryzen 7040

@herodot @Mario_Limonciello Thank you Guys !

I stumbled across

yesterday and I am using it at the moment to switch epp preferences in sync with platform profiles

Hope you don’t mind, but I was in need of this very package and decided to create it myself: power-profiles-daemon-patched-amd-git.

13 Likes

Thank you so much for this! I’m also an arch user but didn’t know how I would do this myself.

Thanks for this, you and everyone above. I’ve been trying to follow this discussion as best as I can.

While TLP seems to show more promise than initially thought, the current recommendation seems to be to use PPD. Now that recommendation has evolved into using Mario’s AMD patches for PPD as well. Am I following this correctly? Also, is powertop --auto-tune also suggested on top of PPD?

I need to perform more stringent monitoring, but powertop puts my idle baseline power around 6.5W with 50% brightness on the FW13 7640u running Arch 6.6.8.

I made a note of my interpretation for Arch users in the Arch Wiki Framework stub. Please feel free to edit/correct.

1 Like

And, here is a way to bring Mario’s patches to NixOS, adding this to configuration.nix:

  nixpkgs.overlays = [ (final: prev: {
      power-profiles-daemon = prev.power-profiles-daemon.overrideAttrs(
        old: {
          version = "0.13-1";

          patches = (old.patches or []) ++ [
             (prev.fetchpatch {
                url = "https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/merge_requests/127.patch"; 
                sha256= "sha256-jnq5yJvWQHOlZ78SE/4/HqiQfF25YHQH/T4wwDVRHR0=";
             })
             (prev.fetchpatch {
                url = "https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/merge_requests/128.patch"; 
                sha256 = "sha256-YD9wn9IQlCp02r4lmwRnx9Eur2VVP1JfC/Bm8hlzF3Q=";
             })
             (prev.fetchpatch {
                url = "https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/merge_requests/129.patch"; 
                sha256 = "sha256-9T+I3BAUW3u4LldF85ctE0/PLu9u+KBN4maoL653WJU=";
             })
          ];

          # explicitly fetching the source to make sure we're patching over 0.13 (this isn't strictly needed):
          src = prev.fetchFromGitLab {
            domain = "gitlab.freedesktop.org";
            owner = "hadess";
            repo = "power-profiles-daemon";
            rev = "0.13";
            sha256 = "sha256-ErHy+shxZQ/aCryGhovmJ6KmAMt9OZeQGDbHIkC0vUE=";
          };
        });
      }
  )];
2 Likes

Does this work on Debian sid?

I installed power-profiles-daemon_0.13-2+pstate~noble1_amd64.deb, will report back. it installed with dpkg -i with no errors.

You can try to add the Ubuntu PPA and use one of the Ubuntu releases it’s built for. Don’t know if it will work.

1 Like

seems like it installed fine. will report back.

Screenshot_20231228_141058
Looks like its working on Debian sid fine. Thanks @Mario_Limonciello!!

2 Likes

I was able to replicate the results herodot got in Fedora 39, but on Arch. The 3.5W state occurred when KDE energy savings turned off the monitor. Normal use with a single browser tab, 25% screen brightness, and no keyboard backlight was closer to ~7.5W and idle (except Konsole, running powertop) with the screen on was ~5.2W.

I’ll also note that I wish I knew powertop required 133 minutes of measurement data to fully work (400 measurements at 20 seconds each) before starting this.

1 Like

Hi everyone thanks for the great work to get better power management on our framework.
Special thanks to @Mario_Limonciello for the ppa.

I have intalled Mario’s ppa on ubuntu 23.10 - and consumption is much better (between 7,5 and 5W).

Two questions here :

  1. I get that ppd and amdpstate are now kind of “linked” thanks to the ppa. However can we get a better view on what is set by the ppd ? For instance : min/max fresquencies ? Turbo core on/off ? etc.

  2. Since I’m not sure what the power profile allows and prevents exactly, it’s more an observation than a fact but it seems that after suspend eventhough I’m in “nergy saver” I get higher frequency than expected. After I reapply the profile (change it to another one then change it back), it seems fine.

Thanks !

1 Like

Thank you I just added it to my config

You can look at the PPD and Framework’s EC source code to see exactly what is changed. To summarize it, changing the slider will now:

  1. Set the EPP preference, which is a bias described here: amd-pstate CPU Performance Scaling Driver — The Linux Kernel documentation
  2. Set the CPUFreq scaling governor to either powersave or performance.
  3. Set the ACPI platform profile. This will use the amd-pmf driver to notify Framework’s EC to change CPU coefficients. The exact changes made are described here: EmbeddedController/zephyr/program/lotus/azalea/src/cpu_power.c at lotus-zephyr · FrameworkComputer/EmbeddedController · GitHub

This sure sounds like a kernel bug to me. Can you reproduce it on 6.7-rc7? If so; would you please file a kernel bugzilla with all the details from the command cpupower frequency-info before and after suspend?

NOTE: Unfortunately using this command is a little awkward on the Ubuntu mainline PPA, you might need to compile from scratch to get the tool.

7 Likes

I’ve installed the rpm on opensuse tumbleweed, and unfortunately while operating on battery I observe an annoying “mouse is attached to a rubber band” effect, which makes it slow to react until all of a sudden the cursor catches up.

I wonder if I’m an outliar. The benefit on power consumption is visible though.

I guess I’m gonna try this on my dual-boot F39 install.

EDIT: weirdly enough, no rubber band effect on F39. My F39 install is one kernel build behind tho, so I wonder if 6.6.7 on TW isn’t playing nice with the PPD patch while 6.6.6 I’m running on F39 is.

I’m updating my F39 install, I think I should get 6.6.7 once it’s done. Will report back.

EDIT2: I actually got 6.6.8 on Fedora, and it’s still working fine. So I guess that installing the patched PPD on opensuse wasn’t a good idea.

Truth is I would gladly switch to Fedora, but the lack of snapper out of the box is a deal breaker :frowning:

Can you please post a video of what you mean? I don’t expect that behavior at all.

If it’s a USB mouse it sounds like it’s configured for autosuspend and you should turn that off. This isn’t caused by PPD, maybe some other policy you did turned it on.

If it’s the touchpad or both can you please try to turn off PSR using the amdgpu debug parameter?

1 Like

Of course I don’t mind, thank you so much for doing this (was just about to do it but saw it in AUR :slight_smile:)!

Cheers, it’s working great.

1 Like

Nevermind, upon some further testing I realized that even without your PPD patch, my touchpad is behaving erratically. I guess that some update in libinput or the kernel borked something for me.
Cool, yet another problem :frowning:

It seems like 6.6.7 broke something for me.
I have gone back to UMA auto in the BIOS, removed the PPD patch, but nothing worked until I reverted to a snapshot from a few days ago, which runs 6.6.6 (I thank Tumbleweed’s snapshots OOTB every day!).
Not the topic of this conversation anyway…if I feel brave enough I may give the patch another try, but right now I’m just too happy to have my system back as it should, that I’d rather keep things as they are for a bit :smiley:
Gaming was terrible too, with constant lag and audio freezing. Dunno WTF happened but I guess I’ll stay on this kernel for a while.

Same values here, also on Arch + KDE (did not check the monitor off state), without any ill side-effects so far, thanks @efindus for the package!