A tool/pipeline for monitoring temps of the GPU/CPU on my ASUS TUF laptop running Debian 13.
| .forgejo/workflows | ||
| amd-monitor.sh | ||
| plot_power.py | ||
| power_log.csv | ||
| README.md | ||
AMD TUF Power Monitor
Two small utilities live here:
amd-monitor.sh– a one‑second loop that reads AMD APU/dGPU telemetry from/sys/class/hwmon, prints a live dashboard, and appends the readings topower_log.csv.plot_power.py– turns the CSV log into a bar + line chart so you can visualize power draw and temperatures after a capture session.
The scripts were built for an ASUS TUF laptop running Debian 13, but they should work on any recent AMD system that exposes the same hwmon files.
Requirements
- Bash (already on most Linux installs).
- Read access to the hwmon entries for your APU and GPU. On some systems you need to run the script with
sudoor add yourself to thevideogroup. - Python 3.9+ with
pandasandmatplotlib(pip install pandas matplotlib) for plotting.
Usage Flow
-
Collect live telemetry
chmod +x amd-monitor.sh ./amd-monitor.sh- The script clears the terminal and prints APU/GPU wattage, temperatures, and total power every second.
- Each sample is appended to
power_log.csvastimestamp,apu_w,gpu_w,total_w,apu_temp,gpu_temp. - The file is capped at the most recent 500 lines; tweak
MAX_LINESif you want longer captures.
-
Adjust sensor paths if needed
- Edit the
APU_HWMONandGPU_HWMONvariables near the top ofamd-monitor.shso they point to the correct/sys/class/hwmon/...folders on your machine. - You can also change
INTERVALfor faster/slower sampling andLOGFILEif you want a different CSV name.
- Edit the
-
Plot the results
python3 plot_power.py- The script reads
power_log.csv(assumed to be headerless), down-samples if there are more than ~200 records, and savespower_graph.png. - Power traces are displayed as grouped bars (APU, GPU, total) while temperatures are overlaid as dashed lines on a secondary axis.
- The script reads
Tips
- Keep
amd-monitor.shrunning while you stress the system (games, benchmarks, etc.), then stop it withCtrl+Cbefore plotting. - If you need to log multiple sessions, rename or move
power_log.csvbetween runs so plots only cover the period you care about. - Want live graphing or more metrics? Extend the CSV schema and the plotting script—the code is intentionally short and hackable.
Forgejo workflow
A Forgejo workflow (.forgejo/workflows/power-graph.yml) automates the chart generation whenever power_log.csv changes on the master branch.
What it does:
- Runs on a self-hosted runner because it needs local hwmon logs and Python packages.
- Manually clones the repo with a read token stored in
secrets.PAT_READ_REPO. - Installs Python (via
apt), prepares a virtualenv, and pullspandas+matplotlib. - Executes
python plot_power.py, producingpower_graph.png. - Uploads the PNG as a Forgejo artifact (
power-graph), so you can download the rendered plot from the workflow page.
To use it, push an updated power_log.csv to master, wait for the workflow to finish, then grab the artifact from the run summary. Update the workflow if your runner already has Python or if you want different triggers/retention.