6

First of all, I do not know whether I should be asking this here or in the Electronics StackExchange, so please let me know if you think I should ask it there.

I am interested in measuring the energy consumption of each CPU core in Intel CPUs. I have read Intel's Intel 64 developer manual, and, as I understand, RAPL will provide energy estimations for:

  • The whole Package
  • The Cores
  • An unspecified Uncore device (Only in client processors)
  • The DRAM (Only in server processors)

This would indicate that the best I can aspire to is a value for the collective energy consumption of all the cores in the CPU. However, I also know that "RAPL is not an analog power meter, but rather uses a software power model", according to https://01.org/blogs/2014/running-average-power-limit-%E2%80%93-rapl.

What I would like to know is, is the way this model works known, or publicly available? And, would it be possible to get an estimation of individual core power consumption using metrics provided by RAPL or other interfaces? I know that, if Intel isn't providing this information through RAPL it is probably impossible to get it, but I would like to at least find a source that confirms that.

Thanks for your help!

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Juan González
  • 177
  • 1
  • 3
  • 10
  • If "other interfaces" include building your own motherboard with current measurement capability for the supply lines to the CPU, then yes, it would be possible to check power consumption. Or decent approximation with an ammeter on the 12V supply to the CPU voltage regulators, since modern mobos usually supply that with a separate cable from the power supply; an assumption of >90% efficiency is probably close enough to not be a big source of error. I wouldn't be surprised if someone's done that before and published something about it. – Peter Cordes Jun 10 '21 at 17:04
  • 1
    Wow, I didn't know power measurement was/is done with a microcontroller that samples a few physical quantities (eg: temperature) and some architectural events that are then fed to a software model. If there's anything about it, it's the patents (try searching "a combination of Intel", "PMA", "PCU", "RAPL" in Google Patents). Regarding the power of each core, I don't think it's possible. The cores are usually the RAPL domain P0, all of them. I guess you want the measurement in real-time, not by just halting all but one core (which will bias the measurement due to TB). – Margaret Bloom Jun 11 '21 at 17:49

1 Answers1

-1

Here is a post on different tools that you can use to get energy measurements for different Operating Systems. If you are using Linux, consider using the Perf since it uses the RAPL interface to get energy measurements. As far as I know, Perf does not offer energy consumption per core but as a whole (package) and you can get energy measurements for an executable (of any kind: Python, Java, SHELL, C, and so on) using the following command:

sudo perf stat -e power/energy-cores/ ./executable
sgeorgiou
  • 59
  • 10