Coder Social home page Coder Social logo

kevinlekiller / amdctl Goto Github PK

View Code? Open in Web Editor NEW
236.0 12.0 21.0 328 KB

Set P-State voltages and clock speeds on recent AMD CPUs on Linux.

License: GNU General Public License v3.0

C 99.20% Makefile 0.31% CMake 0.49%
linux gplv3 overclock undervolt c

amdctl's Introduction

amdctl

Set P-State voltages and clock speeds on recent AMD CPUs on Linux.

Disclaimer:

This software can damage your hardware, use at your own risk.

Description:

Tool for changing voltages and clock speeds for AMD processors with control over every power state and CPU core.

Compilation:

You can compile with the program make.

Usage:

Make the binary executable chmod +x amdctl.
Run the program for a list of options, you can type ./amdctl to run it.
./amdctl -x to get a description of the various words used in the program.

Undervolting:

Undervolting is done by increasing the value of the CpuVid field for a specific P-state.
This can be done by invoking 'sudo /path/to/amdctl -pP -vV' in console, where P is the P-state of which the CpuVid you want to change and V is the value you want the CpuVid field to have.
For example, 'sudo /path/to/amdctl -p1 -v25' will change the value of the CpuVid field of P-state #1 to 25.
This applies the undervolt to all cores. You can specify a core by using the -c flag.

Supported CPU Families:

AMD CPU family's 10h(K10), 11h(Turion), 12h(Fusion), 14h (Bobcat), 15h(Bulldozer), 16h(Jaguar), 17h(Zen, Zen+, Zen 2), 19h(Zen 3).
This would be most AMD CPU's between 2007 and 2021.

You can find your CPU family by typing cat /proc/cpuinfo in a terminal, the values there are in decimal.
10h is equivalent to 16, 16h 22 for example. See https://en.wikipedia.org/wiki/List_of_AMD_CPU_microarchitectures for a table with all AMD CPU families.

The program will check if your CPU is supported when run.

Unsupported CPU Families:

AMD CPU family 9h(K9) and earlier.
AMD 13h, I could not find any info on this, so I assume this CPU family does not exist.
AMD 18h(EPYC / Hygon Dhyana), no public documentation available ?
Anything newer than 19h (for now).

Requirements:

  • Root access.
  • Msr kernel module.

To manually load the msr module: sudo modprobe msr
To automatically load the msr module see the arch wiki.

On Kernel's 5.9 and higher, userspace writes to MSR are restricted, for now (in the future this may become impossible) you can allow writing to MSR from userspace using one of the following methods:

  • Using amdctl: Pass the -m option: sudo ./amdctl -m -g
  • After the kernel is loaded (runtime): sudo bash -c "echo on > /sys/module/msr/parameters/allow_writes"
  • When loading the kernel: Add msr.allow_writes=on to kernel parameters : https://wiki.archlinux.org/title/kernel_parameters

References:

https://developer.amd.com/resources/developer-guides-manuals/ https://wiki.archlinux.org/index.php/K10ctl http://sourceforge.net/projects/k10ctl/ https://web.archive.org/web/20090914081440/http://www.ztex.de/misc/k10ctl.e.html https://01.org/msr-tools https://en.wikipedia.org/wiki/List_of_AMD_CPU_microarchitectures http://users.atw.hu/instlatx64/

amdctl's People

Contributors

echaskaris avatar ermo avatar kevinlekiller avatar nightfeather avatar numas13 avatar programmingzor avatar sidorsett avatar theonlynexus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amdctl's Issues

stalls on large core counts

Once it gets to core 110+ it randomly stalls and never returns. Triggering a kernel warning that a CPU is deadlocked.

Sometimes it does return but it takes 60seconds +

Question: hardware used for testing

Hello, I recently saw your tool and tried it in an AMD Ryzen 7 1800x CPU. For now, I have the same issue as issue #18, which is that I can not change the voltage of the processor, even though the values in MSR do change. What I want, if possible, is to tell me the hardware, motherboard and processor you used for testing this tool, out of curiosity, haha. I already saw your code, and it seems that it follows the specifications on the corresponded reference manuals, so the problem is somewhere else, I guess. I'm trying to figure it out.

Is pstates list correct?

I have AMD Quad Core A12-9720P

$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 101
model name	: AMD A12-9720P RADEON R7, 12 COMPUTE CORES 4C+8G
stepping	: 1
microcode	: 0x6006118
cpu MHz		: 1635.759
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 16
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb bpext ptsc mwaitx cpb hw_pstate ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 5391.99
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro acc_power [13]

processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 101
model name	: AMD A12-9720P RADEON R7, 12 COMPUTE CORES 4C+8G
stepping	: 1
microcode	: 0x6006118
cpu MHz		: 1588.258
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 2
apicid		: 17
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb bpext ptsc mwaitx cpb hw_pstate ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 5391.99
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro acc_power [13]

processor	: 2
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 101
model name	: AMD A12-9720P RADEON R7, 12 COMPUTE CORES 4C+8G
stepping	: 1
microcode	: 0x6006118
cpu MHz		: 1672.267
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 2
apicid		: 18
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb bpext ptsc mwaitx cpb hw_pstate ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 5391.99
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro acc_power [13]

processor	: 3
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 101
model name	: AMD A12-9720P RADEON R7, 12 COMPUTE CORES 4C+8G
stepping	: 1
microcode	: 0x6006118
cpu MHz		: 1659.357
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 3
cpu cores	: 2
apicid		: 19
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good acc_power nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb bpext ptsc mwaitx cpb hw_pstate ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 xsaveopt arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov
bugs		: fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 5391.99
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro acc_power [13]

Minimal supported frequence is 1400000. Max turbo core is 3600000.

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies 
2700000 2300000 1800000 1400000

But amdctl says that lowest state is 5. But 5 is

 sudo amdctl -g -c0
[sudo] пароль для alsoijw: 
Voltage ID encodings: SVI (serial)
Detected CPU model 65h, from family 15h with 4 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 4
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     20      0     28  18.00x 3600MHz  1200mV    145     10  14.50A   17.40W
      1      1     16      0     54  16.00x 3200MHz   875mV    107     10  10.70A    9.36W
      2      1     13      0     70  14.50x 2900MHz   675mV     87     10   8.70A    5.87W
      3      1     11      0     78  13.50x 2700MHz   575mV     77     10   7.70A    4.43W
      4      1      7      0     96  11.50x 2300MHz   350mV     58     10   5.80A    2.03W
      5      1     20      1    110   9.00x 1800MHz   175mV     42     10   4.20A    0.73W
current      1     12      1    118   7.00x 1400MHz    75mV
Northbridge:
P-State 0: 104 (vid),   250mV, 1100MHz
P-State 1: 108 (vid),   200mV, 1000MHz
P-State 2: 108 (vid),   200mV, 1000MHz
P-State 3: 124 (vid),     0mV, 700MHz

I can manually get information about 6 state.

 sudo amdctl -g -c0 -p6
Voltage ID encodings: SVI (serial)
Detected CPU model 65h, from family 15h with 4 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      6      1     12      1    118   7.00x 1400MHz    75mV     32     10   3.20A    0.24W
current      1     20      1     70   9.00x 1800MHz   675mV
Northbridge:
P-State 0: 104 (vid),   250mV, 1100MHz
P-State 1: 108 (vid),   200mV, 1000MHz
P-State 2: 108 (vid),   200mV, 1000MHz
P-State 3: 124 (vid),     0mV, 700MHz

If I continue iterate states I will get

$  sudo amdctl -g -c0 -p7
Voltage ID encodings: SVI (serial)
Detected CPU model 65h, from family 15h with 4 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 4
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      7      0      0      1      0   4.00x  800MHz  1550mV    202    100   2.02A    3.13W
current      1     12      1    110   7.00x 1400MHz   175mV
Northbridge:
P-State 0: 104 (vid),   250mV, 1100MHz
P-State 1: 108 (vid),   200mV, 1000MHz
P-State 2: 108 (vid),   200mV, 1000MHz
P-State 3: 124 (vid),     0mV, 700MHz

I don't know is it 7 state correct or not.

FX-8350 CPU P-state frequencies are doubled, but CPU-NB frequencies are correctly listed?

Hi There,

Loving amdctl and am using it on my old PhII and FX-8350 boxes.

I get this output when listing the states:

$ sudo ./amdctl -g -c0
Voltage ID encodings: SVI (serial)
Detected CPU model 2h, from family 15h with 8 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 4
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     26      0     10  21.00x 8400MHz  1425mV    134     10  13.40A   19.09W
      1      1     25      0     13  20.50x 8200MHz  1388mV    134     10  13.40A   18.59W
      2      1     24      0     18  20.00x 8000MHz  1325mV    119     10  11.90A   15.77W
      3      1     18      0     27  17.00x 6800MHz  1212mV     95     10   9.50A   11.52W
      4      1     12      0     35  14.00x 5600MHz  1112mV     75     10   7.50A    8.34W
      5      1      5      0     44  10.50x 4200MHz  1000mV     54     10   5.40A    5.40W
current      1      5      0     44  10.50x 4200MHz  1000mV
Northbridge:
P-State 0: 28 (vid),  1200mV, 2400MHz
P-State 1: 31 (vid),  1162mV, 2200MHz

The CPU-NB frequencies are correct, but the CPU P-state frequencies are doubled?

I took a short look at the code, but it seems that the CPU-NB and the CPU P-state frequencies require different interpretations? I'm happy to try out different approaches per your suggestions and then creating a PR once I get it working correctly FWIW.

max boost state on all cores

is there any msr combination that can force all cores to highest boost state? i could not find anything useful regarding such a modification.
running an fx9830p, 3.8ghz is max it can do and it does it only in idle on all cores, or if there is single threaded process it does 3.8ghz on core0 and drops to 3.5ghz on rest of the cores.
as you can imagine, gaming or doing any other multithreaded task all cores are max 3.5ghz
as this cpu doesn't have unlocked multiplier i don't think it could be overclocked (maybe via BUS overclock, but i'm not interested in that way) so i've focused on running it at it's rated max clocks while trying to eliminate other types of limits

How can I force my AMD Ryzen 5 3500U to stay cool?

I'm very ignorant about CPUs and their voltage, wattage, multipliers, divisors etc.
I read the doc, #10, amdctl -x, the ArchWiki, something on Wikipedia and other inline information, but I'm still very unsure, especially since wrong values might fry my chip.

At times I wish to keep my fan off, thus force my laptop cool. That's how I ran into amdctl.

AMD Ryzen 5 3500U

I have an AMD Ryzen 5 3500U, family 17h:

Voltage ID encodings: SVI (serial)
Detected CPU model 18h, from family 17h with 8 CPU cores.

Northbridge:
No P-States on AMD17H Northbridge.

My cores look like this:

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 3 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    105     10     53  21.00x 2000MHz  1219mV     21     10  31.00A   37.78W
      1      1    102     12     96  17.00x 1600MHz   950mV     17     10  27.00A   25.65W
      2      1     98     14    102  14.00x 1400MHz   912mV     14     10  24.00A   21.90W
      3      0      0      0     88   -nanx    0MHz  1000mV      0     10  10.00A   10.00W

Disabling P-States doesn't work

I tried to disable P-States 0 and 1:

$ sudo amdctl -p0 -a0
$ sudo amdctl -p1 -a0

After this, amdctl shows 0 as their Status for every core.
Nevertheless, my cores are still able to enter those P-States when they're under load (amdctl will still show "Current P-State: 1") and the cpu MHz displayed in /proc/cpuinfo can still close 3700.

Undervolting and some questions

Should I increase CpuVid in order to undervolt my P-States?
Which P-States? And any hint on what kind of values I should use?

My lowest P-State is 3, but that one shows -nan CPU multiplier (and Status 0, 0 as all ids etc). Does it simply mean that I cannot tweak the lowest P-State, or is something broken?

I'm also confused about a few things related to frequency...
According to the specs, my CPU's base frequency is 2.1GHz and the Max Boost Clock is up to 3.7GHz. Yet /proc/cpuinfo reports a cpu MHz close to 1200 when the load is minimal. Shouldn't the minimum be 2100?
The P-States displayed by amdctl show a clock speed of 2GHz, 1.6GHz and 1.4GHz. What does it mean? Is that the minimum core frequency while the core is in the given P-State, or what else?

When and how should one tweak the other settings (e.g. CPU voltage id and divisor id)? Is it better to never touch those?

I apologize in advance for the many questions!
If anybody has any links that explains how all of this works, I'm looking forward to giving them a read.

Thanks for this useful piece of open source software!

Add support for Ryzen 6000 series of CPUs

Any idea when this will be supported? I'm fairly well versed with C, though I have not worked on anything so low level before. If someone can point me in the right direction on how to get started, I could add the support myself. I really want to be able to undervolt my new laptop to get more battery life out of it.

Cannot change CPU core voltage using amdctl

Hi all,

Recently, I have been testing this tool in my AMD Ryzen 5 PRO 2400G.
While I managed to change the frequency to overclock my CPU, I haven't been able to modify the CPU core voltage. For my experiments, I first disabled all pstates except for p0 and then I tried to change the VID corresponding to p0 to different values. Yet, using zenmonitor to measure the current CPU core voltage, I observed that these values were ignored by the CPU (they were completely different to the ones I saw in zenmonitor).

Do you have any idea why this tool cannot change the CPU core voltage in my machine?

cat /proc/cpuinfo 
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 23
model		: 17
model name	: AMD Ryzen 5 PRO 2400G with Radeon Vega Graphics
stepping	: 0
microcode	: 0x8101016
cpu MHz		: 3398.293
cache size	: 512 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate sme ssbd sev ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
bugs		: sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips	: 7186.16
TLB size	: 2560 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 43 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate eff_freq_ro [13] [14]
sudo ./amdctl -c 0
Voltage ID encodings: SVI (serial)
Detected CPU model 11h, from family 17h with 8 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 3 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    137      8      1  34.25x 3400MHz  1544mV     36     10  46.00A   71.01W
      1      disabled
      2      disabled
      3      disabled
Northbridge:
No P-States on AMD17H Northbridge.
cpupower frequency-info
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 1.60 GHz - 3.60 GHz
  available frequency steps:  3.60 GHz, 2.30 GHz, 1.60 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 3.60 GHz and 3.60 GHz.
                  The governor "userspace" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.37 GHz (asserted by call to kernel)
  boost state support:
    Supported: no
    Active: no

voltage1

I run "cpuid" and got the following extra info regarding the advanced power management features.
Would it be possible that the tool doesn't work because the frequency ID (FID) control and the voltage ID (VID) control are set to "false"?

 Advanced Power Management Features (0x80000007/edx):
     temperature sensing diode = true
     frequency ID (FID) control = false
     voltage ID (VID) control = false
     thermal trip (TTP) = true
     thermal monitor (TM) = true
     software thermal control (STC) = false
     100 MHz multiplier control = false
     hardware P-State control = true
     TscInvariant = true

`-n` option

Hi,

I would like to create a pull request for setting NBP0/NBP1 VID on 14h family, but I don't quite understand what the current -n options is intended to do.

  • In parseOpts, it is accepted only for families 10h and 11h.
  • NB_VID_BITS are defined for 15h and 16h families.
  • But printNbStates neither uses those registers for 10h/11h nor 15h/16h to read and display NB VIDs.

Is option -n is in use or is just a historical artifact?

I use amdctl in the following way to set VID for P states:

  • amdctl -p0 -vX
  • amdctl -p1 -vY

and would think of a similar syntax for NBP0 states:

  • amdctl -n0 -vX
  • amdctl -n1 -vY

Do you have any proposal on command options to use so that to define VIDs for NBP0 and NBP1 states?

Cheers!

Feature Request: Expose and control turbo states on 1st gen Ryzen CPUs?

Hi,

I'm tweaking an older ASRock AB350M based system with with a Ryzen R7 1700 CPU.

The output of amdctl shows the following:

$ sudo modprobe msr
$ sudo bin/amdctl -m -g -c0
Detected CPU model 1h, from family 17h with 16 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

Core 0 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    120      8     58   30.00x  3000.00MHz  1187mV     30     10  40.00A   47.48W
      1      1    135     10     80   27.00x  2700.00MHz  1050mV     27     10  37.00A   38.85W
      2      1    124     16    108   15.50x  1550.00MHz   875mV     15     10  25.00A   21.88W

However, the all-core frequency when I do an Prime95 mprime torture test on all 8c/16t is 3200 MHz and the single-core frequency is 3750MHz when I do the same mprime torture run on a single thread w/no hyperthreading.

Is it possible to access (and tweak) these "hidden" states somehow? And if so, how?

The goal here is to be able to up the all-core "turbo boost" frequency to 3600 MHz (as I know from experiments that the CPU can do it no problem at the listed stock 1.1875V voltage from the above table), but without losing the ability to boost a single core to 3750MHz.

Bonus points for being able to tweak the single core boost to a slightly higher value ofc (let's say 3800 MHz for the sake of argument).

Any thoughts on how one might achieve this in the context of amdctl?

Help with choosing VID hex value

Hello,

Do you have any documentation on how to correctly choose the VID value? (The CpuVid value for the -v flag)

I am trying to apply a "+4 positive offset" as described on this page, except with amdctl instead of the AMD Curve Optimizer in BIOS (inaccessible for me).

My understanding is that this means adding +12 to +20 mV to the CPU voltage supply for all P-states, at all frequencies. I found a table with voltage values for some VID values here, but I don't know how these values were derived.

Any guidance would be greatly appreciated!

For reference, my current values (output from zenstates -l) are listed below. My understanding is that I want all of the "vCore" (CpuVolt) values to increase by 12-20 mV.

P0 - Enabled - FID = 5A - DID = A - VID = 35 - Ratio = 18.00 - vCore = 1.21875
P1 - Enabled - FID = 66 - DID = C - VID = 60 - Ratio = 17.00 - vCore = 0.95000
P2 - Enabled - FID = 62 - DID = E - VID = 66 - Ratio = 14.00 - vCore = 0.91250
P3 - Disabled
P4 - Disabled
P5 - Disabled
P6 - Disabled
P7 - Disabled
C6 State - Package - Enabled
C6 State - Core - Enabled

Problem setting voltage "Could not write new value to CPU!"

Hello,
I might be missing something here (I am far from being an expert), but I tried to undervolt my processor and could not make it.
I am using a laptop with a 4700U (family 17h) with Linux Mint, I tried to execute the command sudo ./amdctl -p0 -v104 and I got the following response:

mint@mint:~/amdctl$ sudo ./amdctl -p 0 -v 104
Voltage ID encodings: SVI (serial)
Detected CPU model 60h, from family 17h with 8 CPU cores.
PREVIEW MODE OFF - P-STATES WILL BE CHANGED!

Core 0 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
ERROR: Could not write new value to CPU!

Does anyone know what I am missing ?
Thank you !

Ryzen 5900X volatage and freq control

sudo modprobe msr
sudo bash -c "echo on > /sys/module/msr/parameters/allow_writes"
sudo ./amdctl -p1 -a0
sudo ./amdctl -p2 -a0
sudo ./amdctl -p0 -v 56 -f 176

Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 176 8 56 44.00x 4400.00MHz 1200mV 34 10 44.00A 52.80W
1 0 140 10 88 28.00x 2800.00MHz 1000mV 28 10 38.00A 38.00W
2 0 132 12 104 22.00x 2200.00MHz 900mV 22 10 32.00A 28.80W

Ryzen monitor show all cores running at 3507 Mhz

am i doing something wrong or program?
╭─────────┬────────────┬──────────┬─────────┬──────────┬─────────────┬─────────────┬─────────────╮
│ Core 0 │ 3507 MHz | 4.747 W | 1.040 V | 50.93 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 1 │ 3507 MHz | 4.793 W | 1.040 V | 52.99 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 2 │ 3507 MHz | 4.788 W | 1.040 V | 52.81 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 3 │ 3507 MHz | 4.843 W | 1.040 V | 55.29 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 4 │ 3507 MHz | 4.793 W | 1.040 V | 53.33 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 5 │ 3507 MHz | 4.857 W | 1.040 V | 55.85 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 6 │ 3507 MHz | 4.799 W | 1.040 V | 52.90 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 7 │ 3507 MHz | 4.838 W | 1.040 V | 55.26 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 8 │ 3507 MHz | 4.458 W | 1.040 V | 52.52 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 9 │ 3507 MHz | 4.417 W | 1.040 V | 50.86 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 10 │ 3507 MHz | 4.484 W | 1.040 V | 54.84 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 11 │ 3507 MHz | 4.454 W | 1.040 V | 53.00 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 12 │ 3507 MHz | 4.502 W | 1.040 V | 55.46 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 13 │ 3507 MHz | 4.471 W | 1.040 V | 53.72 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 14 │ 3507 MHz | 4.490 W | 1.040 V | 55.08 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
│ Core 15 │ 3507 MHz | 4.460 W | 1.040 V | 53.45 C | C0: 100.0 % | C1: 0.0 % | C6: 0.0 % │
╰─────────┴────────────┴──────────┴─────────┴──────────┴─────────────┴─────────────┴─────────────╯


Modify NB voltage AMD fam12h

Hello.

It's a great project. Are you planning to implement a function to modify the Llano APU's NB voltages? In FusionTweaker I can do this, but unfortunately in Linux there is no tool to do that, I'm also using TurionPowerControl at the same time, but the project seems like dead. If you have any idea or some code to test, than I have a desktop and mobile with the 1st gen AMD APU.

Thanks

kernel version check ought be performed at runtime

Hey there, good stuff here with amdctl. I'd like to make some changes, and figured I'd run them by you before starting in on them:

  • checking the kernel version at build time doesn't make much sense to me
  • checking it at runtime makes a lot more sense
  • checking it at runtime if we have an actual failure makes more sense still
  • so far as i can tell, the tool generally needs be run as root; it could just set allow_writes itself
    • we can hide this behind a CLI option, or alternatively prohibit it via a CLI option

what do you think? if you agree, i can hack this up today.

amdctl.service boot issues

Having been in the same spot as priand1 (Love the work) and not being able to find the way to load it on boot, followed what he's put, but sadly, my system sat there and looked at me. Didn't want to load on boot, at all

So i took a look into it. There was actually a few little errors that needed tidying up, but I was able to successfully confirm it worked upon next boot.

I can always host the files on my server if you want, with the changes in them

Now to wait till i get the battery for this laptop (it's on order), so i can prime95 it into oblivion, hahaha.

Setting DID is Broken (only allows values between 0 and 5

sudo amdctl -t -d7

ERROR: Option -d must be a number 0 to 5

sudo amdctl -t -d5

(output abridged to just show one core, but they're all the same):

Core 23 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    152      5     70  60.80x 6080MHz  1112mV     37     10  47.00A   52.29W
      1      1    140      5     88  56.00x 5600MHz  1000mV     28     10  38.00A   38.00W
      2      1    132      5    104  52.80x 5280MHz   900mV     22     10  32.00A   28.80W

Obviously this is broken. Setting any available DID without also changing VID and FID would cause a hard crash or even damage to the CPU.

CPU: Ryzen 9 5900X
Kernel: 5.14.17
Distro: Arch

AMD Kabini doesn't pass /proc/cpuinfo sanity check

Starting amdctl on an AMD 5350 fails, even before showing usage, as the check at the end of gathering info from /proc/cpuinfo enumerates as false, as this CPU indeed has a model number of zero(well, at least mine does).

to verify, I commented it's line 359-361 out and it shows somewhat okay info in the pstates dump.

A8-4500M northbridge voltage set

I am unable to set the northbridge voltage ERROR: Currently amdctl can only change the NB vid on 10h and 11h CPU's. although I can read it

Version numbers

Hello Kevin,

I just recently updated the amdctl-git package in the AUR repository.
Are you planning to assign any kind of version number to the releases?
The final package is still called amdctl-git-unknown-1 :)

Best regards

Ryzen 2500U CpuFID is higher than limited, inaccurate frequency calculation

Hello @kevinlekiller,
this time I'm writing you because of a Ryzen mobile APU. Please look at the default values are used for P0, modifying the fid value to something high at the line 125 is enough. However this time I couln't find the BKDG document for fam17h. It would be hard to guess the value. I have some desktop 1st and 2nd gen Ryzens at home, I can check those too.
`# amdctl -g -c 1
Voltage ID encodings: SVI (serial)
Detected CPU model 11h, from family 17h with 8 CPU cores.

Core 1 | P-State Limits (non-turbo): Highest: 1 ; Lowest 3 | Current P-State: 3
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 100 10 53 20.00x 2000MHz 1219mV 20 10 30.00A 36.56W
1 1 102 12 96 17.00x 1600MHz 950mV 17 10 27.00A 25.65W
2 1 50 12 120 8.33x 800MHz 800mV 16 10 26.00A 20.80W
3 0 0 0 88 -nanx 0MHz 1000mV 0 10 10.00A 10.00W
Northbridge:
No P-States on AMD17H Northbridge.`

Apart from that the minimum freq is around 750MHz with this settings.
Do you have any ideas what should we do?

Best regards

AMD Cesanne 5800H voltage control

Hi! After some time of investigating problems, I found a way to coltrol frequency.
So changing boost by echo command not working, so I use Tuxedo control centre to do that and also for fan settings.
Don't know is it a program limitation, but I can't set CPUFid more than 127, so currently I change power states by:

**amdctl -p 0 -v 60 -d 4 -f 74

Detected CPU model 50h, from family 19h with 16 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).
Preview mode OFF.

Core 0 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     74      4     60   37.00x  3700.00MHz  1175mV     32     10  42.00A   49.35W**

sysbench report that performance was changed compared to default 3200MHz max w/o boost, so values was accepted.
ryzen_monitor report

 CPU Model │         AMD Ryzen 7 5800H with Radeon Graphics │
│                           Processor Code Name │                                        Cezanne │
│                                         Cores │                                              8 │
│                                     Core CCDs │                                              0 │
│                                 Cores Per CCD │                                              8 │
│                                SMU FW Version │                                       v64.45.0 │
│                                MP1 IF Version │                                            v12 │

This program also report 3.7 GHz, but changing CpuVid has no effect at all, program always report Voltage from Core VRM 1.22-1.24V and power consumption 35-36W. I always tried set it to 4.0GHz at 0.8V, so it really don't change voltage for CPU.
So is it my settings incorrect, or there are other ways to change voltage on power states?

Make fails - undefined reference to 'pow'

$ make
gcc -Wall -pedantic -Wextra -std=c99 -O2 -lm amdctl.c -o amdctl
/usr/bin/ld: /tmp/ccAmmJxI.o: in function `northBridge':
amdctl.c:(.text+0x10ce): undefined reference to `pow'
collect2: error: ld returned 1 exit status
make: *** [: amdctl] Error 1

Ubuntu 19.04
gcc 4:8.3.0-1ubuntu3

Report AGESA version

There is a shortage of Linux tools that could report AMD's AGESA (AMD Generic Encapsulated Software Architecture) version. Windows-based HWiNFO and AIDA64 reportedly have the ability, but I couldn't find any Linux-based solution.

How to use it?

There is some manual? I want reduce voltage on cpu. As I understand I have to do stress test. How can I check some pstate? When I run stress --cpu 8 I can see like that

Voltage ID encodings: SVI (serial)
Detected CPU model 65h, from family 15h with 4 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     20      0     28  18.00x 3600MHz  1200mV    145     10  14.50A   17.40W
      1      1     16      0     54  16.00x 3200MHz   875mV    107     10  10.70A    9.36W
      2      1     13      0     70  14.50x 2900MHz   675mV     87     10   8.70A    5.87W
      3      1     11      0     78  13.50x 2700MHz   575mV     77     10   7.70A    4.43W
      4      1      7      0     96  11.50x 2300MHz   350mV     58     10   5.80A    2.03W
      5      1     20      1    110   9.00x 1800MHz   175mV     42     10   4.20A    0.73W
current      1     11      0     85  13.50x 2700MHz   488mV

What state I have to edit? How to switch to another state?

Help on family 14H

Hi @kevinlekiller,

I have a HP T610 Plus thin client device which has a AMD G-T56N processor on board. It is a 14H family and it is not supported by your amdctl software. However I was able to make some changes in amdctl.c file, so at least the amdctl -g will show me some generic output of what I have inside of my processor.
At first I took a look at the https://www.amd.com/system/files/TechDocs/43170_14h_Mod_00h-0Fh_BKDG.pdf documentation and according to this, I have added some bit definitions in your checkFamily() method:

    case AMD14H:
        printf("AMD14H not fully supported. Test mode will be automatically enabled!");
        testMode = 1;
        CPU_VID_BITS = "15:9";
        CPU_DID_BITS = "8:0";
        // there is no FID on AMD14H, let's read it from DID for now
        CPU_FID_BITS = "8:0";
        break;

It looks like there is no FID bits in 14H (or it was moved or replaced by something else), so I faked them to be the same as DID bits. Moreover I have noticed that the data stored in a DID bits are in a different format (as for example in 15H family): they contain a decimal and fraction parts, so the calculations of the divider are a bit complex.
But for now I just wanted to have some output from amdctl -g, which is as below:

witek@sirius:~/dev/sources/cpp/amdctl$ sudo /home/witek/dev/sources/cpp/amdctl/amdctl -g
DEBUG: Checking CPU info.
DEBUG: Setting variables based on CPU model.
AMD14H not fully supported. Test mode will be automatically enabled!
Voltage ID encodings: SVI (serial)
Detected CPU model 2h, from family 14h with 2 CPU cores.
DEBUG: Getting data from CPU 0 at register c0010061
DEBUG: Getting data from CPU 0 at register c0010063

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 3 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
DEBUG: Getting data from CPU 0 at register c0010064
      0      1     16     16     16   0.00x    0MHz  1350mV     45     10   4.50A    6.08W
DEBUG: Getting data from CPU 0 at register c0010065
      1      1     18     18     27   0.00x    0MHz  1212mV     30     10   3.00A    3.64W
DEBUG: Getting data from CPU 0 at register c0010066
      2      1     48     48     47   0.00x    0MHz   962mV    151    100   1.51A    1.45W
DEBUG: Getting data from CPU 0 at register c0010067
      3      0      0      0      0   0.00x    0MHz  1550mV      0      1   0.00A    0.00W
currentDEBUG: Getting data from CPU 0 at register c0010071
      1     48     48     16   0.00x    0MHz  1350mV
DEBUG: Getting data from CPU 1 at register c0010061
DEBUG: Getting data from CPU 1 at register c0010063

Core 1 | P-State Limits (non-turbo): Highest: 1 ; Lowest 3 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
DEBUG: Getting data from CPU 1 at register c0010064
      0      1     16     16     16   0.00x    0MHz  1350mV     45     10   4.50A    6.08W
DEBUG: Getting data from CPU 1 at register c0010065
      1      1     18     18     27   0.00x    0MHz  1212mV     30     10   3.00A    3.64W
DEBUG: Getting data from CPU 1 at register c0010066
      2      1     48     48     47   0.00x    0MHz   962mV    151    100   1.51A    1.45W
DEBUG: Getting data from CPU 1 at register c0010067
      3      0      0      0      0   0.00x    0MHz  1550mV      0      1   0.00A    0.00W
currentDEBUG: Getting data from CPU 1 at register c0010071
      1     16     16     16   0.00x    0MHz  1350mV
Northbridge:

The data may be not correcty calculated, like for example the clock divider or the cpu frequency. It looks like there is something wrong in my case in the number of currently P-State.
Consider this:

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 3 | Current P-State: 3
Core 1 | P-State Limits (non-turbo): Highest: 1 ; Lowest 3 | Current P-State: 1

it says that cores are in a different current P-States, however this:

currentDEBUG: Getting data from CPU 0 at register c0010071
      1     48     48     16   0.00x    0MHz  1350mV
currentDEBUG: Getting data from CPU 1 at register c0010071
      1     16     16     16   0.00x    0MHz  1350mV

may indicate (by the 1350mV voltage) that both cores are in the first P-State, so each core should consume more than 6W. This seems to be correct because my power/energy meter shows that the computer consumes around 14W.

@kevinlekiller, before I continue with my research I have a question: if I totaly disable one core of the CPU, will the total consumed power drop about 6W? Then instead of 14W of consumption, my computer will draw around 8W?

Second thing: I have also used a cpupower utility to control the frequency of CPU but it looks like it doesn't control the power states as my computer was still at 14W no matter what I have chosen.
Third thing: I have also put one core into an offline state by executing as root:
echo 0 > /sys/devices/system/cpu/cpu1/online
but that not really helped if it goes about power consumption: it still draw 14W, however the htop command line utility showed me only one active CPU core available.

@kevinlekiller, could you please help me a bit, to understand?

does amdctl supports EPYC processor?

I'm wondering how to give more power on EPYC processor

because most of EPYC processor has limited power on single core performance due to TDP hard-limit

some of EPYC processor has high limit of TDP (with cTDP) but most of are not (especially cheap ones)

I know that this program can't bypass chip's TDP
but can adjust voltage on certain P-State

is this program supports amd EPYC? (7001 to 7003)

also i want to know that microcode and bios version(mostly with AGESA updates) of epyc motherboard can affect this program

sorry for my bad english

A way to reset the CPU to default settings

A way to restore default CPU frequency, voltage, etc. would be a really useful feature. I accidentally forgot to back up the defaults and now my notebook's power usage looks like this...
my_pc_is_about_to_explode

EDIT: I was able to reset my CPU frequency/voltage by unplugging my notebook and rebooting it. Rebooting while connected to power didn't work.

Setting P-State Frequency Has No Effect, According to All CPU Frequency Monitoring Tools

Checking with nmon, zenmonitor, and cat /proc/cpuinfo | grep -i mhz all reports the frequency being the stock P-State frequency.

sudo amdctl -g -c23

Voltage ID encodings: SVI (serial)
Detected CPU model 21h, from family 19h with 24 CPU cores.

Core 23 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    152      8     70  38.00x 3800MHz  1112mV     37     10  47.00A   52.29W
      1      1    140     10     88  28.00x 2800MHz  1000mV     28     10  38.00A   38.00W
      2      1    132     12    104  22.00x 2200MHz   900mV     22     10  32.00A   28.80W
Northbridge:
No P-States on Zen Northbridge.

As you can see I've set P-State 0 to 3800MHz and 1112 mV. Stock for the 5900X is 3700 and 1100, respectively.

However, the P-State is clearly not at 3800MHz:

nmon:
Screenshot_20211115_200437

zenmonitor even seems to think it's 3.5GHz:

Screenshot_20211115_200632

cat /proc/cpuinfo | grep MHz

cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 4010.737
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000
cpu MHz         : 3700.000

I haven't been able to find a tool that reports 3.8GHz, other than cpupower, and amdctl itself.

Another (maybe) weird thing is that amdctl -g shows:

Core 23 | P-State Limits (non-turbo)

for every core, even though all forms of "boost"/"turbo" are enabled (CPB, PBO, etc.) and cpupower shows "Boost" is active.

5900X, Linux 5.14.17

Cannot set CpuVid to Original Value

19H Family, Ryzen 9 7945H

Original CpuVid Value was 191, but amdctl does not allow for values above 191. How can I restore to the original value of 191?

Stoney Ridge inaccurate voltage readings

Hello Kevin!

You can see the following output from a Chromebook processor based machine. It's an ULV 6W APU with extra long battery time. I assume the voltages for each P-State might be very low.

`Voltage ID encodings: SVI (serial)
Detected CPU model 70h, from family 15h with 2 CPU cores.
DEBUG: Getting data from CPU 0 at register c0010061
DEBUG: Getting data from CPU 0 at register c0010063

Core 0 | P-State Limits (non-turbo): Highest: 4 ; Lowest 4 | Current P-State: 4
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0DEBUG: Getting data from CPU 0 at register c0010064
1 8 0 88 12.00x 2400MHz 450mV 63 10 6.30A 2.84W
1DEBUG: Getting data from CPU 0 at register c0010065
1 6 0 94 11.00x 2200MHz 375mV 55 10 5.50A 2.06W
2DEBUG: Getting data from CPU 0 at register c0010066
1 4 0 104 10.00x 2000MHz 250mV 47 10 4.70A 1.17W
3DEBUG: Getting data from CPU 0 at register c0010067
1 20 1 110 9.00x 1800MHz 175mV 40 10 4.00A 0.70W
4DEBUG: Getting data from CPU 0 at register c0010068
1 16 1 118 8.00x 1600MHz 75mV 35 10 3.50A 0.26W
currentDEBUG: Getting data from CPU 0 at register c0010071
1 0 1 6 4.00x 800MHz 1475mV
DEBUG: Getting data from CPU 1 at register c0010061
DEBUG: Getting data from CPU 1 at register c0010063

Core 1 | P-State Limits (non-turbo): Highest: 4 ; Lowest 4 | Current P-State: 4
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0DEBUG: Getting data from CPU 1 at register c0010064
1 8 0 88 12.00x 2400MHz 450mV 63 10 6.30A 2.84W
1DEBUG: Getting data from CPU 1 at register c0010065
1 6 0 94 11.00x 2200MHz 375mV 55 10 5.50A 2.06W
2DEBUG: Getting data from CPU 1 at register c0010066
1 4 0 104 10.00x 2000MHz 250mV 47 10 4.70A 1.17W
3DEBUG: Getting data from CPU 1 at register c0010067
1 20 1 110 9.00x 1800MHz 175mV 40 10 4.00A 0.70W
4DEBUG: Getting data from CPU 1 at register c0010068
1 16 1 118 8.00x 1600MHz 75mV 35 10 3.50A 0.26W
currentDEBUG: Getting data from CPU 1 at register c0010071
1 0 1 6 4.00x 800MHz 1475mV
Northbridge:
`

Clarifications of the Disclaimer

I'd like to use this tool but the disclaimer scares me:

This software can damage your hardware, use at your own risk.

Is it to cover the author's back just in case, or is it a real risk?
Was any hardware damaged by this tool?
Are there any specific settings or any specific pieces of hardware that are known to be potentially damaging/vulnerable?

I have an AMD Ryzen 5 3500U CPU on my laptop. Anything I should be aware of with my CPU?

Can't set fid higher than 47?

Currently for pstate 0 my fid is 136, but when I manually set it I can't even set it above 47!
I am using a Ryzen 5 1600.

[Richland Kaveri] IddVal returns false value for highest P-state

Hello Kevin,

I just found this small bug, this case the calculated Wattage is inaccurate.
You'll find the values returned for Richland:

Voltage ID encodings: SVI (serial)
Detected CPU model 13h, from family 15h with 4 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     25      0     28  20.50x 4100MHz  1375mV    166     10  16.60A   22.83W
      1      1     23      0     32  19.50x 3900MHz  1350mV    191     10  19.10A   25.79W
      2      1     21      0     48  18.50x 3700MHz  1250mV    157     10  15.70A   19.62W
      3      1     19      0     58  17.50x 3500MHz  1188mV    118     10  11.80A   14.01W
      4      1     16      0     68  16.00x 3200MHz  1125mV    100     10  10.00A   11.25W
      5      1     11      0     78  13.50x 2700MHz  1062mV     79     10   7.90A    8.39W
current      1     19      0     58  17.50x 3500MHz  1188mV

Core 1 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     25      0     28  20.50x 4100MHz  1375mV    166     10  16.60A   22.83W
      1      1     23      0     32  19.50x 3900MHz  1350mV    191     10  19.10A   25.79W
      2      1     21      0     48  18.50x 3700MHz  1250mV    157     10  15.70A   19.62W
      3      1     19      0     58  17.50x 3500MHz  1188mV    118     10  11.80A   14.01W
      4      1     16      0     68  16.00x 3200MHz  1125mV    100     10  10.00A   11.25W
      5      1     11      0     78  13.50x 2700MHz  1062mV     79     10   7.90A    8.39W
current      1     19      0     58  17.50x 3500MHz  1188mV

Core 2 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     25      0     28  20.50x 4100MHz  1375mV    166     10  16.60A   22.83W
      1      1     23      0     32  19.50x 3900MHz  1350mV    191     10  19.10A   25.79W
      2      1     21      0     48  18.50x 3700MHz  1250mV    157     10  15.70A   19.62W
      3      1     19      0     58  17.50x 3500MHz  1188mV    118     10  11.80A   14.01W
      4      1     16      0     68  16.00x 3200MHz  1125mV    100     10  10.00A   11.25W
      5      1     11      0     78  13.50x 2700MHz  1062mV     79     10   7.90A    8.39W
current      1     19      0     58  17.50x 3500MHz  1188mV

Core 3 | P-State Limits (non-turbo): Highest: 1 ; Lowest 5 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     25      0     28  20.50x 4100MHz  1375mV    166     10  16.60A   22.83W
      1      1     23      0     32  19.50x 3900MHz  1350mV    191     10  19.10A   25.79W
      2      1     21      0     48  18.50x 3700MHz  1250mV    157     10  15.70A   19.62W
      3      1     19      0     58  17.50x 3500MHz  1188mV    118     10  11.80A   14.01W
      4      1     16      0     68  16.00x 3200MHz  1125mV    100     10  10.00A   11.25W
      5      1     11      0     78  13.50x 2700MHz  1062mV     79     10   7.90A    8.39W
current      1     19      0     58  17.50x 3500MHz  1188mV
Northbridge:
P-State 0: 64 (vid),  1150mV, 1600MHz
P-State 1: 66 (vid),  1138mV, 400MHz
P-State 2: 66 (vid),  1138mV, 400MHz
P-State 3: 66 (vid),  1138mV, 400MHz

and Kaveri:

Voltage ID encodings: SVI (serial)
Detected CPU model 30h, from family 15h with 4 CPU cores.

Core 0 | P-State Limits (non-turbo): Highest: 3 ; Lowest 5 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     22      0     20  19.00x 3800MHz  1425mV    130     10  13.00A   18.52W
      1      1     21      0     24  18.50x 3700MHz  1400mV    215     10  21.50A   30.10W
      2      1     17      0     44  16.50x 3300MHz  1275mV    150     10  15.00A   19.12W
      3      1     15      0     50  15.50x 3100MHz  1238mV    100     10  10.00A   12.38W
      4      1     12      0     62  14.00x 2800MHz  1162mV     87     10   8.70A   10.11W
      5      1      8      0     74  12.00x 2400MHz  1088mV     72     10   7.20A    7.83W
current      1      8      0     74  12.00x 2400MHz  1088mV

Core 1 | P-State Limits (non-turbo): Highest: 3 ; Lowest 5 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     22      0     20  19.00x 3800MHz  1425mV    130     10  13.00A   18.52W
      1      1     21      0     24  18.50x 3700MHz  1400mV    215     10  21.50A   30.10W
      2      1     17      0     44  16.50x 3300MHz  1275mV    150     10  15.00A   19.12W
      3      1     15      0     50  15.50x 3100MHz  1238mV    100     10  10.00A   12.38W
      4      1     12      0     62  14.00x 2800MHz  1162mV     87     10   8.70A   10.11W
      5      1      8      0     74  12.00x 2400MHz  1088mV     72     10   7.20A    7.83W
current      1      8      0     74  12.00x 2400MHz  1088mV

Core 2 | P-State Limits (non-turbo): Highest: 3 ; Lowest 5 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     22      0     20  19.00x 3800MHz  1425mV    130     10  13.00A   18.52W
      1      1     21      0     24  18.50x 3700MHz  1400mV    215     10  21.50A   30.10W
      2      1     17      0     44  16.50x 3300MHz  1275mV    150     10  15.00A   19.12W
      3      1     15      0     50  15.50x 3100MHz  1238mV    100     10  10.00A   12.38W
      4      1     12      0     62  14.00x 2800MHz  1162mV     87     10   8.70A   10.11W
      5      1      8      0     74  12.00x 2400MHz  1088mV     72     10   7.20A    7.83W
current      1      8      0     74  12.00x 2400MHz  1088mV

Core 3 | P-State Limits (non-turbo): Highest: 3 ; Lowest 5 | Current P-State: 3
 Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1     22      0     20  19.00x 3800MHz  1425mV    130     10  13.00A   18.52W
      1      1     21      0     24  18.50x 3700MHz  1400mV    215     10  21.50A   30.10W
      2      1     17      0     44  16.50x 3300MHz  1275mV    150     10  15.00A   19.12W
      3      1     15      0     50  15.50x 3100MHz  1238mV    100     10  10.00A   12.38W
      4      1     12      0     62  14.00x 2800MHz  1162mV     87     10   8.70A   10.11W
      5      1      8      0     74  12.00x 2400MHz  1088mV     72     10   7.20A    7.83W
current      1      8      0     74  12.00x 2400MHz  1088mV
Northbridge:
P-State 0: 66 (vid),  1138mV, 1600MHz
P-State 1: 74 (vid),  1088mV, 400MHz
P-State 2: 80 (vid),  1050mV, 400MHz
P-State 3: 96 (vid),   950mV, 400MHz

Unfortunately I couldn't figure out how to convert the "39:32" bits to hex format for reading with rdmsr.
I tried to understand the getDec function, but no success...

Best regards

AMD 10h: P-State detection is wrong

As you can see below, "Current P-State" (first line for each core) never changes. It is always 1. Current frequency (last line in table) is correct. Current voltage is probably correct too, but it doesn't match P-State table.

Highest P-State and Lowest are also wrong. In my case, highest is 0 (see it in action on core 2) and lowest is 3 (see it on core 0). P-State 4 is invalid and should not appear in table.

CPU is Phenom II X4 965. These are default parameters set by BIOS "Auto".

Detected CPU model 4h, from family 10h with 4 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 4 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbVid NbVolt
      0      1     22      0     10   19.00x  3800.00MHz  1425mV    210     10  21.00A   29.92W    36 1100mV
      1      1     11      0     18   13.50x  2700.00MHz  1325mV    151     10  15.10A   20.01W    36 1100mV
      2      1      6      0     26   11.00x  2200.00MHz  1225mV    109     10  10.90A   13.35W    36 1100mV
      3      1      0      1     40    4.00x   800.00MHz  1050mV     44     10   4.40A    4.62W    36 1100mV
      4      0      0      0      0    8.00x  1600.00MHz  1550mV      0      1   0.00A    0.00W     0 1550mV
current      1      0      1     10    4.00x   800.00MHz  1425mV                                   36 1100mV

Core 1 | P-State Limits (non-turbo): Highest: 1 ; Lowest 4 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbVid NbVolt
      0      1     18      0     10   17.00x  3400.00MHz  1425mV    210     10  21.00A   29.92W    36 1100mV
      1      1     11      0     18   13.50x  2700.00MHz  1325mV    151     10  15.10A   20.01W    36 1100mV
      2      1      6      0     26   11.00x  2200.00MHz  1225mV    109     10  10.90A   13.35W    36 1100mV
      3      1      0      1     40    4.00x   800.00MHz  1050mV     44     10   4.40A    4.62W    36 1100mV
      4      0      0      0      0    8.00x  1600.00MHz  1550mV      0      1   0.00A    0.00W     0 1550mV
current      1      0      1     10    4.00x   800.00MHz  1425mV                                   36 1100mV

Core 2 | P-State Limits (non-turbo): Highest: 1 ; Lowest 4 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbVid NbVolt
      0      1     18      0     10   17.00x  3400.00MHz  1425mV    210     10  21.00A   29.92W    36 1100mV
      1      1     11      0     18   13.50x  2700.00MHz  1325mV    151     10  15.10A   20.01W    36 1100mV
      2      1      6      0     26   11.00x  2200.00MHz  1225mV    109     10  10.90A   13.35W    36 1100mV
      3      1      0      1     40    4.00x   800.00MHz  1050mV     44     10   4.40A    4.62W    36 1100mV
      4      0      0      0      0    8.00x  1600.00MHz  1550mV      0      1   0.00A    0.00W     0 1550mV
current      1     18      0     10   17.00x  3400.00MHz  1425mV                                   36 1100mV

Core 3 | P-State Limits (non-turbo): Highest: 1 ; Lowest 4 | Current P-State: 1
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbVid NbVolt
      0      1     18      0     10   17.00x  3400.00MHz  1425mV    210     10  21.00A   29.92W    36 1100mV
      1      1     11      0     18   13.50x  2700.00MHz  1325mV    151     10  15.10A   20.01W    36 1100mV
      2      1      6      0     26   11.00x  2200.00MHz  1225mV    109     10  10.90A   13.35W    36 1100mV
      3      1      0      1     40    4.00x   800.00MHz  1050mV     44     10   4.40A    4.62W    36 1100mV
      4      0      0      0      0    8.00x  1600.00MHz  1550mV      0      1   0.00A    0.00W     0 1550mV
current      1      6      0     10   11.00x  2200.00MHz  1425mV                                   36 1100mV

Thanks.

amdctl.service?

Hi Kevin,

would you be interested in adding amdctl.service + .timer + amdclt-after-resume.service + example bash script to your package?
It is nothing big but I have written all of the above and they have been running on my system for a couple of weeks now without any problems.

Error writing to /dev/cpu/0/msr

Hi,

I wanted to undervolt the 5300G in my homelab but no matter what I try, I always get:

ERROR: Could not write data to /dev/cpu/0/msr

msr module is loaded, I tried both the -m cli option as well as the sys fs parameter. I'm using kernel 6.4.6 currently. Output of -g is:

Detected CPU model 50h, from family 19h with 8 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

Core 0 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0

Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 160 8 32 40.00x 4000.00MHz 1350mV 40 10 50.00A 67.50W
1 1 102 12 96 17.00x 1700.00MHz 950mV 17 10 27.00A 25.65W
2 1 98 14 102 14.00x 1400.00MHz 912mV 14 10 24.00A 21.89W

Core 1 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 160 8 32 40.00x 4000.00MHz 1350mV 40 10 50.00A 67.50W
1 1 102 12 96 17.00x 1700.00MHz 950mV 17 10 27.00A 25.65W
2 1 98 14 102 14.00x 1400.00MHz 912mV 14 10 24.00A 21.89W

Core 2 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 160 8 32 40.00x 4000.00MHz 1350mV 40 10 50.00A 67.50W
1 1 102 12 96 17.00x 1700.00MHz 950mV 17 10 27.00A 25.65W
2 1 98 14 102 14.00x 1400.00MHz 912mV 14 10 24.00A 21.89W

Core 3 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 160 8 32 40.00x 4000.00MHz 1350mV 40 10 50.00A 67.50W
1 1 102 12 96 17.00x 1700.00MHz 950mV 17 10 27.00A 25.65W
2 1 98 14 102 14.00x 1400.00MHz 912mV 14 10 24.00A 21.89W

Core 4 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 160 8 32 40.00x 4000.00MHz 1350mV 40 10 50.00A 67.50W
1 1 102 12 96 17.00x 1700.00MHz 950mV 17 10 27.00A 25.65W
2 1 98 14 102 14.00x 1400.00MHz 912mV 14 10 24.00A 21.89W

Core 5 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 160 8 32 40.00x 4000.00MHz 1350mV 40 10 50.00A 67.50W
1 1 102 12 96 17.00x 1700.00MHz 950mV 17 10 27.00A 25.65W
2 1 98 14 102 14.00x 1400.00MHz 912mV 14 10 24.00A 21.89W

Core 6 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 160 8 32 40.00x 4000.00MHz 1350mV 40 10 50.00A 67.50W
1 1 102 12 96 17.00x 1700.00MHz 950mV 17 10 27.00A 25.65W
2 1 98 14 102 14.00x 1400.00MHz 912mV 14 10 24.00A 21.89W

Core 7 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 160 8 32 40.00x 4000.00MHz 1350mV 40 10 50.00A 67.50W
1 1 102 12 96 17.00x 1700.00MHz 950mV 17 10 27.00A 25.65W
2 1 98 14 102 14.00x 1400.00MHz 912mV 14 10 24.00A 21.89W

cat /proc/cpuinfo:

processor : 0
vendor_id : AuthenticAMD
cpu family : 25
model : 80
model name : AMD Ryzen 3 5300G with Radeon Graphics
stepping : 0
microcode : 0xa50000c
cpu MHz : 2369.997
cache size : 512 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 16
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
bugs : sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass
bogomips : 7988.39
TLB size : 2560 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]

Any help is appreciated.

Kind Regards
Martin

Steam Deck: Pstate 0 Vid is 161, above max of 124

On the Steam Deck's custom AMD APU (model 90h, family 17h), the value of Pstate 0 is 161.

I'd like to undervolt this state! Would it be safe to raise the value of the MAX_VID macro to something a bit above 161?

Output:

(deck@steamdeck amdctl)$ sudo ./amdctl -g
Detected CPU model 90h, from family 17h with 8 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

Core 0 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    112      8    161   28.00x  2800.00MHz   543mV     28     10  38.00A   20.63W
      1      1     96      8    114   24.00x  2400.00MHz   837mV     24     10  34.00A   28.46W
      2      1    102     12    105   17.00x  1700.00MHz   893mV     17     10  27.00A   24.11W

Core 1 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    112      8    161   28.00x  2800.00MHz   543mV     28     10  38.00A   20.63W
      1      1     96      8    114   24.00x  2400.00MHz   837mV     24     10  34.00A   28.46W
      2      1    102     12    105   17.00x  1700.00MHz   893mV     17     10  27.00A   24.11W

Core 2 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    112      8    161   28.00x  2800.00MHz   543mV     28     10  38.00A   20.63W
      1      1     96      8    114   24.00x  2400.00MHz   837mV     24     10  34.00A   28.46W
      2      1    102     12    105   17.00x  1700.00MHz   893mV     17     10  27.00A   24.11W

Core 3 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    112      8    161   28.00x  2800.00MHz   543mV     28     10  38.00A   20.63W
      1      1     96      8    114   24.00x  2400.00MHz   837mV     24     10  34.00A   28.46W
      2      1    102     12    105   17.00x  1700.00MHz   893mV     17     10  27.00A   24.11W

Core 4 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    112      8    161   28.00x  2800.00MHz   543mV     28     10  38.00A   20.63W
      1      1     96      8    114   24.00x  2400.00MHz   837mV     24     10  34.00A   28.46W
      2      1    102     12    105   17.00x  1700.00MHz   893mV     17     10  27.00A   24.11W

Core 5 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    112      8    161   28.00x  2800.00MHz   543mV     28     10  38.00A   20.63W
      1      1     96      8    114   24.00x  2400.00MHz   837mV     24     10  34.00A   28.46W
      2      1    102     12    105   17.00x  1700.00MHz   893mV     17     10  27.00A   24.11W

Core 6 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    112      8    161   28.00x  2800.00MHz   543mV     28     10  38.00A   20.63W
      1      1     96      8    114   24.00x  2400.00MHz   837mV     24     10  34.00A   28.46W
      2      1    102     12    105   17.00x  1700.00MHz   893mV     17     10  27.00A   24.11W

Core 7 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 0
 Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
      0      1    112      8    161   28.00x  2800.00MHz   543mV     28     10  38.00A   20.63W
      1      1     96      8    114   24.00x  2400.00MHz   837mV     24     10  34.00A   28.46W
      2      1    102     12    105   17.00x  1700.00MHz   893mV     17     10  27.00A   24.11W

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.