Switching from Windows to Linux, one thing I missed dearly was ThrottleStop. Its a handy tool to get a look at what the CPU is doing. I also found it helpful for troubleshooting all kinds of performance and power related issues.
So I created a terminal application that monitors CPU quantities like frequency, load, temperature, voltage and power draw. Using the ectool it reads the fan speed from the embedded controller. The monitoring application can be found here
I’m curious how well the app works with the P and E cores of 12th Gen CPUs. So far I only tested it with Pop!_OS 22.04 and an i7-1165G7. Suggestions or bugreports are appreciated.
Getting an error when running on Fedora 37 with i7-1165G7. When running as normal user I get a segfault which I narrowed down to the gpu() function (I had to change /sys/class/drm/card0/gt_cur_freq_mhz to /sys/class/drm/card1/gt_cur_freq_mhz). When running as root I get a segfault “Error opening file” as well but I haven’t narrowed that down yet.
Figured it out. The issue is because I don’t have a battery (I’m using a standalone mainboard) so the file “/sys/class/power_supply/BAT1/voltage_now” doesn’t exist. I removed that part of the code and now it works!
CPU load reading should work now with double digit core numbers.
Thats odd. The app calculates the power after reading from the energy counters at every second: /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj = package /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0/energy_uj = cores /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:1/energy_uj = uncore = gpu
With 490 W your µJ counters should tick upwards with 8 to 9 digits at a time:
490 W * 1 s = 490 J = 490,000,000 µJ
Could you confirm this, e.g. by running the following command and counting the highlighted digits: watch -d -n 1 sudo cat /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj
I cannot reproduce the floating point exception. I read online that this exception can happen after dividing by zero. I went through the code and added several checks that should prevent division by zero.
Well thats nice. I’m surprised about how low your package power is. My i7-1165G7 is usually between 1 W and 2 W. From reading and watching several Laptop reviews, I got the impression that idle power draw got worse with 12th Gen CPUs. Maybe its not bad after all.