kevinlekiller / amdctl

Set P-State voltages and clock speeds on recent AMD CPUs on Linux.
GNU General Public License v3.0
244 stars 22 forks source link

Fix pstate/mult/volt display, add -b/-j options, print NbStates as table #58

Open AYuusuke opened 9 months ago

AYuusuke commented 9 months ago

Before/after diff:

=================== model name  : AMD A6-3420M APU with Radeon(tm) HD Graphics
@@ -1,16 +1,19 @@
 Detected CPU model 1h, from family 12h with 4 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

-Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 7 | Current P-State: 1
- Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
-      0      1     20      1     20   24.00x  2400.00MHz  1300mV    125     10  12.50A   16.25W
-      1      1     14      2     41   15.00x  1500.00MHz  1037mV     66     10   6.60A    6.84W
-      2      1     12      2     43   14.00x  1400.00MHz  1012mV     57     10   5.70A    5.77W
-      3      1     20      3     46   12.00x  1200.00MHz   975mV     50     10   5.00A    4.88W
-      4      1     17      3     47   11.00x  1100.00MHz   962mV     45     10   4.50A    4.33W
-      5      1     14      3     48   10.00x  1000.00MHz   950mV     42     10   4.20A    3.99W
-      6      1     11      3     49    9.00x   900.00MHz   937mV     39     10   3.90A    3.65W
-      7      1      8      3     49    8.00x   800.00MHz   937mV     37     10   3.70A    3.47W
-current      1      8      3     49    8.00x   800.00MHz   937mV
-Northbridge:
-P-State 0: 45 (vid),   987mV
-P-State 1: 53 (vid),   887mV
+Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 7 | Current P-State: 7
+ Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbPst
+      0      1     20      1     20   24.00x  2400.00MHz  1300mV    125     10  12.50A   16.25W     -
+      1      1     14      2     41   15.00x  1500.00MHz  1037mV     66     10   6.60A    6.84W     -
+      2      1     12      2     43   14.00x  1400.00MHz  1012mV     57     10   5.70A    5.77W     -
+      3      1     20      3     46   12.00x  1200.00MHz   975mV     50     10   5.00A    4.88W     -
+      4      1     17      3     47   11.00x  1100.00MHz   962mV     45     10   4.50A    4.33W     -
+      5      1     14      3     48   10.00x  1000.00MHz   950mV     42     10   4.20A    3.99W     -
+      6      1     11      3     49    9.00x   900.00MHz   937mV     39     10   3.90A    3.65W     -
+      7      1      8      3     49    8.00x   800.00MHz   937mV     37     10   3.70A    3.47W     -
+current      1      8      3     49    8.00x   800.00MHz   937mV      -      -       -        -     1
+
+Northbridge: High 0 ; Low 1 ; Current 1
+ NbPstate NclkDid NbVid   NbFreq  NbVolt
+        0      24    45   666MHz   987mV
+        1      40    53   400MHz   887mV
+  current       -    53        -   887mV
=================== model name  : AMD C-60 APU with Radeon(tm) HD Graphics
@@ -1,12 +1,15 @@
 Detected CPU model 2h, from family 14h with 2 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

 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      0      2     30   -0.32x   -32.00MHz  1175mV     28     10   2.80A    3.29W
-      1      1      0      3     32   -0.24x   -24.00MHz  1150mV    185    100   1.85A    2.13W
-      2      1      0      4     35   -0.19x   -19.20MHz  1112mV    152    100   1.52A    1.69W
-      3      0      2      5     35   -0.15x   -14.77MHz  1112mV    135    100   1.35A    1.50W
-current      1      0      4     35   -0.19x   -19.20MHz  1112mV
-Northbridge:
-P-State 0: 52 (vid),   900mV
-P-State 1: 54 (vid),   875mV
+ Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbPst
+      0      1      0      2     30   13.33x  1333.33MHz  1175mV     28     10   2.80A    3.29W     -
+      1      1      0      3     32   10.00x  1000.00MHz  1150mV    185    100   1.85A    2.13W     -
+      2      1      0      4     35    8.00x   800.00MHz  1112mV    152    100   1.52A    1.69W     -
+      3      0      2      5     35    6.15x   615.38MHz  1112mV    135    100   1.35A    1.50W     -
+current      1      0      3     32   10.00x  1000.00MHz  1150mV      -      -       -        -     1
+
+Northbridge: High 0 ; Low 1 ; Current 1
+ NbPstate NclkDid NbVid   NbFreq  NbVolt
+        0      36    52   444MHz   900mV
+        1      48    54   333MHz   875mV
+  current       -    54        -   875mV
=================== model name  : AMD E2-1800 APU with Radeon(tm) HD Graphics
@@ -1,12 +1,14 @@
 Detected CPU model 2h, from family 14h with 2 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

-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      0      1     16    0.36x    36.00MHz  1350mV     48     10   4.80A    6.48W
-      1      1      2      1     28    0.29x    28.80MHz  1200mV     32     10   3.20A    3.84W
-      2      1      0      3     48    0.18x    18.00MHz   950mV    155    100   1.55A    1.47W
-      3      0      0      0      0    0.72x    72.00MHz  1550mV      0      1   0.00A    0.00W
-current      1      0      3     48    0.18x    18.00MHz   950mV
-Northbridge:
-P-State 0: 53 (vid),   887mV
-P-State 1: 57 (vid),   837mV
+Core 0 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 2
+ Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbPst
+      0      1      0      1     16   17.00x  1700.00MHz  1350mV     48     10   4.80A    6.48W     -
+      1      1      2      1     28   13.60x  1360.00MHz  1200mV     32     10   3.20A    3.84W     -
+      2      1      0      3     48    8.50x   850.00MHz   950mV    155    100   1.55A    1.47W     -
+current      1      0      3     16    8.50x   850.00MHz  1350mV      -      -       -        -     1
+
+Northbridge: High 0 ; Low 1 ; Current 1
+ NbPstate NclkDid NbVid   NbFreq  NbVolt
+        0      24    53   566MHz   887mV
+        1      40    57   340MHz   837mV
+  current       -    57        -   837mV
=================== model name  : AMD A8-6410 APU with AMD Radeon R5 Graphics
@@ -1,17 +1,19 @@
 Detected CPU model 30h, from family 16h with 4 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

-Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 6 | Current P-State: 1
- Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
-      0      1      8      0     24   12.00x  2400.00MHz  1250mV     52     10   5.20A    6.50W
-      1      1      6      0     32   11.00x  2200.00MHz  1150mV     44     10   4.40A    5.06W
-      2      1      4      0     50   10.00x  2000.00MHz   925mV     34     10   3.40A    3.14W
-      3      1      2      0     64    9.00x  1800.00MHz   750mV     28     10   2.80A    2.10W
-      4      1      0      0     80    8.00x  1600.00MHz   550mV    225    100   2.25A    1.24W
-      5      1     12      1     90    7.00x  1400.00MHz   425mV    185    100   1.85A    0.79W
-      6      1      8      1    100    6.00x  1200.00MHz   300mV    150    100   1.50A    0.45W
-current      1      4      1    108    5.00x  1000.00MHz   200mV
-Northbridge:
-P-State 0: 102 (vid), 0 (fid), 6 (did),    275mV, 1000MHz (REFCLK = 100MHz)
-P-State 1: 116 (vid), 0 (fid), 0 (did),    100mV, 400MHz (REFCLK = 100MHz)
-P-State 2: 255 (vid), 0 (fid), 0 (did),  63899mV, 400MHz (REFCLK = 100MHz)
-P-State 3: 255 (vid), 0 (fid), 0 (did),  63899mV, 400MHz (REFCLK = 100MHz)
+Core 0 | P-State Limits (non-turbo): Highest: 2 ; Lowest 7 | Current P-State: 7
+ Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbPst
+      0      1      8      0     24   12.00x  2400.00MHz  1400mV     52     10   5.20A    7.28W     0
+      1      1      6      0     32   11.00x  2200.00MHz  1350mV     44     10   4.40A    5.94W     0
+      2      1      4      0     50   10.00x  2000.00MHz  1237mV     34     10   3.40A    4.21W     0
+      3      1      2      0     64    9.00x  1800.00MHz  1150mV     28     10   2.80A    3.22W     0
+      4      1      0      0     80    8.00x  1600.00MHz  1050mV    225    100   2.25A    2.36W     0
+      5      1     12      1     90    7.00x  1400.00MHz   987mV    185    100   1.85A    1.83W     0
+      6      1      8      1    100    6.00x  1200.00MHz   925mV    150    100   1.50A    1.39W     0
+      7      1      4      1    108    5.00x  1000.00MHz   875mV    122    100   1.22A    1.07W     1
+current      1      4      1    108    5.00x  1000.00MHz   875mV      -      -       -        -     1
+
+Northbridge: High 0 ; Low 1 ; Current 0 ; SMU configuration is locked
+ NbPstate NbFid   NbDid NbVid   NbFreq  NbVolt NbIddVal NbIddDiv  NbCurr NbPower MemPst
+        0     6       0   102  1000MHz   912mV      136       10  13.60A  12.40W      0
+        1     0       0   116   400MHz   825mV       52       10   5.20A   4.29W      1
+  current     6       0    88  1000MHz  1000mV
=================== model name  : AMD E-450 APU with Radeon(tm) HD Graphics
@@ -1,12 +1,14 @@
 Detected CPU model 2h, from family 14h with 2 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

-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      0      1     16   -0.14x   -14.00MHz  1350mV     45     10   4.50A    6.07W
-      1      1      2      1     25   -0.11x   -11.20MHz  1237mV     30     10   3.00A    3.71W
-      2      1      0      3     46   -0.07x    -7.00MHz   975mV    151    100   1.51A    1.47W
-      3      0      0      0      0   -0.28x   -28.00MHz  1550mV      0      1   0.00A    0.00W
-current      1      0      3     46   -0.07x    -7.00MHz   975mV
-Northbridge:
-P-State 0: 52 (vid),   900mV
-P-State 1: 56 (vid),   850mV
+Core 0 | P-State Limits (non-turbo): Highest: 0 ; Lowest 2 | Current P-State: 2
+ Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbPst
+      0      1      0      1     16   16.50x  1650.00MHz  1350mV     45     10   4.50A    6.07W     -
+      1      1      2      1     25   13.20x  1320.00MHz  1237mV     30     10   3.00A    3.71W     -
+      2      1      0      3     46    8.25x   825.00MHz   975mV    151    100   1.51A    1.47W     -
+current      1      2      1     16   13.20x  1320.00MHz  1350mV      -      -       -        -     1
+
+Northbridge: High 0 ; Low 1 ; Current 1
+ NbPstate NclkDid NbVid   NbFreq  NbVolt
+        0      24    52   550MHz   900mV
+        1      38    56   347MHz   850mV
+  current       -    56        -   850mV
=================== model name  : AMD GX-415GA SOC with Radeon(tm) HD Graphics
@@ -1,16 +1,16 @@
 Detected CPU model 0h, from family 16h with 4 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

-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     14      1     72    7.50x  1500.00MHz   650mV    208    100   2.08A    1.35W
-      1      1     10      1     74    6.50x  1300.00MHz   625mV    188    100   1.88A    1.17W
-      2      1      6      1     78    5.50x  1100.00MHz   575mV    164    100   1.64A    0.94W
-      3      1      3      1     82    4.75x   950.00MHz   525mV    146    100   1.46A    0.77W
-      4      1      0      1     88    4.00x   800.00MHz   450mV    125    100   1.25A    0.56W
-      5      0      0      0    127    8.00x  1600.00MHz 65499mV      0      1   0.00A    0.00W
-current      1      0      1     88    4.00x   800.00MHz   450mV
-Northbridge:
-P-State 0: 106 (vid), 1 (fid), 12 (did),    225mV, 1600MHz (REFCLK = 200MHz)
-P-State 1: 108 (vid), 1 (fid), 4 (did),    200mV, 800MHz (REFCLK = 200MHz)
-P-State 2: 255 (vid), 0 (fid), 0 (did),  63899mV, 800MHz (REFCLK = 200MHz)
-P-State 3: 255 (vid), 0 (fid), 0 (did),  63899mV, 800MHz (REFCLK = 200MHz)
+Core 0 | P-State Limits (non-turbo): Highest: 0 ; Lowest 4 | Current P-State: 4
+ Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbPst
+      0      1     14      1     72    7.50x  1500.00MHz  1100mV    208    100   2.08A    2.29W     0
+      1      1     10      1     74    6.50x  1300.00MHz  1087mV    188    100   1.88A    2.04W     0
+      2      1      6      1     78    5.50x  1100.00MHz  1062mV    164    100   1.64A    1.74W     0
+      3      1      3      1     82    4.75x   950.00MHz  1037mV    146    100   1.46A    1.51W     0
+      4      1      0      1     88    4.00x   800.00MHz  1000mV    125    100   1.25A    1.25W     1
+current      1      0      1     88    4.00x   800.00MHz  1000mV      -      -       -        -     1
+
+Northbridge: High 0 ; Low 1 ; Current 0
+ NbPstate NbFid   NbDid NbVid   NbFreq  NbVolt NbIddVal NbIddDiv  NbCurr NbPower MemPst
+        0    12       1   106   800MHz   887mV      106       10  10.60A   9.40W      0
+        1     4       1   108   400MHz   875mV       53       10   5.30A   4.64W      1
+  current    12       1    96   800MHz   950mV
=================== model name  : AMD Phenom(tm) II P960 Quad-Core Processor
@@ -1,10 +1,15 @@
 Detected CPU model 5h, 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      2      0     46    9.00x  1800.00MHz   975mV     48     10   4.80A    4.68W    44 1000mV
-      1      1      0      0     48    8.00x  1600.00MHz   950mV     42     10   4.20A    3.99W    44 1000mV
-      2      1     10      1     51    6.50x  1300.00MHz   912mV     34     10   3.40A    3.10W    44 1000mV
-      3      1      0      1     56    4.00x   800.00MHz   850mV    215    100   2.15A    1.83W    44 1000mV
-      4      0      0      1     56    4.00x   800.00MHz   850mV    215    100   2.15A    1.83W    44 1000mV
-current      1      0      1     56    4.00x   800.00MHz   850mV                                   44 1000mV
+Core 0 | P-State Limits (non-turbo): Highest: 0 ; Lowest 3 | Current P-State: 3
+ Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbVid NbVolt NbDid
+      0      1      2      0     46    9.00x  1800.00MHz   975mV     48     10   4.80A    4.68W    44 1000mV     0
+      1      1      0      0     48    8.00x  1600.00MHz   950mV     42     10   4.20A    3.99W    44 1000mV     0
+      2      1     10      1     51    6.50x  1300.00MHz   912mV     34     10   3.40A    3.10W    44 1000mV     0
+      3      1      0      1     56    4.00x   800.00MHz   850mV    215    100   2.15A    1.83W    44 1000mV     0
+current      1      0      1     56    4.00x   800.00MHz   850mV      -      -       -        -    44 1000mV     0
+
+Northbridge: High 0 ; Low 1 ; Current 0
+ NbPstate NbFid   NbDid NbVid   NbFreq  NbVolt
+        0     5       0    44  1800MHz  1000mV
+        1     5       1    52   900MHz   900mV
+  current     5       0    44  1800MHz  1000mV
=================== model name  : AMD A6-4400M APU with Radeon(tm) HD Graphics
@@ -1,17 +1,21 @@
 Detected CPU model 10h, from family 15h with 2 CPU cores (REFCLK = 100MHz ; Voltage ID Encodings: SVI (serial)).

-Core 0 | P-State Limits (non-turbo): Highest: 1 ; Lowest 6 | Current P-State: 1
- Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
-      0      1     16      0     38   16.00x  3200.00MHz  1312mV    150     10  15.00A   19.68W
-      1      1     13      0     46   14.50x  2900.00MHz  1262mV    130     10  13.00A   16.41W
-      2      1     11      0     64   13.50x  2700.00MHz  1150mV    104     10  10.40A   11.96W
-      3      1      8      0     74   12.00x  2400.00MHz  1087mV     87     10   8.70A    9.46W
-      4      1      4      0     92   10.00x  2000.00MHz   975mV     64     10   6.40A    6.24W
-      5      1      1      0     96    8.50x  1700.00MHz   950mV     54     10   5.40A    5.13W
-      6      1     12      1    102    7.00x  1400.00MHz   912mV     45     10   4.50A    4.10W
-current      1     12      1    102    7.00x  1400.00MHz   912mV
-Northbridge:
-P-State 0: 78 (vid), 0 (fid), 12 (did),   1062mV, 1600MHz (REFCLK = 100MHz)
-P-State 1: 82 (vid), 0 (fid), 9 (did),   1037mV, 1300MHz (REFCLK = 100MHz)
-P-State 2: 86 (vid), 0 (fid), 7 (did),   1012mV, 1100MHz (REFCLK = 100MHz)
-P-State 3: 110 (vid), 1 (fid), 12 (did),    862mV, 800MHz (REFCLK = 100MHz)
+Core 0 | P-State Limits (non-turbo): Highest: 2 ; Lowest 7 | Current P-State: 4
+ Pstate Status CpuFid CpuDid CpuVid  CpuMult     CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower NbPst
+      0      1     16      0     38   16.00x  3200.00MHz  1312mV    150     10  15.00A   19.68W     0
+      1      1     13      0     46   14.50x  2900.00MHz  1262mV    130     10  13.00A   16.41W     0
+      2      1     11      0     64   13.50x  2700.00MHz  1150mV    104     10  10.40A   11.96W     0
+      3      1      8      0     74   12.00x  2400.00MHz  1087mV     87     10   8.70A    9.46W     0
+      4      1      4      0     92   10.00x  2000.00MHz   975mV     64     10   6.40A    6.24W     0
+      5      1      1      0     96    8.50x  1700.00MHz   950mV     54     10   5.40A    5.13W     0
+      6      1     12      1    102    7.00x  1400.00MHz   912mV     45     10   4.50A    4.10W     1
+      7      0      2      1    102    4.50x   900.00MHz   912mV     28     10   2.80A    2.55W     1
+current      1      4      0     92   10.00x  2000.00MHz   975mV      -      -       -        -     0
+
+Northbridge: High 1 ; Low 2 ; Current 1
+ NbPstate NbFid   NbDid NbVid   NbFreq  NbVolt NbIddVal NbIddDiv  NbCurr NbPower MemPst
+        0    12       0    78  1600MHz  1062mV       28        1  28.00A  29.74W      0
+        1     9       0    82  1300MHz  1037mV       28        1  28.00A  29.04W      0
+        2     7       0    86  1100MHz  1012mV      177       10  17.70A  17.91W      0
+        3    12       1   110   800MHz   862mV      111       10  11.10A   9.57W      1
+  current     9       0    82  1300MHz  1037mV