Skip to main content

Adjust power management settings for Ryzen CPUs on Linux, Windows, and macOS

Project description

ZenMaster

PyPI Python License Platform

Overview

ZenMaster adjusts power limits, temperatures, VRM currents, clocks, voltages, and Curve Optimizer offsets on AMD Ryzen CPUs and APUs, no BIOS access needed. Runs on Linux, Windows, and macOS (AMD Hackintosh). Same CLI as RyzenAdj, so your existing scripts and presets just work, except you pip install it instead of building it.

pip install zenmaster
sudo zenmaster --stapm-limit=15000 --fast-limit=20000 --tctl-temp=90

What you get over RyzenAdj itself:

  • No cmake, no libpci, no build step. pip install and you're done.
  • Same --name=value args, so nothing you already have breaks.
  • PawnIO on Windows, not WinRing0. WinRing0 has known CVEs, PawnIO doesn't.
  • --help only lists what your CPU actually supports.
  • --table for a labeled sensor readout, --sensors for a compact live view, --json when you need to parse it.
  • --reapply=N if you want the settings to stick against other software fighting you.
  • import zenmaster works as a library on all three platforms.
  • Zero mandatory third-party dependencies, anywhere.

Full documentation is in the Wiki, this README is just the overview. See below for what's there.


Documentation

Page What's in it
Installation Linux, Windows, and macOS setup: ryzen_smu, PawnIO, DirectHW
CLI Usage Every option, examples, JSON output
Tuning Arguments Full argument reference with units
PM Table and Monitoring --table / --sensors / --dump-table
Library API Embedding ZenMaster in Python
How ZenMaster Talks to the SMU The mailbox protocol, and how each OS reaches it
Architecture Package layout, internals, opcode tables
Troubleshooting Fixes for the common problems
FAQ Short answers

Compatibility

Platform Privileges Driver
Linux, Python 3.10+ root ryzen_smu module, or PCI direct access
Windows, Python 3.10+ Administrator PawnIO
macOS (AMD Hackintosh), Python 3.10+ root DirectHW.kext, or the kext-free IOPCIBridge path (tuning only)
Intel n/a 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, since kernel lockdown blocks raw PCI access. Install ryzen_smu ≥ 0.1.7 and enroll the signing key in that case. Full detail on why: the How ZenMaster Talks to the SMU wiki page.

[!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.


Quick start

Linux:

pip install zenmaster
sudo zenmaster --stapm-limit=15000 --fast-limit=20000 --tctl-temp=90

Windows (install PawnIO first, reboot, then open an Administrator terminal):

pip install zenmaster
zenmaster --stapm-limit=15000 --fast-limit=20000 --tctl-temp=90

macOS (AMD Hackintosh, needs DirectHW.kext or the --iopci fallback, see the wiki):

pip3 install zenmaster
sudo python3 -m zenmaster --stapm-limit=15000 --fast-limit=20000 --tctl-temp=90

Check what your CPU supports with zenmaster --help; it only lists arguments your family actually has. Full walkthrough for each OS, including driver setup: the Installation wiki page.


Library usage

Meant to be embedded, not just run standalone.

import zenmaster
from zenmaster import detect, apply, smu

info = detect()
smu.init()

results, rejected = apply("--stapm-limit=15000 --tctl-temp=90", info.family)
for r in results:
    print(r["arg"], smu.status_name(r["status"]))

py.typed ships in the package, so your type checker sees real signatures. smu.init() raises BackendUnavailable on failure; any SMU call before init() raises SMUNotInitialized; both subclass ZenMasterError (itself a RuntimeError). Full API reference, including reading sensors, low-level mailbox access, and two runnable examples ported from RyzenAdj: the Library API wiki page.


How it compares to RyzenAdj

Same argument names, same SMU opcode semantics. Drop-in for most use cases, minus the build step and WinRing0.

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), or a compact live view (--sensors)
Use as a library Link the C libryzenadj / shell out import zenmaster
Build dependencies cmake, make, libpci None
Platforms Windows and Linux Linux, Windows, and macOS (Hackintosh)

On WinRing0

RyzenAdj's Windows backend is WinRing0 (OlsApi / OpenLibSys). It has actual CVEs (CVE-2020-14979, CVE-2021-41285) and hands any unprivileged process full read/write to physical memory, PCI config space, I/O ports. A few AV vendors just flag it outright.

ZenMaster uses PawnIO instead: Microsoft-signed, narrow IOCTL interface, no raw physical-memory access, no CVEs on record.


Supported CPUs

First-gen Ryzen (Summit Ridge / Zen 1) through Ryzen 9000 and Strix Halo, APU and desktop. Run zenmaster --info to confirm detection and socket mapping. PM table support (--table/--sensors) is a narrower list, mostly APUs and mobile parts, see the Tuning Arguments and PM Table and Monitoring wiki pages.


Updating

pip install -U zenmaster

zenmaster --version checks PyPI for a newer release without updating; zenmaster.check_update() does the same from code.


Acknowledgments

Project Contribution
RyzenAdj Inspiration for the tool as a whole, and canonical argument names
Universal x86 Tuning Utility SMU opcode tables, Windows PawnIO path, and CPU detection approach
UXTU4Linux Core reference implementation: Linux backend logic and hardware detection
ryzen_smu Linux kernel module for SMU access
PawnIO Modern signed Windows kernel driver
DirectHW macOS kext for PCI config and physical memory access (joevt)
pciutils The darwin2 IOPCIBridge method behind the kext-free --iopci path (joevt)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zenmaster-0.6.0.tar.gz (51.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zenmaster-0.6.0-py3-none-any.whl (53.7 kB view details)

Uploaded Python 3

File details

Details for the file zenmaster-0.6.0.tar.gz.

File metadata

  • Download URL: zenmaster-0.6.0.tar.gz
  • Upload date:
  • Size: 51.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zenmaster-0.6.0.tar.gz
Algorithm Hash digest
SHA256 008d2ff0d496204cbde3ac4b21f0740c775bc144a60c6dad22d465aaeb50765d
MD5 567afa180a00ad170b554251581c9eb3
BLAKE2b-256 5239a028cf56fea5ca57de826ef998d5fe8c102f977f0d67c401e605a6805e36

See more details on using hashes here.

Provenance

The following attestation bundles were made for zenmaster-0.6.0.tar.gz:

Publisher: publish.yml on HorizonUnix/ZenMaster

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zenmaster-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: zenmaster-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 53.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zenmaster-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88b91f58db224f6bee0e29603879c40ae0c2f23893798a9fada938c45f8cd3bb
MD5 023782cac4bea43e9abd257d3781ac3a
BLAKE2b-256 62b01967e4ece09e90e62c927db2627f94f1935aeebce6656e0a43a0eaaff4e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for zenmaster-0.6.0-py3-none-any.whl:

Publisher: publish.yml on HorizonUnix/ZenMaster

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page