main: remove noisy log
main: prevent early stack sum oob
backend: gracefully handle multi-file input with a missing file
A software energy consumption estimation tool built as part of the Watt-Wise Game Jam.
Usable for simple energy estimation and benchmarking. The GUI is functional on Linux, macOS, and Windows, and the sensors support is captured in the following table.
OS | Intel CPU | AMD CPU | Apple CPU | NVIDIA GPU | AMD GPU |
---|---|---|---|---|---|
Linux | ✅ (RAPL) | ✅ (RAPL) | N/A | ✅ (NVML) | ✅ (HWMON) |
Windows | ✅ (RAPL) | ⚠* (RAPL) ️ | N/A | ✅ (NVML) | ✅ (ADLX) |
macOS | ❌ | N/A | ❌ | ❌ | ❌ |
*AMD CPUs on Windows are supported by the Scaphandre driver we use to read CPUs, but a bug prevents us from reading them in the released Scaphandre driver. This PR fixes it.
Interested users on platforms without sensor support can still try the GUI out on the included example trace file.
To be clear, we'd like to check every box we can, but it can be difficult to figure out how to access relevant sensors on various platforms. If you think you can help us figure out a missing platform, please reach out!
How to install Watt Wiser on supported platforms. macOS is not listed because we do not yet have sensors working there, but we intend to add support.
xdg-desktop-portal
and at least one implementation of it (such as xdg-desktop-portal-gnome
or xdg-desktop-portal-kde
) in order to open trace files with a file picker.linux.tar.xz
).sudo ./watt-wiser-sensors | ./watt-wiser -
to visualize the your system. Superuser permissions are required to read the RAPL energy sensors on Linux, as they can be used as a cryptographic side channel.Arch Linux (AUR)
watt-wiser-sensors-git
for collecting statisticswatt-wiser-git
for graphing statistics collected with watt-wiser-sensors
, depends on watt-wiser-sensors
Install xdg-desktop-portal
and at least one implementation of it (such as xdg-desktop-portal-gnome
or xdg-desktop-portal-kde
) in order to open trace files with a file picker.
Run sudo ./watt-wiser-sensors | ./watt-wiser -
to visualize the your system. Superuser permissions are required to read the RAPL energy sensors on Linux, as they can be used as a cryptographic side channel.
windows.zip
).watt-wiser.exe
and click "Launch Sensors" to gather data from supported hardware.There are two GUI tabs, one for system energy monitoring, and the other for energy benchmarking.
You can toggle between a line plot and a stacked area plot by clicking in the chart area. The line plot is useful for comparing the absolute values of different data sources, while the stacked area graph helps estimate total consumption.
You can also toggle on/off individual data sets by clicking on the colored square to the left of that data in the legend. When using the stacked area graph, it's important to toggle off data sets that overlap. See the next section for an example.
Scroll vertically to zoom on the time axis and horizontally to pan.
You can pause the visualzation (if showing live data) with the pause button at the origin of the chart.
This tab allows you to record energy benchmarks of running programs and to review prior benchmarks.
To record a new benchmark (this requires you to have the sensors running):
To compare benchmarks you can toggle the "chart" checkbox next to multiple runs, and they will be shown together in the chart.
You can load benchmarks from past invocations of watt-wiser with the "Load from File" button. These can also be displayed in the chart.
Known issue: benchmarks loaded from files do not display their summary data, but do correctly show in the chart. This will be fixed soon.
This chart will show different numbers than the monitor tab because the system's baseline energy consumption is automatically subtracted out from the data shown. The graph is intended to reflect only the energy consumption of your measured application.
This repo includes ./example-trace.csv
, a sensor recording from Chris Waldon's desktop. It has an Intel CPU and an AMD GPU, and (at the time of the recording) there were four relevant sensors supported:
package-0
: this data is the sum of all energy use reported for the CPU, DRAM, and other silicon instrumented by Intel. This data comes from Intel's RAPL technology.core
: this data represents just the CPU, but is included within package-0
's total.dram
: this data represents just the DRAM, but is included within package-0
's total.amdgpu
: this data represents the average power draw reported by the AMD GPU via HWMON.When viewing the data in stacked area mode, core
and dram
should be toggled off to get an accurate picture of the measured energy use, otherwise their usage will be counted multiple times in the graph (since they are part of package-0
).
These instructions provide info on how to build Watt Wiser from source if you want to modify it. Make sure you install any runtime dependencies mentioned in the installation instructions above before trying this.
You'll need:
git
libsensors
's header files, which may be packaged as part of lm-sensors
After installing dependences, do the following:
First, you'll need to clone the repo:
git clone https://github.com/wattwisegames/watt-wiser
OR from the other source:
git clone https://git.sr.ht/~whereswaldon/watt-wiser
Enter the project directory:
cd watt-wiser
You can then build the gui with:
go build .
Build the sensors with:
go build ./cmd/watt-wiser-sensors/
To see whether your hardware sensors have support, run the sensors program (running as root is required for RAPL energy data):
sudo ./watt-wiser-sensors -output trace.csv
Take a peek inside of trace.csv
with any text editor.
If the CSV data it generates has more than two columns (the first two columns are just timestamps), you have some supported sensors. If you don't have any, use the provided ./example-trace.csv
from here on out.
To run the GUI against a trace, you can run:
./watt-wiser ./trace.csv
You can also directly pipe sensor data to the GUI:
sudo ./watt-wiser-sensors | ./watt-wiser -
You'll need the latest version of Go and an installation of git
.
You'll also need MingW-w64, which can be installed via MSYS2.
After Go is installed, do the following:
First, you'll need to clone the repo:
git clone https://github.com/wattwisegames/watt-wiser
OR from the other source:
git clone https://git.sr.ht/~whereswaldon/watt-wiser
Enter the project directory:
cd watt-wiser
You can then build the gui with:
go build .
Build the sensors with:
go build ./cmd/watt-wiser-sensors/
To see whether your hardware sensors have support, run the sensors program:
./watt-wiser-sensors.exe -output trace.csv
Take a peek inside of trace.csv
with notepad or any other tool.
If the CSV data it generates has more than two columns (the first two columns are just timestamps), you have some supported sensors. If you don't have any, use the provided ./example-trace.csv
from here on out.
To run the GUI against a trace, you can run:
./watt-wiser.exe ./trace.csv
If you want to view your data live, make sure you have both watt-wiser.exe
and watt-wiser-sensors.exe
in the same folder.
Then simply run ./watt-wiser.exe
and select "Launch Sensors".
Watt Wise thanks the following people for testing hardware support and offering access to various OS/hardware configurations for debugging. Please add yourself here if you're missing.
UNLICENSE