Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAPL seems to overstate the power usage by a factor of two #2001

Closed
galaktyczny-seba opened this issue Mar 14, 2024 · 2 comments
Closed

RAPL seems to overstate the power usage by a factor of two #2001

galaktyczny-seba opened this issue Mar 14, 2024 · 2 comments

Comments

@galaktyczny-seba
Copy link

Brief description of your issue

On two systems: a desktop with i5-12600K and a laptop with i5-1145G7 I feel like the total usage is a sum of all CPU power domains and the package power, which is already a sum of all the power domains. This correlates with my own comparisons to other software (HWiNFO), which seem to report about a half of what's reported by System Informer.

Steps to reproduce (optional)

Enable RAPL device in settings. Go to "System information". Look up the maximum power level of your CPU, perhaps use a kill-a-watt (AC power meter), or compare with some other software. Stress your CPU. Evaluate for yourself whether you believe the measurements. Seeing values nearing 70 watts on a small laptop with 28 W CPU and a 65 W power brick is what made me suspicious.

Expected behavior (optional)

Total power should equal package power, I think.

Actual behavior (optional)

obraz

Environment (optional)

Windows 11 23H2 22631.3155
MSI PRO Z690-A DDR4
Intel Core i5-12600K
System Informer 3.0.7479 (fe48085)
@dmex
Copy link
Member

dmex commented Mar 21, 2024

the total usage is a sum of all CPU power domains and the package power, which is already a sum of all the power domains.

That's how it's calculated by the intelppm.sys kernel driver:
https://learn.microsoft.com/en-us/windows-hardware/drivers/powermeter/energy-meter-interface

The driver calculates the values and we just report what's provided by the driver. You can compare the counters with powershell:
Get-Counter "\Energy Meter(_Total)\Energy"
Get-Counter "\Energy Meter(RAPL_Package0_PKG)\Energy"

other software (HWiNFO), which seem to report about a half of what's reported by System Informer.

RAPL is a running average power usage and you're going to see different values reported depending on the version of intelppm.sys and also starting 2022 the RAPL interface has severely limited sampling rate, low sampling frequency, and low resolution depending if SGX is enabled or disabled and also the microcode version: https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/advisory-guidance/running-average-power-limit-energy-reporting.html

@galaktyczny-seba
Copy link
Author

I don't understand how a lowered sample rate and resolution lead to +100% error, consistent all the time and across two platforms. The values sound improbable, especially the 300 watts at full load. Not impossible though, because i9 does exist and would technically fit my mobo.

I've tested the Get-Counter method while loading the CPU with y-cruncher's small in-cache FFT. It's a stress test known for exceptionally high CPU core power utilization. The results were around 150 W in Get-Counter and all other apps, 300 W in System Informer. FWIW, Intel says in this document that HWiNFO and CPU-Z also get their data from RAPL.

My understanding is that the values (core+package) are being added in lines 296-298 of power.c. I believe that the package power (CurrentProcessorPower I think?) is already a sum of several values which include core. From electronic engineering standpoint, It would make no sense that the package itself, not its contents, would use power.

@dmex dmex closed this as completed in 4250256 Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants