ZenMaster adjusts power management settings for AMD Ryzen CPUs and APUs on Linux and Windows. It uses the same CLI as RyzenAdj, so your existing commands and presets keep working, but you install it with pip and never need a compiler. Set power limits, temperature limits, VRM currents, clocks, voltages and Curve Optimizer offsets without touching the BIOS.
pip install zenmasterReasons to use it over RyzenAdj:
- Installs with
pip— no cmake, libpci, or building from source - Same
--name=valuesyntax, so scripts and presets carry over unchanged - Uses PawnIO on Windows instead of WinRing0, which has known CVEs
--helplists only the arguments your CPU supports, not every possible option--tableshows a labeled sensor table;--jsonmakes the output scriptable--reapply=Nkeeps your settings applied so other software can't undo them- Works as a Python library —
import zenmaster— on both Linux and Windows - No mandatory third-party dependencies on either platform
| Platform | Status |
|---|---|
| Linux, Python 3.10+, root | Supported — ryzen_smu module or PCI direct access |
| Windows, Python 3.10+, Administrator | Supported — PawnIO driver |
| Intel | Not supported |
Note
On Linux, PCI direct access works on most systems without any kernel module. ryzen_smu is only required when Secure Boot is enabled, because kernel lockdown blocks raw PCI access. Install ryzen_smu ≥ 0.1.7 and enroll the signing key in that case.
Warning
This tool writes directly to the CPU's System Management Unit. Wrong values can cause instability, throttling, or a hard lock. Use at your own risk.
ZenMaster keeps RyzenAdj's argument names and SMU opcode semantics, so it is a drop-in replacement for most use cases, while removing the build step and the WinRing0 driver.
| RyzenAdj | ZenMaster | |
|---|---|---|
| Install | Build from source (cmake, pkg-config, libpci) | pip install zenmaster |
| Language | C | Pure Python 3.10+ |
| Windows driver | WinRing0 |
PawnIO ✅ |
--help |
Static — lists every argument | Dynamic — only your CPU's arguments |
| Output | Plain text | Plain text or --json |
| PM table | Raw float dump | Labeled fields with units (--table) |
| Use as a library | Link the C libryzenadj / shell out |
import zenmaster |
| Build dependencies | cmake, make, libpci | None |
| Focus | "Ryzen Mobile Processors" | Ryzen mobile and desktop |
RyzenAdj's Windows backend uses WinRing0 (OlsApi / OpenLibSys), a driver with well-documented vulnerabilities (CVE-2020-14979, CVE-2021-41285). It grants any unprivileged process full read/write access to physical memory, PCI config space, and I/O ports, and several AV vendors flag it outright.
ZenMaster uses PawnIO instead — a purpose-built, Microsoft-signed kernel driver that exposes a narrow IOCTL interface. No raw physical-memory access, no known CVEs.
pip install zenmasterRequires root, and either the ryzen_smu kernel module or PCI direct access (used automatically when available).
Install ryzen_smu (only needed when Secure Boot is on):
git clone https://github.com/amkillam/ryzen_smu
cd ryzen_smu && make && sudo make install
sudo modprobe ryzen_smuApply a preset:
sudo zenmaster --stapm-limit=15000 --fast-limit=20000 --tctl-temp=90Re-apply every 30 seconds:
sudo zenmaster --stapm-limit=15000 --reapply=30- Install PawnIO and reboot.
- Open an Administrator terminal.
pip install zenmaster
zenmaster --stapm-limit=15000 --fast-limit=20000 --tctl-temp=90zenmaster [OPTIONS] [TUNING ARGS...]
| Option | Description |
|---|---|
--help |
Show the tuning arguments supported by your CPU |
--info |
Detected CPU name, family, socket, and active backend |
--table |
Live PM table with labeled values |
--dump-table |
Raw PM table floats with hex offsets |
--json |
Machine-readable JSON output |
--reapply=N |
Re-apply settings every N seconds |
--version |
Show the installed version and check PyPI for a newer release |
Tuning arguments use the same --name=value form as RyzenAdj. Arguments that take no value (--enable-oc, --power-saving, --get-*, …) are passed as bare flags. The --get-* query commands print the value the SMU returns:
$ sudo zenmaster --get-pbo-scalar
get-pbo-scalar [RSMU 0x6D] -> OK = 42 (0x0000002A)
Check what your CPU supports:
$ zenmaster --help
ZenMaster — Ryzen Power Management Tool
Usage: zenmaster [OPTIONS] [TUNING ARGS...]
Tuning arguments for AMD Ryzen 9 7950X (Raphael, AM5_V1):
Power limits:
--stapm-limit=<mW> Sustained Power Limit — STAPM LIMIT
--fast-limit=<mW> Actual Power Limit — PPT LIMIT FAST
--slow-limit=<mW> Average Power Limit — PPT LIMIT SLOW
...
Live PM table (APU / mobile):
$ sudo zenmaster --table
PM Table Version: 0x00450005
+-------------------------+-----------+------------------------+
| STAPM LIMIT | 15.000 | stapm-limit |
| STAPM VALUE | 12.441 | |
| PPT LIMIT FAST | 20.000 | fast-limit |
| THM LIMIT CORE | 90.000 | tctl-temp |
| THM VALUE CORE | 67.125 | |
+-------------------------+-----------+------------------------+
ZenMaster is built to be embedded in tuning utilities, dashboards, and automation tools — including from non-Python apps via the --json CLI.
import zenmaster
from zenmaster import detect, apply, smu
print(zenmaster.__version__)
info = detect()
print(info.name, info.family)
try:
backend = smu.init()
print(backend)
except RuntimeError as e:
print(f"SMU unavailable: {e}")
raise SystemExit(1)
results, rejected = apply("--stapm-limit=15000 --tctl-temp=90", info.family)
for r in results:
print(r["arg"], smu.status_name(r["status"]))
apply("--enable-oc", info.family)
if smu.pm_table_supported(info.family):
data = smu.read_pm_table(info.family)
ver = smu.read_pm_table_version(info.family)
smu.send_mp1(info.family, 0x05, 15000)
smu.send_rsmu(info.family, 0x31, 90)Look up supported args for a CPU (no privileges needed):
from zenmaster import runner
print(runner.get_supported_args("Renoir"))
print(runner.lookup("Renoir", "stapm-limit"))
print(runner.is_flag_arg("enable-oc"))
print(runner.is_flag_arg("stapm-limit"))A full runnable example lives in examples/demo.py.
For integrators:
- The package ships type hints (
py.typed) — your type checker sees the full API. smu.init()raisesBackendUnavailableon failure; SMU calls before init raiseSMUNotInitialized. Both subclassZenMasterError, which subclassesRuntimeError, so you can catch as narrowly or broadly as you like.apply()returnslist[ApplyResult]— each result is a dict with the stable keysarg, value, mailbox, opcode, status, error, returned.errorisNoneon success;returnedholds the value from aget-*query.- SMU status codes are
smu.SmuStatus(anIntEnum);smu.status_name(code)gives a label.
from zenmaster import smu, BackendUnavailable
try:
smu.init()
except BackendUnavailable as e:
... # no driver / not root / Secure Boot — message explains whichInstall with dev dependencies:
pip install "zenmaster[dev]"
pytestZenMaster updates through pip:
pip install -U zenmasterTo check whether a newer release is on PyPI without updating:
zenmaster --versionFrom code, zenmaster.check_update() returns the newer version string, or None if you are current.
Covers first-gen Ryzen (Summit Ridge / Zen 1) through Ryzen 9000 and Strix Halo. Run zenmaster --info to confirm detection and socket mapping.
PM table support (--table): Raven Ridge, Picasso, Dali, Pollock, Renoir, Lucienne, Cezanne/Barcelo, Van Gogh (Steam Deck), Mendocino, Rembrandt, Phoenix Point, Hawk Point, Strix Point, Krackan Point, Strix Halo. On Linux it reads through the ryzen_smu module when loaded, otherwise over PCI direct (/dev/mem, subject to kernel CONFIG_STRICT_DEVMEM).
| Linux | Windows | |
|---|---|---|
| Python | 3.10+ | 3.10+ |
| Privileges | root | Administrator |
| Driver | ryzen_smu module or PCI direct |
PawnIO |
| Extra deps | None | None |
| Project | Contribution |
|---|---|
| RyzenAdj | Canonical argument names and SMU opcode semantics |
| UXTU4Linux | SMU opcode tables and Linux backend reference |
| Universal x86 Tuning Utility | Windows PawnIO path and CPU detection approach |
| ryzen_smu | Linux kernel module for SMU access |
| PawnIO | Modern signed Windows kernel driver |