A PowerShell-based tool for monitoring power consumption of individual processes on Windows systems with support for Intel RAPL (CPU-only) and system-wide power measurements.
- Real-time interactive monitoring: Auto-refreshing display with continuous background data collection
- Dual measurement modes: Intel RAPL (CPU package) + System-wide power
- Energy accumulation: Track total energy consumed by each process since monitoring started
- Multiple views: Top X processes list or detailed single-process focus view
- Power history graphs: ASCII-based visualization of power consumption over time
- Dynamic configuration: Adjust measurement interval on the fly (1-60 seconds)
- System statistics: Runtime, total energy, current CPU/system power at a glance
- CPU utilization-based power allocation: Proportional distribution to processes
- Color-coded output: Enhanced readability
- Admin privilege detection: Automatic verification
- Interactive CLI: Similar to
top/htopwith auto-refreshing display - Commands:
list X,focus X,interval X,help,quit - Continuous monitoring: Energy accumulates from program start
- Background data collection: Updates every 2 seconds (configurable)
- Non-blocking input: Smooth typing while display refreshes
- Power graphs: Visual history for focused processes
- Requires administrator privileges for RAPL access
- Best for: Extended monitoring sessions, energy consumption analysis over time
- Intel CPU with RAPL support (Sandy Bridge or newer, 2011+)
- Check with:
wmic cpu get name - i3/i5/i7/i9 from 2011 onwards
- Check with:
- Windows PowerShell 5.1 or later (pre-installed on Windows 10/11)
- Administrator privileges required (for RAPL MSR access)
- LibreHardwareMonitorLib.dll (included in repository)
- Windows Power Meter counters (optional, for system-wide measurement)
All versions use the same core formula to calculate per-process power:
Process Energy = Time × Power × (Process CPU / Total CPU)
CPU-Only (RAPL via LibreHardwareMonitor):
- Reads CPU package power directly from Intel MSR registers
- Allocates CPU power to processes based on their CPU utilization ratio
- Measures only CPU cores + cache (excludes GPU, display, RAM, etc.)
- Typical range: 5-50W depending on workload
System-Wide (Windows Power Meter):
- Reads total system power from Windows Performance Counters
- Allocates total power to processes based on CPU utilization ratio
- Includes all system components (CPU + GPU + display + RAM + etc.)
- Typical range: 10-100W depending on system
- Often unavailable on desktop systems, more common on laptops
The Interactive version continuously tracks energy consumption:
- Updates every 2 seconds (configurable 1-60s)
- Accumulates energy for each process from program start
- Ranks processes by total accumulated energy, not instantaneous power
- Maintains power history for graphing (last 100 measurements)
# Right-click PowerShell → Run as Administrator
.\ProcessPowerMeter-Interactive.ps1The script will:
- Check for administrator privileges and LibreHardwareMonitorLib.dll
- Initialize hardware monitoring and detect CPU
- Collect initial baseline data (6 seconds)
- Start with
list 20view showing top 20 processes - Auto-refresh every 2 seconds while accepting commands
Available Commands:
list X- Show top X processes by accumulated energy (e.g.,list 10)focus X- Detailed view of process #X with power graphinterval X- Change measurement frequency (1-60 seconds)help- Show command referencequitorexit- Exit program
# Run as Administrator
.\ProcessPowerMeter-CPU.ps1 # Dual measurement (RAPL + System)
# Prototype versions (in prototypes folder)
.\prototypes\ProcessPowerMeter-Advanced.ps1 # Memory-weighted allocation
.\prototypes\ProcessPowerMeter-Top5.ps1 # Continuous top 5 monitor
.\prototypes\ProcessPowerMeter-Multi.ps1 # Choose power source# No admin required
.\ProcessPowerMeter.ps1The Interactive CLI provides commands to:
- List top X processes by accumulated energy consumption
- Focus on individual processes with detailed metrics and power graphs
- Adjust measurement frequency in real-time
- View comprehensive system statistics
- Type 'help' for full command reference
Prototype versions in prototypes/ folder offer different features:
- Multi-source power measurement selection
- Memory-weighted power allocation algorithms
- Various monitoring approaches for comparison
========================================================
Process Power Monitor - Top 20
========================================================
System Statistics:
Runtime: 00:15:32
Measurements: 465
Measurement Interval: 2s
Tracked Processes: 147
Total CPU Usage: 23.5%
CPU Power Now: 8.45 W
System Power Now: N/A
Total CPU Energy: 7.89 kJ
Top 20 Processes:
# Process CPU Energy CPU % Power Now
---------------------------------------------------------------------------
1 chrome.exe 2.15 kJ 8.50% 1.234 W
2 Code.exe 1.87 kJ 4.20% 0.876 W
3 firefox.exe 1.23 kJ 3.10% 0.654 W
4 Discord.exe 0.98 kJ 2.35% 0.432 W
...
Commands: list X | focus X | interval X | help | quit
Command>
Option 1: Intel PCM (Recommended for comprehensive metrics)
-
Download Intel PCM:
- Windows: Get from https://github.com/intel/pcm/releases or https://ci.appveyor.com/project/opcm/pcm/history
- Linux:
sudo apt install pcmorsudo yum install pcm
-
Start PCM sensor server:
Windows (Run PowerShell as Administrator):
cd C:\path\to\pcm .\pcm-sensor-server.exe -p 9738
Linux:
sudo ./pcm-sensor-server -p 9738
-
Run the script:
.\prototypes\ProcessPowerMeter-Multi.ps1 # Select "Intel PCM" from the menu
Option 2: LibreHardwareMonitor (For RAPL)
-
Download LibreHardwareMonitor:
- Get from https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/releases
- Extract
LibreHardwareMonitorLib.dllto the script directory
-
Run the script:
# Right-click PowerShell → Run as Administrator .\prototypes\ProcessPowerMeter-Multi.ps1 # Select "LibreHardwareMonitor (RAPL)" from the menu
Option 3: Windows Power Meter (No setup)
Just run the script - Power Meter is built into Windows.
-
Download LibreHardwareMonitor (if you don't have the DLL):
- Get from https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/releases
- Extract
LibreHardwareMonitorLib.dllto the script directory - Note: DLL is already included in this repository
-
Run as Administrator:
# Right-click PowerShell → Run as Administrator cd "<path-to-script-directory>" .\ProcessPowerMeter-Interactive.ps1
-
Start monitoring:
- Script auto-starts with
list 20view - Type commands to change views or settings
- Energy accumulates continuously until you quit
- Script auto-starts with
See RAPL-Setup-Guide.md for detailed RAPL setup and troubleshooting.
No special setup required - just run the script.
- Ensure you have an Intel CPU (Sandy Bridge or newer)
- Make sure OpenHardwareMonitor is running
- Run PowerShell as Administrator
- ProcessPowerMeter-CPU.ps1 requires admin privileges
- Right-click PowerShell and select "Run as Administrator"
- Your system may not support Power Meter counters
- Try on a different device (usually works on laptops)
- Download from https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/releases
- Place the DLL in the same directory as the script
- Measured via Intel RAPL MSR registers (0x611)
- Includes CPU cores and cache power
- Does NOT include GPU, memory controller, or other components
- Typical range: 5-50W depending on workload
- Measured via Windows Power Meter counters
- Includes ALL system components
- CPU + GPU + Display + RAM + Storage + Peripherals
- Typical range: 10-100W depending on system
CPU-only power is typically 30-60% of total system power on modern laptops.
ProcessPowerMeter-Interactive.ps1- Interactive CLI with continuous monitoring (⭐ recommended)ProcessPowerMeter-CPU.ps1- Dual measurement (RAPL + System side-by-side)
LibreHardwareMonitorLib.dll- Hardware monitoring library for RAPL access
prototypes/- Older prototype versions and utilities:ProcessPowerMeter-Multi.ps1- Multi-source version (RAPL/PCM/PowerMeter)ProcessPowerMeter-Advanced.ps1- Memory-weighted power allocationProcessPowerMeter-Top5.ps1- Continuous top 5 process monitorProcessPowerMeter.ps1- Basic version, system-wide onlyTest-LibreHardwareMonitor.ps1- Diagnostic script to verify RAPLInstall-PCM-Driver.ps1- Helper for Intel PCM driver installation
README.md- This fileRAPL-Setup-Guide.md- Detailed RAPL setup and troubleshootingIntel-PCM-Setup-Guide.md- Intel PCM installation guide.gitignore- Git ignore file
This project is open source and available for educational and research purposes.
- Uses LibreHardwareMonitor for RAPL access
- Windows Performance Counters for system power measurement