kostya / benchmarks

Some benchmarks of different languages
MIT License
2.79k stars 253 forks source link

Energy consumption measurement issue #407

Open PetrovskyM opened 2 years ago

PetrovskyM commented 2 years ago

Hello, I'm sorry to bother you again. When I run the benchmark, the energy measurement always ends with an output of 0.00. I'm running tests via debian in a virtual box. The measurements are taken using analyze.rb script. I have installed powercup-utils / stable, now 0.3.1-1 amd64 linux-cpupower / stable 5.10.106-1 amd64 all on debian

My processor is AMD Ryzen 5 3600 6-Core Processor 4.20 GHz

What am I doing wrong ?

kostya commented 2 years ago

i guess it work only on intel, but not sure. (or maybe virtual box bug)

nuald commented 2 years ago

Energy reading comes from the file /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj and @kostya is right, it's Intel specific. AMD supports RAPL too (https://web.eece.maine.edu/~vweaver/projects/rapl/rapl_support.html) but requires different API to use. Unfortunately, I don't have AMD processor on any computers I have, so I can't test it and add support for it.

I'm not closing this issue as I guess it's possible to implement energy reading using PAPI, however I don't have time now. All contributions are welcomed though.