5

Recently I switched from macos to linux on a mid 2014 8GB retina macbook pro. I noticed when I just edit text files in vi running in terminal, the battery runs out about twice as fast on linux.

  • Top and powertop shows minimal CPU and no GPU usage.
  • Radio devices are off
  • Display brightness set to barely visible with auto brightness off, screensaver off
  • No peripherials connected
  • Power usage is measured running on battery, querying the internal battery for voltage, current, and charge left
  • Tested with two version of macos: mavericks and big sur and 3 linux distros: antix, pop_os, fedora.
  • Fan makes the same, almost inaudible noise
  • Similar measurements on a 4GB 2015 macbook air.

On linux these did not or marginally lower power usage:

  • powertop --auto-tune
  • offline all cores but one
  • wayland instead of X11
  • not starting wayland or X11
  • removing all pci (subsequently usb) devices via sysfs (except vga and host:dram)

Idle macos uses 3.2 Watts, while idle Linux uses 8-9 Watts.

What is going on?

edit: I understand that mac software and hardware is very closely tied and information on this is somewhat walled. On the other hand years passed and this inbalance towards macos should have been eroded. (It is indeed largely eroded as I can use all the devices in the laptop even though the out-of-the-box experience is close but do not reach what macos provided about 8 years ago). I am fine with this and ready to search, ask and make extra steps to achieve low idle power usage)

edit again, results of latest research: Here's my current powersave script that reduces idle power usage from 9 Watts to 7.0W. Measured on a fairly simplified debian system running sway displaying a terminal.

brightnessctl set 21
rfkill block wifi
powertop --auto-tune
echo powersupersave > /sys/module/pcie_aspm/parameters/policy
echo active > /sys/devices/system/cpu/intel_pstate/status 
echo teo > /sys/devices/system/cpu/cpuidle/current_governor
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo powersave > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo powersave > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo powersave > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
echo power > /sys/devices/system/cpu/cpu0/power/energy_perf_bias
echo power > /sys/devices/system/cpu/cpu1/power/energy_perf_bias
echo power > /sys/devices/system/cpu/cpu2/power/energy_perf_bias
echo power > /sys/devices/system/cpu/cpu3/power/energy_perf_bias

I've found intel_gpu_top what gives some insights about what is going on: GPU is almost idle consuming no energy, CPU is 99.7% idle consuming 3.0 Watts.

With the screen blanked total power usage goes down to 4.5 Watts; according to intel_gpu_top 2.3W of this is used by the CPU (and 0 Watts by the GPU).

To reiterate, it takes Linux 7.0 Watts to idle with the screen on, something that Macos can do for 3.2 Watts on the same computer.

5
  • 1
    One is optimised for the hardware, the other isn't.
    – Tetsujin
    Commented Mar 31, 2022 at 18:41
  • Are your disks spinning down? larkinweb.co.uk/computing/…
    – davidgo
    Commented Apr 3, 2022 at 11:43
  • 1
    These macbooks have SSDs.
    – diviaki
    Commented Apr 4, 2022 at 10:07
  • Did you make any more progress on this? I'm experiencing the same thing. My MBP 2018 used ~3w on OSX and after installing proxmox VE instead it uses ~15w and I cant get it lower. Powertop reports 90% in C3 state. :(
    – Magnus O.
    Commented Feb 9 at 16:29
  • 1
    No, I didn't --
    – diviaki
    Commented Feb 29 at 15:45

2 Answers 2

4

On MacOS, powermetrics shows the cpu package is at package c7 state 99% of the time when the computer is idle. It also reports package power usage of 0.2 Watts.

On Linux, powertop reports around 55% package c2 and 40% package c3 state when idle. intel_gpu_top reports 3.2 Watts package power usage.

The 3 Watts difference almost fills the gap between idle consumption on MacOS VS Linux.

What keeps all tested Linux variants from entering deeper package C-states is yet to be answered.

1

Another partial answer. Using acpi_osi=!Darwin on the kernel command line enables going down to package C6 (credits to arch linux forum). However using the facetimehd module from patjak cancels the benefit. Such a crippled down config (no firewire and no webcam) can idle using 4.98W with minimal 2% brighness (brightnessctl set 21), 55% in C2 and 45% in C6, package power usage 1.44W. This is still at least 1.2W higher than using macos, where the package is mostly C7 when idle and the package drawing 0.2W. Experimented with running linux in a Virtualbox VM to have both linux and low energy usage but linux running idle ups package power usage from 0.2W to 5.5W.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .