Zentrol -- A new CLI util for tweaking the power management settings of Zen CPUs

Hi,

I’ve finally been able to check out the new AMD P-State driver that gives control over boosting on a per-logical core basis and it’s pretty damn cool. I put together the attached script that allows for controlling the boost and a few other pm-related settings from the command-line.

zentrol-2025010900.zip (2.2 KB)

Control is at the per-CPU/CCD/CCX/Core level. So you can do something like:

$ sudo zentrol ccd 0 scaling_governor performance

to set the scaling governor to ‘performance’ for all cores on CCD 0; or something like:

$ sudo zentrol ccx 4 pstate.status guided

to set the operation mode of the P-State driver to ‘guided’ for all the cores in CCX 4; or:

$ sudo zentrol core 10 boost disabled

to disable boosting (CPB) on just logical core 10; or:

$ zentrol cpu 0 boost

to show whether boost is enabled or disabled for each core on CPU 0

There’s also the builtin command ‘read.docs’ which will attempt to bring up a copy of the P-State driver documentation, which explains what the different settings and values do.

I’ve only tested it on a 1-CCD Zen 2 and a 2-CCD Zen 3 chip, but if my assumptions are correct, it should scale up to Threadripper and even multi-socket EPYC.

In order to use this util you will need to be running at least kernel 6.11 and have the amd-pstate driver loaded and active. To see which driver is currently in use, simply run:

$ zentrol cpu 0 scaling_driver

I may keep hacking on it or it may be feature complete for now, but I wanted to share it in case anyone else found it useful. Any testing or feedback is welcome :slight_smile:

Edit, new version: Accounted for the Zen-based, Hygon Dhyana, but then forgot to account for the Hygon Dhyana lol; also tweak the help to be more consistent

Edit2: Fix a cut-n-paste typo in the ‘sd’ code; tighten up ‘read.docs’ a tad

7 Likes

That sounds interesting. Sadly my EPYC servers are offline for the time being so I can’t test your script on that platform for you, I’m sure others will chime in instead.

Hey, thanks for the thought! It’s pretty crazy to me that they’ve been able to give us per-logical cpu granularity.

It’s also nice having the ability to clock the cores down all the way down to 550MHz when the previous floor was 2.2GHz