View on GitHub

simple-nvidia-undervolt

Overclock or undervolt your NVIDIA GPU from the Windows command line — a lightweight MSI Afterburner alternative. Caps voltage by flattening the V/F curve, no background process. Tested on RTX 5090 (Blackwell).

End-to-end tests (real GPU writes)

xUnit tests that exercise the real built executable (src/bin/simple-nvidia-undervolt.exe) against the actual driver and Task Scheduler: the action always goes through the exe, and the result is verified with direct library calls (reading the GPU via NVAPI, inspecting files, or querying Task Scheduler). They are a separate project from tests/ (pure logic, no GPU) so the unit tests stay fast and hardware-free.

⚠️ These change live GPU tuning and touch Task Scheduler / Program Files. A collection fixture snapshots the current tuning (core V/F curve deltas, the P0 graphics/memory clock and core-voltage offsets, voltage boost) and restores it when the run finishes; every test that runs clear or a persisting undervolt backs up and restores the existing logon-task registration and Program Files install. Run them deliberately: if the host crashes (or the run is killed) before the restore, the test tuning and the replaced task/install remain — the backups are kept in %TEMP% as nvundervolt-task-backup-*.xml / nvundervolt-install-backup-*, and clear resets the GPU.

Running

From an Administrator shell:

dotnet test e2e

Each test is skipped (not failed) unless the host is elevated and an NVIDIA GPU is present, so running without admin — or as part of a wider dotnet test — does nothing.

The under-load tests open a visible browser window (Playwright headless renders WebGL in software) running a heavy WebGL shader for the duration of the test. Edge and Chrome are used if installed; otherwise fetch the Chromium matching this project’s Playwright with the script generated next to the test binaries — a globally installed playwright CLI is often a different version and fetches a browser it can’t launch:

pwsh e2e/bin/Debug/net10.0-windows/playwright.ps1 install chromium

These tests skip when no browser can be launched, the load doesn’t land on the NVIDIA GPU (hybrid graphics), or the card is power-limited — where TGP, not the voltage cap, picks the operating point.

The tests that run clear or a persisting undervolt mutate the real simple-nvidia-undervolt logon task and Program Files install, but back both up (the task XML byte-for-byte) and restore them when they finish. A restore that fails keeps the backup and fails the test with its path.

What runs

All actions are driven through the exe; assertions read back directly. Coverage, by area: