German video "Einfluss von Software auf den Ressourcenverbrauch (bub2018) — Jens Gröger" from the “Bits und Bäume 2018” conference. Also this talk (german) shows that the same work is sometimes done by various pieces of software with very different energy consumption.
- Informations one would want as metrics?
- How much overall energy is my system consuming?
- How much are the single internal components consuming?
- How much energy are single processes consuming? This would look at overall consumption, compute which percentage of that the process consumes, and then compute what power the process consumes.
- How to compute overall system consumption?
- For some systems that might be readable via IPMI or proprietary kernel modules, not sure.
- The system itself displays consumption, i.e. as 'energy rate' in output of 'upower -d', but the value seems unusable when AC power is connected?
- One can monitor discharge rate of the battery of a system if no AC power is attached (upower -d).
- One could use an external power meter. The one I have can not be read digitally, so one has to run the system for some time and then read the consumption from the power meter display.
- One could consider the whole computer as a system, and that the used electrical power is converted into thermal power. So if one has a sensor reading from the air coming into the system, and the air going out, one might be able to guess. Fan speed influences this. One could also consider the ThermalDesignPower of the CPU to verify if the computed consumption makes sense. Training sessions with/without AC power connected? With/without workloads?
dnf -y install pcp-zeroconf pcp-pmda-denki cd /usr/libexec/pcp/pmdas/denki ./Install pminfo -fF denki
- older Family15h chips this is a value exported via the sensors interface that's the estimated TDP (thermal design power)
- newer (fam15h Excavator and later) support RAPL, details, linux driver in 5.11?
- Improvement ideas:
- new providers, i.e. nvidia cards - depends on nvidia libs though (proprietary?)
- power_now readings are very flaky, compute in pmda-denki an average to flatten the readings. Maybe go down to 10 readings/second? How often is the firmware/driver writing power_now?
- Make a more solid detection of batteries, like 'upower' is doing. Current code does not detect all batteries.
- Use intel gpu tools for reading Intel GPU consumption. “dnf install -y igt-gpu-tools; intel_gpu_top -l -s 10000”. Displayed consumption values seem to match RAPL package/uncore(gpu) quite nicely, so maybe nothing gained here from using this as source.
- Raspi4: outputs 0.0 values for energy_now_raw/energy_now_rate/power_now. Reporting N/A might be cleaner.
- Test series
- I would love to get my hands on an Apple M1 or newer, for power measurements.
Links, notes, hints
pmda-denki is not focusing on saving power itself, more on measuring as the first step. For saving power:
- this paper investigates RAPL usability
- dnf install tlp tlp-rdw
- tlp: documentation
- scanhandre calculates power consumption for VMs
- https://media.ccc.de/v/froscon2021-2638-grune_firmware – Uwe Berger: “Grüne firmware”
- https://eco.kde.org/ – KDE eco initiative