No description
  • CMake 87.3%
  • Python 7.2%
  • HTML 2.5%
  • Shell 1.7%
  • JavaScript 0.6%
  • Other 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jacob Kaulike 8928402ccf Refuse a launch the number fields cannot express
- A number field that is blank, or holding text, reports an empty value - a
  stray space is enough in Firefox - so the dashboard posted null, the
  runner's int() raised, and it did so after the run directory and the
  recording had already started: the history page filled up with runs that
  failed with "int() argument must be a string... not 'NoneType'".
  Out-of-range values were started exactly as typed.
- index.html checks each number field before asking for a run name, outlines
  the offending one and says which bound it broke.
- _clean_params applies the same rules to the posted body, so the API cannot
  be talked into it either, and the launch is refused before any process or
  run directory exists.
2026-11-17 09:53:16 -07:00
archive Rebuild gpu_burn with glibc 2.34 compat for Jammy support 2026-07-08 10:40:30 -06:00
ascii first commit 2024-06-13 19:49:00 -06:00
bin Merge noble-updates into main 2026-09-25 11:12:34 -06:00
lib Rebuild gpu-burn for CUDA 13.0; update bundled libs 2026-07-08 09:46:43 -06:00
pip setup git lfs 2024-06-13 20:17:46 -06:00
procedures Monitor page: collapsible CPU section, fix utilization calc, MemTemp sensor, GPU units, filter profiles, journal viewer 2026-07-09 14:17:04 -06:00
share/cmake-3.22 first commit 2024-06-13 19:49:00 -06:00
stressmon@0542e53315 Tidy the loose ends left behind by the last passes 2026-11-16 15:06:26 -07:00
tests Refuse a launch the number fields cannot express 2026-11-17 09:53:16 -07:00
webui Refuse a launch the number fields cannot express 2026-11-17 09:53:16 -07:00
.gitattributes cmake stress-ng don't need to be git-lfs 2024-06-28 17:41:55 -06:00
.gitignore Ignore the other usual virtualenv and Python cache paths 2026-09-25 14:20:01 -06:00
.gitmodules first commit 2024-06-13 19:49:00 -06:00
amddevids first commit 2024-06-13 19:49:00 -06:00
BENCH-VALIDATION.md Correct the run sheet about the monitors 2026-11-16 16:06:28 -07:00
compare.ptx first commit 2024-06-13 19:49:00 -06:00
config.json Monitor page: collapsible CPU section, fix utilization calc, MemTemp sensor, GPU units, filter profiles, journal viewer 2026-07-09 14:17:04 -06:00
filters.json Reject a journal filter pattern that cannot compile 2026-11-16 16:03:08 -07:00
IGNORE_PATTERNS first commit 2024-06-13 19:49:00 -06:00
inteldevids first commit 2024-06-13 19:49:00 -06:00
menu setup git lfs 2024-06-13 20:17:46 -06:00
PATTERNS first commit 2024-06-13 19:49:00 -06:00
README.md Correct the run sheet about the monitors 2026-11-16 16:06:28 -07:00
requirements.txt Pin the python packages the web UI is built with 2026-11-16 15:29:34 -07:00
rma-setup.sh Stop the setup scripts assuming a desktop and a good download 2026-11-16 16:04:38 -07:00
rsync-filter.txt Rebuild gpu-burn for CUDA 13.0; update bundled libs 2026-07-08 09:46:43 -06:00
s76-burn-in.sh Launch every phase by path and stop hiding stale sensor data 2026-11-16 14:48:33 -07:00
s76-check.sh Correct a wrong claim in the s76-check.sh comment 2026-11-16 15:44:01 -07:00
s76-disable-suspend.sh Stop the setup scripts assuming a desktop and a good download 2026-11-16 16:04:38 -07:00
s76-gpu-burn.sh Start the stress phases on a bench with no desktop session 2026-11-16 15:42:20 -07:00
s76-journalctl.sh De-duplicate the journal log in one pass 2026-11-16 16:04:38 -07:00
s76-kernel-benchmark.sh Tidy the loose ends left behind by the last passes 2026-11-16 15:06:26 -07:00
s76-llvm-stress.sh Tidy the loose ends left behind by the last passes 2026-11-16 15:06:26 -07:00
s76-setup-testpy.sh Run the monitor with an interpreter that has its modules 2026-11-16 16:04:31 -07:00
s76-setup-unigine.sh Tidy the loose ends left behind by the last passes 2026-11-16 15:06:26 -07:00
s76-stress-ng.sh Tidy the loose ends left behind by the last passes 2026-11-16 15:06:26 -07:00
s76-stress-tests.sh Launch every phase by path and stop hiding stale sensor data 2026-11-16 14:48:33 -07:00
s76-stress.sh Start the stress phases on a bench with no desktop session 2026-11-16 15:42:20 -07:00
s76-testguipy.sh Start the stress phases on a bench with no desktop session 2026-11-16 15:42:20 -07:00
s76-testpy.sh Run the monitor with an interpreter that has its modules 2026-11-16 16:04:31 -07:00
s76-unigine-valley.sh Start the stress phases on a bench with no desktop session 2026-11-16 15:42:20 -07:00
s76-webui.sh Pin the python packages the web UI is built with 2026-11-16 15:29:34 -07:00
s76burnin.py Finish a burn-in run that nobody is watching 2026-11-16 15:42:04 -07:00
s76setuptestpy.py Run the monitor with an interpreter that has its modules 2026-11-16 16:04:31 -07:00
s76utils.py Stop the stress scripts from dying or overrunning unattended 2026-11-16 14:04:35 -07:00
stress-ng_revert first commit 2024-06-13 19:49:00 -06:00
sudomodule.py Stop sudo from asking a machine that has no operator 2026-11-16 15:41:55 -07:00
system76_thelio_io_2_default.uf2 add thelio io firmware blob 2024-06-14 15:20:36 -06:00
test.py Put every monitor's recording through stressmon.recorder 2026-11-16 14:54:25 -07:00
test_gui.py Put every monitor's recording through stressmon.recorder 2026-11-16 14:54:25 -07:00
test_gui.tar.xz update built test_gui with heading fix 2025-04-01 15:23:21 -06:00
trubble-stress-scripts.sh Stop the setup scripts assuming a desktop and a good download 2026-11-16 16:04:38 -07:00
valley_1.0.cfg first commit 2024-06-13 19:49:00 -06:00
venids first commit 2024-06-13 19:49:00 -06:00

System76 Stress Test Scripts

Comprehensive hardware stress-testing framework with real-time sensor monitoring, a web UI, thermal characterization, and automated procedures. Designed for System76 hardware validation but works on any Linux system.

Architecture

s76-webui.sh          →  Web UI launcher: venv setup, RAPL chmod, smartctl sudoers
webui/app.py          →  Flask application — dashboard, monitor, APIs, recording
webui/sensors.py      →  SensorManager — samples the sensors, recovers late ones
webui/hwinfo.py       →  Hardware inventory for the config page and thermal reports
webui/thermal.py      →  Thermal characterization procedure
webui/filters.py      →  Journal filter profiles (include/exclude regex with context)
webui/journal.py      →  JournalEntryWatcher — polling-based journalctl reader
webui/runners.py      →  Subprocess runner with timeout, restart, and logging
webui/procedure.py    →  Procedure definition loader (multi-phase stress workflows)
webui/stressor_categories.py →  Grouping and labels for the stressor picker
webui/config.py       →  Configuration file loader/saver (config.json, retention)
webui/ambient.py      →  Ambient temperature sensor client (network thermometer)
stressmon/            →  Hardware sensor library (git submodule)
  cpuusage.py         ←  CPU utilization (per-core % via psutil)
  cpufreq.py          ←  CPU clock speeds
  cputemp.py          ←  CPU core temperatures
  cpuwatts.py         ←  CPU package power (RAPL)
  memusage.py         ←  Memory usage (percent, used, total, available)
  memtemp.py          ←  DIMM temperatures (spd5118)
  sysfan.py           ←  System fan speeds
  gpudata.py          ←  GPU sensors (temp, clock, fan, power, utilization, VRAM)
  gpuhw.py            ←  PCI-level GPU discovery, integrated vs discrete
  drivetemp.py        ←  NVMe/SATA drive temperatures
  cpuinfo.py          ←  CPU model, vendor, P/E core topology
  hwsensors.py        ←  Abstract base class for all sensors
  updatepool.py       ←  Threaded update loop; reports failing sensors
  recorder.py         ←  Shared CSV/summary recording for all three monitors
stressmon/tests/      →  Sensor library tests (no hardware needed)
tests/                →  Web UI tests (sensors, recording, run paths, journal)
procedures/           →  JSON procedure definitions (multi-phase stress workflows)

Web UI

Start the web UI:

./s76-webui.sh              # Port 5000
./s76-webui.sh 8080         # Custom port

The launcher also fixes what the sensors need: it makes the RAPL power files world-readable (that permission does not survive a reboot) and offers to add a sudoers rule so bin/smartctl can read NVMe SMART data without a password.

Dashboard (/)

Profile launcher with parameter tuning (runtime, integrated graphics toggle, etc). Shows running processes with live log streaming, stop controls, and elapsed time.

Available profiles:

Profile What it runs
Full Burn-in Test Interactive multi-phase burn-in (serial number prompt)
CPU + Memory Stress stress-ng CPU + VM, fixed runtime
GPU Burn gpu_burn; optional Use tensor cores (-tc) checkbox
LLVM Stress Test Repeated LLVM compilation, fixed runtime
Continuous Stress (stress-ng) stress-ng + GPU until stopped
Continuous LLVM Rebuild cmake → ninja → rm build → repeat, until stopped
Hybrid Cycle (stress-ng + LLVM) Alternates the two above until stopped
Thermal Characterisation Warmup → cooldown → N × (stress + cooldown), with report
Unigine Valley GPU OpenGL benchmark, optional burn-in loop
Sensor Monitor Points at the Monitor page

Use tensor cores (-tc) is off by default: the gpu_burn build in bin/ works the GPU less hard with tensor cores enabled, so it is only used when asked for.

Monitor (/monitor)

Real-time hardware sensor dashboard with SSE (Server-Sent Events) streaming, updated every 200ms.

Sensor groups shown:

Section Data Units
CPU Utilization Per-core usage %, overall average %
CPU Frequency Per-core clock speed MHz
CPU Temperatures Per-core + package °C
CPU Power Package, Cores, Platform (RAPL) W
Memory Used %, total/used/available GB, %
DIMM Temperatures Per-DIMM (spd5118 sensors) °C
Fans Per-driver fan speeds RPM
Drives NVMe/SATA composite + sensor temps °C
GPUs Temp, clock, fan, power, VRAM usage, utilization °C/MHz/RPM/W/MB/%

The CPU section is collapsible — by default only package-level values are shown; click "Show all cores" to expand per-core data.

Other features:

  • Recording: Click "Record" to log all sensor data to CSV with timestamped samples. Downloaded as sensors-<timestamp>.csv. When a test is launched, recording happens inside the run directory instead.
  • Stale-sensor banner: If a sensor's update starts failing, its readings are whatever it last reported, and a banner names the sensor and the error instead of showing the old numbers as if they were live.
  • Sensors that come online late: A sensor with nothing to report when the web UI starts (CPU power before the RAPL chmod, drive temps before smartctl, GPUs before the driver settles) is re-created in the background and picked up automatically — sysfs sensors every 20-60s, GPUs after 2 minutes, drives after 5. /api/sensors reports which ones are still absent as sensor_missing.
  • Summary bar: Quick-glance CPU model, core count, utilization, and memory.

Procedures (/procedures)

Multi-phase stress workflows defined as JSON in procedures/. Each procedure can include:

  • stress-ng phases: CPU, memory, I/O, HDD, VM, cache, socket stressors with per-stressor runtime config
  • GPU burn phases: NVIDIA GPU stress via gpu_burn
  • Thermal characterization: Automated cooldown → stress → cooldown cycle with sensor min/max reporting
  • Sequential orchestration: Phases run in order; results collated per phase

Built-in procedures:

Procedure Phases
CPU Stress stress-ng CPU × N cores
GPU Stress GPU burn
CPU + GPU Mixed stress-ng CPU + GPU burn (concurrent)
Advanced CPU Per-core stress-ng with rotation
Compilation Stress LLVM/clang parallel builds
Burn-in CPU, memory, GPU, HDD, I/O, thermal in sequence
Thermal Test Cooldown → stress-ng all cores → cooldown with sensor logging
Full System CPU + memory + I/O + GPU (concurrent)
Full System Advanced Full system + per-core CPU + HDD
Meta-Mix Mixed stress-ng + GPU + compilation

Run History (/runs)

Every launch gets a directory under ~/stress-tests-logs/, named <YYYYMMDD_HHMMSS>_<profile>[_<custom name>] — the name is typed in the "Run name" prompt when you launch, and is only a label, so runs are easy to find again the next morning. Each run detail page shows:

  • Sensor CSV data with graphs; Full View opens one sensor across every column (all cores, all fans) instead of the representative first one
  • Thermal reports (min/max temperatures during stress)
  • Journal log with filter profiles
  • Run journal (journalctl entries tagged stress-test for the run duration)
  • Download ZIP of the whole run directory (/api/runs/<dir>/download)

Run directories are pruned by age — see Retention.

Journal Viewer (/journal)

Live journalctl viewer with filter profiles:

  • Include/Exclude patterns: Plain substring or /regex/flags syntax. Multiple patterns per profile.
  • Context lines: Configure context_before and context_after to capture stack traces and error context around matches.
  • Built-in profiles: Errors & Warnings (3 lines before, 10 after), Hardware Errors (3 before, 5 after), Stress Test Markers, All Entries.
  • Custom profiles: Create and save via the inline editor.
  • Test button: Test patterns live against the current journal.
  • Duplicate collapsing: Consecutive duplicate lines are grouped with a count badge.

Configuration (/config)

Edit ambient temperature sensor IP/port, file server settings, and the cooling hardware in the thermal inventory. The page also lists the detected hardware.

The Bench Status card at the top is the morning check for an unattended run: disk free on the volume the run logs live on, how many runs are on disk and their total size, the newest and oldest run, what retention would delete, which sensors never reported or went stale, and whether a recording is running. The same data is machine-readable at /api/bench.

Retention itself is edited in config.json directly (see below).

Data Recording

Manual Recording

Click "Record" on the monitor page. All sensors are sampled every 200ms and written to logs/REC_sensors.csv, with summary statistics in logs/REC_sensors.txt. Click "Stop" to finalize; "Download CSV" retrieves the same data.

Run Recording

When a test is launched, recording starts automatically into that run's directory (~/stress-tests-logs/<run directory>/). Files created, all prefixed with the run ID (R001, R002, …):

  • <run_id>_sensors.csv — Raw sensor time series, first column the run ID
  • <run_id>_sensors.txt — Summary statistics (min/max/mean per column)
  • <run_id>_manifest.json — What was launched, with any sensor caveats: sensor_errors (readings went stale), missing_sensors (no columns at all), sensors_online_mid_run (the sensor came back during the run, so its data has no column in the CSV)
  • *journal.log — Journal entries tagged with stress-test (the run ID prefix, or run_journal.log for the thermal procedure)
  • Thermal reports — thermal_report.txt and thermal_report.json (generated during thermal characterization)

The CSV columns are chosen when the recording starts and kept for the whole run, so every row has the same width and lines up with the header. That is why a sensor that appears part way through is written to the manifest instead of into the file.

Retention

Run directories older than retention.keep_days are deleted on startup and every six hours; the newest retention.keep_runs runs are always kept, and a run that is still going is never touched.

{
  "retention": { "keep_days": 90, "keep_runs": 200 }
}

"keep_days": 0 keeps everything.

Hardware Sensors

All sensors follow the HWSensorBase abstract class and are updated concurrently via a ThreadPoolExecutor every 200ms.

Sensor Source Data Fields
CPU Utilization psutil.cpu_percent(percpu=True) Per-core + overall average %
CPU Frequency psutil.cpu_freq() Per-core current/min/max/mean MHz
CPU Temperature psutil.sensors_temperatures()['coretemp'|'k10temp'] Per-core + package °C
CPU Power RAPL sysfs (/sys/class/powercap/intel-rapl:*) Package, Cores, Platform, Uncore W
Memory psutil.virtual_memory() Percent, used, total, available, free
DIMM Temp psutil.sensors_temperatures()['spd5118'] Per-DIMM °C
Fans psutil.sensors_fans() Per-driver RPM
GPU NVML (NVIDIA), pyamdgpuinfo (AMD), PCI sysfs Temp, clock, fan %, power, utilization %, VRAM MB
Drives pySMART (NVMe/SATA) Composite + per-sensor °C

RAPL power needs /sys/class/powercap/intel-rapl:*/energy_uj to be readable; s76-webui.sh sets that, and the sensor is picked up on its own once the file becomes readable.

Journal Integration

The web UI runs a background thread that polls journalctl for entries with a custom identifier:

journalctl -t stress-test

Scripts output structured journal entries:

echo "Stressor started: cpu_all_cores" | systemd-cat -t stress-test

The journal viewer applies regex-based filter profiles with context extraction — matching lines plus N lines before/after are displayed.

Thermal Characterization

The thermal test procedure (procedures/thermal_test.json) runs a three-phase cycle:

  1. Initial cooldown — Waits for system to reach idle temperatures
  2. Stress phase — Runs stress-ng CPU stressors on all cores while recording sensor snapshots every second
  3. Final cooldown — Monitors sensor recovery after stress stops

Outputs:

  • thermal_report.txt — Human-readable min/max for all sensors during stress
  • thermal_report.json — Machine-readable report for further analysis

Tests

Two suites, both pure standard-library unittest — no root, no network, no GPU, no smartctl and no pytest needed. From the repository root:

venv/bin/python -m unittest discover -s stressmon/tests -t .   # sensor library
venv/bin/python -m unittest discover -s tests -t .             # web UI layer

They cover the things that silently corrupt a result file: CSV heading/data alignment and column order, accumulator resets, the RAPL spike filter, GPU driver guards, run-path traversal rejection, journal de-duplication, sensor re-probe and adoption, and run-log retention.

Everything they cannot cover — a reboot, smartctl access, a real GPU, a desktop session — is listed as a check in BENCH-VALIDATION.md, with the commands to run and what a correct result looks like.

Requirements

  • OS: Linux (tested on Ubuntu 22.04+ / Pop!_OS 22.04+)
  • Python: 3.10+
  • Python packages: pinned in requirements.txt — flask, psutil, pySMART, py-cpuinfo, plus nvidia-ml-py (NVIDIA) and pyamdgpuinfo (AMD, compiles against the kernel headers)
  • System tools: system76-power (System76 GPU switching); smartctl, cmake, ninja, stress-ng and gpu_burn are bundled in bin/
  • Optional: gnome-terminal - each stress phase runs in its own window when it is available, and in the current terminal when it is not

s76-webui.sh creates venv/ and installs requirements.txt on first run. The CLI monitor (test.py) runs from that venv too when it exists; s76-setup-testpy.sh names whatever the interpreter is missing when it does not, and only unpacks pip/python.tar.xz for a python 3.10 - the version that tarball was built for.

CLI Scripts

Beyond the web UI, individual scripts are available for direct use:

Script Purpose
s76-stress-tests.sh Main CLI orchestrator with option flags
s76-stress.sh Combined stress run (stress-ng + LLVM + GPU), -t minutes
s76-stress-ng.sh Run stress-ng with configurable load
s76-gpu-burn.sh NVIDIA GPU burn-in test
s76-unigine-valley.sh Unigine Valley benchmark
s76-setup-unigine.sh Install the Unigine Valley benchmark
s76-llvm-stress.sh CPU/memory stress via LLVM builds
s76-kernel-benchmark.sh Kernel build benchmark in a chroot
s76-burn-in.sh Terminal-based full burn-in (runs s76burnin.py)
s76-webui.sh Web UI launcher
s76-journalctl.sh Tail journal entries tagged for stress test
s76-disable-suspend.sh Prevent suspend during tests
s76-check.sh Pre-flight system check
s76-setup-testpy.sh Install dependencies for sensor monitor
s76-testpy.sh Launch the curses sensor monitor (test.py)
s76-testguipy.sh Launch the tkinter sensor monitor (bundled test_gui)
test.py Curses-based sensor monitor (shares stressmon.recorder)
test_gui.py Tkinter sensor monitor source - needs python3-tk; the shipped test_gui.tar.xz bundle carries its own copy

License

MIT