Overclocking CPU power limit

Published: 2018-11-06, Updated: 2023-03-30

Related Links

Necessary softwares

$ sudo apt install -y linux-tools-common linux-tools-generic msr-tools devmem2
$ modprobe msr

Run all commands below in a root terminal sudo su

Recuperar registrador msr

xxd -p -s+1552 -l7 /dev/cpu/0/msr | dd conv=swab 2> /dev/null | rev

Olhar os limites atuais

$ turbostat
cpu0: MSR_RAPL_POWER_UNIT: 0x000a0e03 (0.125000 Watts, 0.000061 Joules, 0.000977 sec.)
cpu0: MSR_PKG_POWER_INFO: 0x00000208 (65 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
cpu0: MSR_PKG_POWER_LIMIT: 0x42028a00148208 (UNlocked)
cpu0: PKG Limit #1: ENabled (65.000000 Watts, 1.000000 sec, clamp DISabled)
cpu0: PKG Limit #2: DISabled (81.250000 Watts, 0.002441* sec, clamp DISabled)
cpu0: MSR_DRAM_POWER_LIMIT: 0x00000000 (UNlocked)

Descobrindo o endereco do seu registrador

Exemplo:

MSR_PKG_POWER_LIMIT Platform Power Limit #1

rdmsr -f 14:0 0x610

MSR_PKG_POWER_LIMIT Platform Power Limit #2 (Limite de energia no modo turbo boost

rdmsr -f 46:32 0x610

Softwares necessários

Turbostat (Para pegar informacoes dos registradores, MSR, recuperar os watts que estao sendo usados agora, ghz, etc)
msr
devmem2

Monitoring clock and watts used

while [ true ]; do WATTS=$(sudo turbostat -n 1 -s PkgWatt 2>/dev/null | tail -n1); clear; echo $WATTS; cat /proc/cpuinfo | grep "MHz"; sleep 1; done

Monitoring temperature sensors

$ sudo apt install -y lm-sensors
$ while [ true ]; do sensors; sleep 1; clear; done

ou

sudo cpupower frequency-info

Lendo o pedaco de um registrador

sudo rdmsr -f 46:32 0x610

Escrevendo no registrador / Mudando o limite de consumo de energia

sudo wrmsr 0x610 0x42837000148208


- Sendo que os ultimos 3 digitos sao os watts que o seu processador pode usar em outra unidade de medida
- Para converter isso para decimal

last 3 digits hex (208) in dec = 520
this 520 * 0.125 = 65 = 65 W

So I changed it to 00DD8370

hex 370 = dec 880
880 * 0.125 = 110 W

Mudanças simples

Mudar profile no OS para performance

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors 
performance powersave

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
powersave

$ echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance

PERGUNTAS DE COMO ALTERAR O TDP SEM RESPOSTA


Particionamento / Partitioning No Postgres Resident Evil 4 HD Commands

Comments