Info FYI: My utility for setting the PL1/PL2 power levels under Linux (setPL)

horshack

Junior Member
Aug 27, 2022
5
18
36
I have written a script that lets you to set the Intel processor PL1/PL2 power levels under Linux. Like ThrottleStop, this script also locks the MMIO register, which is necessary to prevent newer system firmware from modifying the running PL1/PL2 values.

Note that secure boot must be disabled for the script to have access to the MMIO registers mapped to physical memory.

Link to GitHub repository: https://github.com/horshack-dpreview/setPL

Sample output:
Code:
$ sudo ./setPL.sh 25 30
[sudo] password for user:
**** Current PL values from 'turbostat'
cpu0: MSR_PKG_POWER_LIMIT: 0x5c0280001e8640 (UNlocked)
cpu0: PKG Limit #1: ENabled (200.000000 Watts, 32.000000 sec, clamp DISabled)
cpu0: PKG Limit #2: DISabled (80.000000 Watts, 20.000000* sec, clamp DISabled
**** Setting PL1=25000000 and PL2=30000000 in /sys/class/powercap/intel-rapl/intel-rapl:0/constraint_*_power_limit_uw
**** Enabling PL1 and PL2 in MSR_PKG_POWER_LIMIT
**** New PL values from 'turbostat'
cpu0: MSR_PKG_POWER_LIMIT: 0x5c80f0001e80c8 (UNlocked)
cpu0: PKG Limit #1: ENabled (25.000000 Watts, 32.000000 sec, clamp DISabled)
cpu0: PKG Limit #2: ENabled (30.000000 Watts, 20.000000* sec, clamp DISabled)
**** MCHBAR is 0xfedc0001
**** Current value of PACKAGE_RAPL_LIMIT_0_0_0_MCHBAR_PCU = 0x00438280:0x001f8118
**** Setting PACKAGE_RAPL_LIMIT_0_0_0_MCHBAR_PCU = 0x80000000:0x00000000