powerapi-ng / pyJoules

A Python library to capture the energy consumption of code snippets
MIT License
69 stars 8 forks source link

Unable to monitor energy for package and core domains #14

Closed nikhil153 closed 3 years ago

nikhil153 commented 3 years ago

Hi,

I am trying to compare energy footprint of two different Intel processors. I am able to collect energy data for all the domains ("package_0; dram_0; core_0; uncore_0") on "Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz". However, I only see data for "dram_0;dram_1" domains for the "Intel(R) Xeon(R) CPU E5-2683 v4 @ 2.10GHz".

I am using a decorator to monitor energy.

Any suggestions?

Thanks!

nikhil153 commented 3 years ago

I figured out the issue. This happens on the multi-socket machines with mismatch between RAPL package indexing on the machine and socket index numbering in rapl_device.py.

johannabar commented 2 years ago

Hello! I am facing the same issue, I am only getting dram and none of the other metrics for the CPU,

I was wondering how you managed to make it work in the end? By changing the rapl_device.py file? Thanks!

venugopalansgr commented 5 months ago

I faced the same issue and taking note of what nikhil153 mentioned, did the following fix in line 136 of rapl_device.py:

if domain_name_file.readline() == 'package-' + str(socket_id) + '\n': #removed this if "package-" in domain_name_file.readline(): #replaced with this

Hope this helps others too!