12th gen power management on Linux

Hi all, I was seeing ~9W power consumption when idle. It’s too much, I’d expect around 3W or so. With lid closed, laptop enters sleep mode (I believe), but stays warm and it has depleted full charge in about 6 hours.

OS: Debian Sid
Kernel: 5.18
CPU: i-1280
RAM: 64G

In dmesg there are those lines:

i915 0000:00:02.0: firmware: failed to load i915/adlp_dmc_ver2_14.bin (-2)i915 0000:00:02.0: [drm] Failed to load DMC firmware i915/adlp_dmc_ver2_14.bin. Disabling runtime power management.
...
i915 0000:00:02.0: firmware: failed to load i915/adlp_guc_69.0.3.bin (-2)

Which means that GPU’s firmware that does power management isn’t loaded. I’ve downloaded those files from here i915 - kernel/git/firmware/linux-firmware.git - Repository of firmware blobs for use with the Linux kernel and put them in /lib/firmware/i915, and run update-initramfs -u.

Now with those firmware blobs loaded power consumption is ~3.5W idle which is about right. But both Firefox and Chrome are unbearably laggy, and when browsing and scrolling pages around, CPU fan spins up to the max.

I’ve also tried booting Ubuntu 22.04 from a flash drive, and while I wasn’t measuring battery drain, it showed time on battery to be ~3h with about 40% of charge which indicates the same problem.

There are similar reports for Windows – Chrome being super laggy, and the proposed solution is to install latest intel drivers.

Any ideas or hints?

You could try installing kernel 5.19, see if that fixes things. It’s currently in experimental, so you could try giving that a shot: Install the latest rc kernel on debian - Unix & Linux Stack Exchange

There’s an intel-microcode Debian package that you might want to try and see if that makes any diffference. You might try the GNOME Power Manager to do some historical charting to see if you can spot anything going on along with htop or something like that.

FWIW, running Arch w/ 5.18.16 on a 1260P, I’ve had no issues with unexpected power usage, idle power consumption, or with system responsiveness so far.

Update: one more thing to check out if you’re CPU responsiveness is wonky: Linux battery life tuning - #204 by Michael_Wu

2 Likes

Thanks folks, I’ve tried 5.19-trunk from Debian’s experimental repo with the same results and do have intel-microcode installed.

As it turns out the issue is related to i3wm and presumably lack of compositing. If I open FF/Chrome in fullscreen, then there is no lags and scrolling is real smooth; drawback is rendering artefacts – a bunch of pixels throught the screen is stuck and isn’t updated. Enabling / disabling VSYNC has some effect, but artefacts still remain. I’ve tried switching to UXA rendering in Xorg, but Xorg doesn’t start failing on assert about buffer size. Running a compositor in addition to i3 doen’t make any difference. When FF is started in KDE, there is no lag, but there are some insignificant artefacts that later disappear.

So, I’ve moved to Wayland + sway and the problem is solved. No lags, no artefacts, works smoothly. Battery drain is still pretty high: 7-8W when idle and FF running, but now it falls below 9W and GPU spends most of the time in RC6.

I have also just received my Gen 12 framework an see approx. 10W idle usage on debian. I manually added the 2 firmware files and made sure they are loaded properly, but still >8W power consumption. Removing HDMI and USB-A takes me to 6.2W, which is still more than I expect (50% display brightness, Wifi connected).

Any ideas?

Powertop and tlp are installed properly.

I had read somewhere that disconnecting the modules helps.

Probably more useful in the case where your laptop is switched off though. Although if you are so inclined as to do it while it’s switched on, go right ahead.

Best Regards,
Varg

Are you really using Sid? Why? I had problems getting Bullseye to work so I went to Bookworm. How are you measuring your power consumption? powertop output when on battery or are you using a “physical” power meter?

One thing that could be a big savings is that Wayland might be more power efficient than X. I haven’t tested on Intel systems (maybe someone wants to test/report) or what idle differences look like, but on a mixed workload on a Ryzen 5000 Ubuntu 21.10 GNOME session, Phoronix measured an average 3W power consumption difference last year: GNOME's Wayland Session Shows Potential For Better Battery Life Than With X.Org - Phoronix

The way I’d approach it is to do a sanity check with powertop’s idle stats - if I leave my laptop alone w/ just powertop in a terminal, it gets to about 75% in the C10 state. If you’re not having significant (or any) C10 states, you should try to figure out why. powertop will tell you events/s which is useful, but also just ordering htop processes by time will probably also show you if there’s anything keeping the processor busy.

There are probably some other tips within this thread as things to test out: Linux battery life tuning

(For example, someone there mentioned replacing PulseAudio w/ pipewire dropped a watt of power usage).

I did not see a significant difference between Wayland and X11.

I see that it never reaches C9 or C10, but cannot tell why. Even with no GUI and SDDM stopped powertop shows Pkg(hw) 85% in C8, and 0% for C9 and C10.

The lowest value I saw was 5.5W. Not too bad, but still far from the values that others seem to reach. Could it be the Samsung Pro 980 with PCIe4?

Has anyone tried disabling cores yet? The power of 12th gen P series honestly seems overkill for normal use. Only time it would be useful for me is rust compilation. I wonder if they should have offered U series chips either instead of or in addition to the P series chips.

You can’t disable all of the E or P cores, you can reduce them to only 1 at a minimum. I have never tried running with 1 P core, I disable the E cores more often.

Thats a shame… wondering why they have done it like that. I know that it is possible on some desktop boards.

Did you notice any differences battery wise?

My understanding is that with the E cores because they come in sets of 4 you’ll only notice a substantial power difference if you go down to 4 or 0 E cores. But from what you’re saying you can’t go down to 0. So does going down to let’s say 4 E Cores and 2 P Cores give big power consumption gains?

I would guess in real world use it would be over half as fast because most of the time you’d struggle to utilise all 12 cores anyway.

Also wondering about 8 E Cores and 1 or 2 P Cores to make it more similar to the U series.

I was very surprised by this as well considering desktop boards can disable all of them.

Didn’t really try it as most of the time when I was doing troubleshooting when I see temps running up or some stuttering in certain programs, I would go to the BIOS and disable the E cores as much as I can and see it helped performance. Was plugged in when those things happened.

Then this would be weird because you can choose 8 E cores all the way to 1 E core active, not in groups of 8.

4 e-cores form a cluster, that has some resources / logic that is shared between the cores.
So when you are only running 1 e-core, the shared logic for that cluster is still active and consumes power.
It will consume less power when disabling a single e-core, but disabling the whole cluster should reduce power draw by 4x (e-cores) + y (shared logic).

2 Likes

You can do that but I don’t think you get the best power efficiency by doing so. @Simon_F elaborates on it.

1 Like

Output from lstopo:

It’s also possible to shutdown all but the first core without reboot with echo 0 | tee /sys/devices/system/cpu/cpu*/online (or do it more selectively if you like). I’m not sure if it completely cuts off power or not. I don’t see any obvious improvement with a single core left online.

As in there’s negligible power draw difference between having all 14 cores online and having only 1 core online?

I’ve done some experimentation with this as well and also didn’t notice idle power use improve significantly by disabling P cores - basically within margin of error

2 Likes

Yes. I did a few better experiments right now:
3.5W – raw console, idle, 1p or 20 cores, with or without wifi,
4.06W – wayland, idle, 20 cores or 1p+4e cores
4.01W – wayland, idle, 1p core,
5.1W – wayland, firefox (~20 tabs), idle, 1 or 20 cores.

In all cases I did minimal interactions with the system and waited enough for measurements to become stable. Brightness is down to the minimum.
There is 0.05W difference between wayland in idle and I think it’s significant, but that’s really too little to be of any importance. As soon I’m starting to do anything, power drain goes to at least 7-8W.

It’s quite interesting what the difference would online cores make when doing some real-world work, but it’s hard to benchmark. I was typing this post on all cores enabled – 7-8W. When I switched to 1p core, it became 10W. Swithed back to 20 cores – 8W, switched back to 1p core – still 8.5W. 1p + 4e – 7.5W. So nothing definitive.

1 Like