Skip to content

Rapl emi windows native - #1801

Open
MaximilianJahns wants to merge 9 commits into
green-coding-solutions:mainfrom
MaximilianJahns:rapl-emi-windows-native
Open

Rapl emi windows native#1801
MaximilianJahns wants to merge 9 commits into
green-coding-solutions:mainfrom
MaximilianJahns:rapl-emi-windows-native

Conversation

@MaximilianJahns

@MaximilianJahns MaximilianJahns commented Jul 29, 2026

Copy link
Copy Markdown

Add Windows EMI RAPL energy provider (cpu_energy_rapl_emi_component)

Adds a new metric provider for Windows that reads CPU energy via the Windows Energy Meter Interface (EMI) — no custom kernel driver or test-mode required. The inbox Microsoft PPM driver on Windows 11 bridges RAPL MSRs to EMI automatically.

What changed

metric_providers/cpu/energy/rapl/emi/component/ — new provider: source.c (Win32 binary), provider.py (GMT wrapper), build.bat
install_windows.ps1 — builds the EMI binary during installation
config.yml.example — documents EMI provider in the Windows section
frontend/js/helpers/config.js.example — display names for EMI metrics
lib/phase_stats.py — maps cpu_utilization_windows_system/core to MEAN handler
psu/energy/ac/xgboost/machine/provider.py — adds Windows CPU utilization as valid input source

Validation
Initial run on Windows 11 (Intel CPU) with both EMI and Scaphandre active simultaneously showed <1% deviation:

EMI rapl_package0_pkg: 1.81 mWh / 14.47 W
Scaphandre cpu_package: 1.96 mWh / 15.40 W

Plan: extended local benchmark across multiple compression tools (gzip, zstd, bzip2, …) and file sizes to further validate driver consistency and cross-validate EMI vs. Scaphandre over a broader workload range. Results could also be compared against existing cluster measurements in the compression category?


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@MaximilianJahns
MaximilianJahns force-pushed the rapl-emi-windows-native branch from 5734ea7 to 61d26b7 Compare July 29, 2026 11:21
@ribalba

ribalba commented Jul 29, 2026

Copy link
Copy Markdown
Member

The ‎metric_providers/psu/energy/ac/xgboost/machine/model‎ should never be checked in as this is a submodule

@ribalba ribalba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool that it seems to be a way to get to this data.

I would really be interrested in how far one can go down with the -i when does the EMI system block? When do the values diverge.

Comment thread docker/compose.yml Outdated
@@ -0,0 +1,95 @@
name: green-metrics-tool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file checked in?

Comment thread frontend/js/helpers/config.js.example Outdated
"source": "EMI",
"explanation": "Derived CPU power via Windows Energy Meter Interface"
},
"cpu_carbon_rapl_emi_component": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before i got clean name displayed in the tool/ browser. to have a better name i put the second rapl into the JS config

Comment thread lib/phase_stats.py Outdated
'lmsensors_fan_component',
'cpu_utilization_procfs_system',
'cpu_utilization_mach_system',
'cpu_utilization_windows_system',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in the other PR this should then be 'cpu_utilization_emi_system',

if not configured_providers['psu_energy_ac_xgboost_machine']['TDP']:
raise MetricProviderConfigurationError(f"{self._metric_name} provider could not be started.\nPlease set the TDP config option for PsuEnergyAcXgboostMachineProvider in the config.yml")

if 'cpu_utilization_mach_system' not in configured_providers and 'cpu_utilization_procfs_system' not in configured_providers:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be done in the submodule as a seperate PR

Comment thread tmp.py Outdated
@@ -0,0 +1,6 @@
import psycopg2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sry another local file shoudnt be there.

…tion-windows-native

Brings in the renamed providers (cpu_utilization_win32_system,
cpu_utilization_ntapi_core) plus their registration in phase_stats.py,
XGBoost/SDIA energy providers, and config examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants