hubblo-org / scaphandre

⚡ Energy consumption metrology agent. Let "scaph" dive and bring back the metrics that will help you make your systems and applications more sustainable !
Apache License 2.0
1.66k stars 109 forks source link

Initiating power usage evaluation of screens #289

Open bpetit opened 1 year ago

bpetit commented 1 year ago

Problem

Today Scaphandre can be useful mostly for servers (even if there is still work todo on hard drives, fans, etc.). Laptops, and desktop computers are not properly covered as is doesn't allow to get data on screens nor their power usage (which is a pretty important part of power usage, especially for external screens). To be able to give insights about power usage in the laptop/desktop world, being able to at least estimate the power used by screens and add it to the metrics would be necessary.

Solution

As a first step, we could at least gather the list of screens detected on the system (their manufacturer/size and technology), then apply an estimation based on specialized litterature (like an energy per inch impact factor). Even if the estimated power usage metric is not used, gathering the informations regarding the screen(s) would be useful for estimations made outside of scaphandre.

Alternatives

Every insight or idea on this is welcome, please comment.

Additional context

This would be one of the needed steps to be able to make power usage metrics accessible to less technical people, through a GUI for example (now that we can run scaphandre on windows...)

TheElectronWill commented 1 year ago

Note that on some recent laptops, the consumption of the whole machine, including the screen, is reported by RAPL in intel-rapl:1. or almost: I've used a powermeter to compare

ArneTR commented 1 year ago

Note that on some recent laptops, the consumption of the whole machine, including the screen, is reported by RAPL in intel-rapl:1. or almost: I've used a powermeter to compare

@TheElectronWill

This is very new information to me and I have never head that RAPL will report such values. Can you cat the name that this domain is assigned to?

cat "/sys/class/powercap/intel-rapl:1/name"
  1. How do you even reliably measure the power consumption of a laptop through a power meter? How do you remove buffer effects from the battery and the AC/DC converter?
TheElectronWill commented 1 year ago

This is very new information to me and I have never head that RAPL will report such values. Can you cat the name that this domain is assigned to?

cat "/sys/class/powercap/intel-rapl:1/name"

It's psys. See some info here or here.

  1. How do you even reliably measure the power consumption of a laptop through a power meter? How do you remove buffer effects from the battery and the AC/DC converter?

I've done two things:

There are certainly more precise methods, but it was enough to determine that psys was giving information about the whole system.

arthurzenika commented 1 year ago

On a laptop you can get also some approximation with the battery drainage that you can get with

upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep W

(There is probably some lower level API that upower uses).