I got CPU undervolting to work on opnsense/BSD. Skip halfway down if you just want to copy paste. So to undervolt this CPU you can actually just set up an undervolt in Linux and then copy the MSR values that changed.
Warning: If you copy paste my settings on anything but a GX-424CC bad things will probably happen.
You undervolt the GX-424CC with amdctl in Linux so you'd run:
Core 3 | P-State Limits (non-turbo): Highest: 4 ; Lowest 8 | Current P-State: 4
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 8 0 24 12.00x 2400.00MHz 1250mV 56 10 5.60A 7.00W
1 1 6 0 36 11.00x 2200.00MHz 1100mV 44 10 4.40A 4.84W
2 1 4 0 54 10.00x 2000.00MHz 875mV 34 10 3.40A 2.97W
3 1 2 0 68 9.00x 1800.00MHz 700mV 28 10 2.80A 1.96W
4 1 0 0 82 8.00x 1600.00MHz 525mV 225 100 2.25A 1.18W
5 1 12 1 92 7.00x 1400.00MHz 400mV 185 100 1.85A 0.74W
6 1 8 1 102 6.00x 1200.00MHz 275mV 150 100 1.50A 0.41W
7 1 4 1 110 5.00x 1000.00MHz 175mV 122 100 1.22A 0.21W
current 1 2 0 68 9.00x 1800.00MHz 700mV
then you can modify them like so:
Look at the msrs with amdctl
rdmsr 0xc0010064
8000013800003008
And that's the msr value we need for all p0 in all 4 CPU cores in BSD. Tidy up the formatting a bit.
kldload cpuctl
cpucontrol -m 0xc0010064=0x8000013800003008 /dev/cpuctl0
cpucontrol -m 0xc0010064=0x8000013800003008 /dev/cpuctl1
cpucontrol -m 0xc0010064=0x8000013800003008 /dev/cpuctl2
cpucontrol -m 0xc0010064=0x8000013800003008 /dev/cpuctl3
Unfortunately the particular S920 I'm using for opnsense isn't good at undervolting so it can only do around -50 mV. I've attached some sample configurations for you to copy paste if you'd like to try. You need to load the cpuctl module first before you can use cpucontrol. Note that you have to power off your box completely to clear the MSR values. Soft reboots will not reset the voltages.
The power savings are nothing to write home about but they're there. To make a oneshot to set this up on boot you should probably add a long sleep and then apply the undervolt. See this guide:
docs.opnsense.org
Warning: If you copy paste my settings on anything but a GX-424CC bad things will probably happen.
You undervolt the GX-424CC with amdctl in Linux so you'd run:
this pulls up the stock voltages/VIDs.modprobe msr
amdctl -g
Core 3 | P-State Limits (non-turbo): Highest: 4 ; Lowest 8 | Current P-State: 4
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0 1 8 0 24 12.00x 2400.00MHz 1250mV 56 10 5.60A 7.00W
1 1 6 0 36 11.00x 2200.00MHz 1100mV 44 10 4.40A 4.84W
2 1 4 0 54 10.00x 2000.00MHz 875mV 34 10 3.40A 2.97W
3 1 2 0 68 9.00x 1800.00MHz 700mV 28 10 2.80A 1.96W
4 1 0 0 82 8.00x 1600.00MHz 525mV 225 100 2.25A 1.18W
5 1 12 1 92 7.00x 1400.00MHz 400mV 185 100 1.85A 0.74W
6 1 8 1 102 6.00x 1200.00MHz 275mV 150 100 1.50A 0.41W
7 1 4 1 110 5.00x 1000.00MHz 175mV 122 100 1.22A 0.21W
current 1 2 0 68 9.00x 1800.00MHz 700mV
then you can modify them like so:
This corresponds to a 100mV undervolt in Linux for the GX-424CC and doesn't work on all my S920s.amdctl -m -p0 -v32
amdctl -m -p1 -v44
amdctl -m -p2 -v62
amdctl -m -p3 -v76
amdctl -m -p4 -v90
amdctl -m -p5 -v100
amdctl -m -p6 -v110
amdctl -m -p7 -v118
Look at the msrs with amdctl
Then you can install the msr-tools package and use it to examine the msrs. Let's look at p0 for any of our CPU cores:amdctl -g -i
Core 3 | P-State Limits (non-turbo): Highest: 1 ; Lowest 8 | Current P-State: 1
Pstate Status CpuFid CpuDid CpuVid CpuMult CpuFreq CpuVolt IddVal IddDiv CpuCurr CpuPower
0DEBUG: Reading data from CPU 3 at register c0010064
1 8 0 32 12.00x 2400.00MHz 1150mV 56 10 5.60A 6.44W
1DEBUG: Reading data from CPU 3 at register c0010065
1 6 0 44 11.00x 2200.00MHz 1000mV 44 10 4.40A 4.40W
2DEBUG: Reading data from CPU 3 at register c0010066
1 4 0 62 10.00x 2000.00MHz 775mV 34 10 3.40A 2.63W
3DEBUG: Reading data from CPU 3 at register c0010067
1 2 0 76 9.00x 1800.00MHz 600mV 28 10 2.80A 1.68W
4DEBUG: Reading data from CPU 3 at register c0010068
1 0 0 90 8.00x 1600.00MHz 425mV 225 100 2.25A 0.96W
5DEBUG: Reading data from CPU 3 at register c0010069
1 12 1 100 7.00x 1400.00MHz 300mV 185 100 1.85A 0.56W
6DEBUG: Reading data from CPU 3 at register c001006a
1 8 1 110 6.00x 1200.00MHz 175mV 150 100 1.50A 0.26W
7DEBUG: Reading data from CPU 3 at register c001006b
1 4 1 118 5.00x 1000.00MHz 75mV 122 100 1.22A 0.09W
rdmsr 0xc0010064
8000013800003008
And that's the msr value we need for all p0 in all 4 CPU cores in BSD. Tidy up the formatting a bit.
kldload cpuctl
cpucontrol -m 0xc0010064=0x8000013800003008 /dev/cpuctl0
cpucontrol -m 0xc0010064=0x8000013800003008 /dev/cpuctl1
cpucontrol -m 0xc0010064=0x8000013800003008 /dev/cpuctl2
cpucontrol -m 0xc0010064=0x8000013800003008 /dev/cpuctl3
Unfortunately the particular S920 I'm using for opnsense isn't good at undervolting so it can only do around -50 mV. I've attached some sample configurations for you to copy paste if you'd like to try. You need to load the cpuctl module first before you can use cpucontrol. Note that you have to power off your box completely to clear the MSR values. Soft reboots will not reset the voltages.
kldload cpuctl
#-50
#0
cpucontrol -m 0xc0010064=0x8000013800003808 /dev/cpuctl0
cpucontrol -m 0xc0010064=0x8000013800003808 /dev/cpuctl1
cpucontrol -m 0xc0010064=0x8000013800003808 /dev/cpuctl2
cpucontrol -m 0xc0010064=0x8000013800003808 /dev/cpuctl3
#1
cpucontrol -m 0xc0010065=0x8000012c00005006 /dev/cpuctl0
cpucontrol -m 0xc0010065=0x8000012c00005006 /dev/cpuctl1
cpucontrol -m 0xc0010065=0x8000012c00005006 /dev/cpuctl2
cpucontrol -m 0xc0010065=0x8000012c00005006 /dev/cpuctl3
#2
cpucontrol -m 0xc0010066=0x8000012200007404 /dev/cpuctl0
cpucontrol -m 0xc0010066=0x8000012200007404 /dev/cpuctl1
cpucontrol -m 0xc0010066=0x8000012200007404 /dev/cpuctl2
cpucontrol -m 0xc0010066=0x8000012200007404 /dev/cpuctl3
#3
cpucontrol -m 0xc0010067=0x8000011c00009002 /dev/cpuctl0
cpucontrol -m 0xc0010067=0x8000011c00009002 /dev/cpuctl1
cpucontrol -m 0xc0010067=0x8000011c00009002 /dev/cpuctl2
cpucontrol -m 0xc0010067=0x8000011c00009002 /dev/cpuctl3
#4
cpucontrol -m 0xc0010068=0x800002e10000ac00 /dev/cpuctl0
cpucontrol -m 0xc0010068=0x800002e10000ac00 /dev/cpuctl1
cpucontrol -m 0xc0010068=0x800002e10000ac00 /dev/cpuctl2
cpucontrol -m 0xc0010068=0x800002e10000ac00 /dev/cpuctl3
#5
cpucontrol -m 0xc0010069=0x800002b90000c04c /dev/cpuctl0
cpucontrol -m 0xc0010069=0x800002b90000c04c /dev/cpuctl1
cpucontrol -m 0xc0010069=0x800002b90000c04c /dev/cpuctl2
cpucontrol -m 0xc0010069=0x800002b90000c04c /dev/cpuctl3
#6
cpucontrol -m 0xc001006a=0x800002960000d448 /dev/cpuctl0
cpucontrol -m 0xc001006a=0x800002960000d448 /dev/cpuctl1
cpucontrol -m 0xc001006a=0x800002960000d448 /dev/cpuctl2
cpucontrol -m 0xc001006a=0x800002960000d448 /dev/cpuctl3
#7
cpucontrol -m 0xc001006b=0x8000027a0040e444 /dev/cpuctl0
cpucontrol -m 0xc001006b=0x8000027a0040e444 /dev/cpuctl1
cpucontrol -m 0xc001006b=0x8000027a0040e444 /dev/cpuctl2
cpucontrol -m 0xc001006b=0x8000027a0040e444 /dev/cpuctl3
#-50
#0
cpucontrol -m 0xc0010064=0x8000013800003808 /dev/cpuctl0
cpucontrol -m 0xc0010064=0x8000013800003808 /dev/cpuctl1
cpucontrol -m 0xc0010064=0x8000013800003808 /dev/cpuctl2
cpucontrol -m 0xc0010064=0x8000013800003808 /dev/cpuctl3
#1
cpucontrol -m 0xc0010065=0x8000012c00005006 /dev/cpuctl0
cpucontrol -m 0xc0010065=0x8000012c00005006 /dev/cpuctl1
cpucontrol -m 0xc0010065=0x8000012c00005006 /dev/cpuctl2
cpucontrol -m 0xc0010065=0x8000012c00005006 /dev/cpuctl3
#2
cpucontrol -m 0xc0010066=0x8000012200007404 /dev/cpuctl0
cpucontrol -m 0xc0010066=0x8000012200007404 /dev/cpuctl1
cpucontrol -m 0xc0010066=0x8000012200007404 /dev/cpuctl2
cpucontrol -m 0xc0010066=0x8000012200007404 /dev/cpuctl3
#3
cpucontrol -m 0xc0010067=0x8000011c00009002 /dev/cpuctl0
cpucontrol -m 0xc0010067=0x8000011c00009002 /dev/cpuctl1
cpucontrol -m 0xc0010067=0x8000011c00009002 /dev/cpuctl2
cpucontrol -m 0xc0010067=0x8000011c00009002 /dev/cpuctl3
#4
cpucontrol -m 0xc0010068=0x800002e10000ac00 /dev/cpuctl0
cpucontrol -m 0xc0010068=0x800002e10000ac00 /dev/cpuctl1
cpucontrol -m 0xc0010068=0x800002e10000ac00 /dev/cpuctl2
cpucontrol -m 0xc0010068=0x800002e10000ac00 /dev/cpuctl3
#5
cpucontrol -m 0xc0010069=0x800002b90000c04c /dev/cpuctl0
cpucontrol -m 0xc0010069=0x800002b90000c04c /dev/cpuctl1
cpucontrol -m 0xc0010069=0x800002b90000c04c /dev/cpuctl2
cpucontrol -m 0xc0010069=0x800002b90000c04c /dev/cpuctl3
#6
cpucontrol -m 0xc001006a=0x800002960000d448 /dev/cpuctl0
cpucontrol -m 0xc001006a=0x800002960000d448 /dev/cpuctl1
cpucontrol -m 0xc001006a=0x800002960000d448 /dev/cpuctl2
cpucontrol -m 0xc001006a=0x800002960000d448 /dev/cpuctl3
#7
cpucontrol -m 0xc001006b=0x8000027a0040e444 /dev/cpuctl0
cpucontrol -m 0xc001006b=0x8000027a0040e444 /dev/cpuctl1
cpucontrol -m 0xc001006b=0x8000027a0040e444 /dev/cpuctl2
cpucontrol -m 0xc001006b=0x8000027a0040e444 /dev/cpuctl3
kldload cpuctl
#-68
#0
cpucontrol -m 0xc0010064=0x8000013800003a08 /dev/cpuctl0
cpucontrol -m 0xc0010064=0x8000013800003a08 /dev/cpuctl1
cpucontrol -m 0xc0010064=0x8000013800003a08 /dev/cpuctl2
cpucontrol -m 0xc0010064=0x8000013800003a08 /dev/cpuctl3
#1
cpucontrol -m 0xc0010065=0x8000012c00005206 /dev/cpuctl0
cpucontrol -m 0xc0010065=0x8000012c00005206 /dev/cpuctl1
cpucontrol -m 0xc0010065=0x8000012c00005206 /dev/cpuctl2
cpucontrol -m 0xc0010065=0x8000012c00005206 /dev/cpuctl3
#2
cpucontrol -m 0xc0010066=0x8000012200007604 /dev/cpuctl0
cpucontrol -m 0xc0010066=0x8000012200007604 /dev/cpuctl1
cpucontrol -m 0xc0010066=0x8000012200007604 /dev/cpuctl2
cpucontrol -m 0xc0010066=0x8000012200007604 /dev/cpuctl3
#3
cpucontrol -m 0xc0010067=0x8000011c00009202 /dev/cpuctl0
cpucontrol -m 0xc0010067=0x8000011c00009202 /dev/cpuctl1
cpucontrol -m 0xc0010067=0x8000011c00009202 /dev/cpuctl2
cpucontrol -m 0xc0010067=0x8000011c00009202 /dev/cpuctl3
#4
cpucontrol -m 0xc0010068=0x800002e10000ae00 /dev/cpuctl0
cpucontrol -m 0xc0010068=0x800002e10000ae00 /dev/cpuctl1
cpucontrol -m 0xc0010068=0x800002e10000ae00 /dev/cpuctl2
cpucontrol -m 0xc0010068=0x800002e10000ae00 /dev/cpuctl3
#5
cpucontrol -m 0xc0010069=0x800002b90000c24c /dev/cpuctl0
cpucontrol -m 0xc0010069=0x800002b90000c24c /dev/cpuctl1
cpucontrol -m 0xc0010069=0x800002b90000c24c /dev/cpuctl2
cpucontrol -m 0xc0010069=0x800002b90000c24c /dev/cpuctl3
#6
cpucontrol -m 0xc001006a=0x800002960000d648 /dev/cpuctl0
cpucontrol -m 0xc001006a=0x800002960000d648 /dev/cpuctl1
cpucontrol -m 0xc001006a=0x800002960000d648 /dev/cpuctl2
cpucontrol -m 0xc001006a=0x800002960000d648 /dev/cpuctl3
#7
cpucontrol -m 0xc001006b=0x8000027a0040e644 /dev/cpuctl0
cpucontrol -m 0xc001006b=0x8000027a0040e644 /dev/cpuctl1
cpucontrol -m 0xc001006b=0x8000027a0040e644 /dev/cpuctl2
cpucontrol -m 0xc001006b=0x8000027a0040e644 /dev/cpuctl3
#-68
#0
cpucontrol -m 0xc0010064=0x8000013800003a08 /dev/cpuctl0
cpucontrol -m 0xc0010064=0x8000013800003a08 /dev/cpuctl1
cpucontrol -m 0xc0010064=0x8000013800003a08 /dev/cpuctl2
cpucontrol -m 0xc0010064=0x8000013800003a08 /dev/cpuctl3
#1
cpucontrol -m 0xc0010065=0x8000012c00005206 /dev/cpuctl0
cpucontrol -m 0xc0010065=0x8000012c00005206 /dev/cpuctl1
cpucontrol -m 0xc0010065=0x8000012c00005206 /dev/cpuctl2
cpucontrol -m 0xc0010065=0x8000012c00005206 /dev/cpuctl3
#2
cpucontrol -m 0xc0010066=0x8000012200007604 /dev/cpuctl0
cpucontrol -m 0xc0010066=0x8000012200007604 /dev/cpuctl1
cpucontrol -m 0xc0010066=0x8000012200007604 /dev/cpuctl2
cpucontrol -m 0xc0010066=0x8000012200007604 /dev/cpuctl3
#3
cpucontrol -m 0xc0010067=0x8000011c00009202 /dev/cpuctl0
cpucontrol -m 0xc0010067=0x8000011c00009202 /dev/cpuctl1
cpucontrol -m 0xc0010067=0x8000011c00009202 /dev/cpuctl2
cpucontrol -m 0xc0010067=0x8000011c00009202 /dev/cpuctl3
#4
cpucontrol -m 0xc0010068=0x800002e10000ae00 /dev/cpuctl0
cpucontrol -m 0xc0010068=0x800002e10000ae00 /dev/cpuctl1
cpucontrol -m 0xc0010068=0x800002e10000ae00 /dev/cpuctl2
cpucontrol -m 0xc0010068=0x800002e10000ae00 /dev/cpuctl3
#5
cpucontrol -m 0xc0010069=0x800002b90000c24c /dev/cpuctl0
cpucontrol -m 0xc0010069=0x800002b90000c24c /dev/cpuctl1
cpucontrol -m 0xc0010069=0x800002b90000c24c /dev/cpuctl2
cpucontrol -m 0xc0010069=0x800002b90000c24c /dev/cpuctl3
#6
cpucontrol -m 0xc001006a=0x800002960000d648 /dev/cpuctl0
cpucontrol -m 0xc001006a=0x800002960000d648 /dev/cpuctl1
cpucontrol -m 0xc001006a=0x800002960000d648 /dev/cpuctl2
cpucontrol -m 0xc001006a=0x800002960000d648 /dev/cpuctl3
#7
cpucontrol -m 0xc001006b=0x8000027a0040e644 /dev/cpuctl0
cpucontrol -m 0xc001006b=0x8000027a0040e644 /dev/cpuctl1
cpucontrol -m 0xc001006b=0x8000027a0040e644 /dev/cpuctl2
cpucontrol -m 0xc001006b=0x8000027a0040e644 /dev/cpuctl3
kldload cpuctl
#-75
#0
cpucontrol -m 0xc0010064=0x8000013800003c08 /dev/cpuctl0
cpucontrol -m 0xc0010064=0x8000013800003c08 /dev/cpuctl1
cpucontrol -m 0xc0010064=0x8000013800003c08 /dev/cpuctl2
cpucontrol -m 0xc0010064=0x8000013800003c08 /dev/cpuctl3
#1
cpucontrol -m 0xc0010065=0x8000012c00005406 /dev/cpuctl0
cpucontrol -m 0xc0010065=0x8000012c00005406 /dev/cpuctl1
cpucontrol -m 0xc0010065=0x8000012c00005406 /dev/cpuctl2
cpucontrol -m 0xc0010065=0x8000012c00005406 /dev/cpuctl3
#2
cpucontrol -m 0xc0010066=0x8000012200007804 /dev/cpuctl0
cpucontrol -m 0xc0010066=0x8000012200007804 /dev/cpuctl1
cpucontrol -m 0xc0010066=0x8000012200007804 /dev/cpuctl2
cpucontrol -m 0xc0010066=0x8000012200007804 /dev/cpuctl3
#3
cpucontrol -m 0xc0010067=0x8000011c00009402 /dev/cpuctl0
cpucontrol -m 0xc0010067=0x8000011c00009402 /dev/cpuctl1
cpucontrol -m 0xc0010067=0x8000011c00009402 /dev/cpuctl2
cpucontrol -m 0xc0010067=0x8000011c00009402 /dev/cpuctl3
#4
cpucontrol -m 0xc0010068=0x800002e10000ab00 /dev/cpuctl0
cpucontrol -m 0xc0010068=0x800002e10000ab00 /dev/cpuctl1
cpucontrol -m 0xc0010068=0x800002e10000ab00 /dev/cpuctl2
cpucontrol -m 0xc0010068=0x800002e10000ab00 /dev/cpuctl3
#5
cpucontrol -m 0xc0010069=0x800002b90000c44c /dev/cpuctl0
cpucontrol -m 0xc0010069=0x800002b90000c44c /dev/cpuctl1
cpucontrol -m 0xc0010069=0x800002b90000c44c /dev/cpuctl2
cpucontrol -m 0xc0010069=0x800002b90000c44c /dev/cpuctl3
#6
cpucontrol -m 0xc001006a=0x800002960000d848 /dev/cpuctl0
cpucontrol -m 0xc001006a=0x800002960000d848 /dev/cpuctl1
cpucontrol -m 0xc001006a=0x800002960000d848 /dev/cpuctl2
cpucontrol -m 0xc001006a=0x800002960000d848 /dev/cpuctl3
#7
cpucontrol -m 0xc001006b=0x8000027a0040e844 /dev/cpuctl0
cpucontrol -m 0xc001006b=0x8000027a0040e844 /dev/cpuctl1
cpucontrol -m 0xc001006b=0x8000027a0040e844 /dev/cpuctl2
cpucontrol -m 0xc001006b=0x8000027a0040e844 /dev/cpuctl3
#-75
#0
cpucontrol -m 0xc0010064=0x8000013800003c08 /dev/cpuctl0
cpucontrol -m 0xc0010064=0x8000013800003c08 /dev/cpuctl1
cpucontrol -m 0xc0010064=0x8000013800003c08 /dev/cpuctl2
cpucontrol -m 0xc0010064=0x8000013800003c08 /dev/cpuctl3
#1
cpucontrol -m 0xc0010065=0x8000012c00005406 /dev/cpuctl0
cpucontrol -m 0xc0010065=0x8000012c00005406 /dev/cpuctl1
cpucontrol -m 0xc0010065=0x8000012c00005406 /dev/cpuctl2
cpucontrol -m 0xc0010065=0x8000012c00005406 /dev/cpuctl3
#2
cpucontrol -m 0xc0010066=0x8000012200007804 /dev/cpuctl0
cpucontrol -m 0xc0010066=0x8000012200007804 /dev/cpuctl1
cpucontrol -m 0xc0010066=0x8000012200007804 /dev/cpuctl2
cpucontrol -m 0xc0010066=0x8000012200007804 /dev/cpuctl3
#3
cpucontrol -m 0xc0010067=0x8000011c00009402 /dev/cpuctl0
cpucontrol -m 0xc0010067=0x8000011c00009402 /dev/cpuctl1
cpucontrol -m 0xc0010067=0x8000011c00009402 /dev/cpuctl2
cpucontrol -m 0xc0010067=0x8000011c00009402 /dev/cpuctl3
#4
cpucontrol -m 0xc0010068=0x800002e10000ab00 /dev/cpuctl0
cpucontrol -m 0xc0010068=0x800002e10000ab00 /dev/cpuctl1
cpucontrol -m 0xc0010068=0x800002e10000ab00 /dev/cpuctl2
cpucontrol -m 0xc0010068=0x800002e10000ab00 /dev/cpuctl3
#5
cpucontrol -m 0xc0010069=0x800002b90000c44c /dev/cpuctl0
cpucontrol -m 0xc0010069=0x800002b90000c44c /dev/cpuctl1
cpucontrol -m 0xc0010069=0x800002b90000c44c /dev/cpuctl2
cpucontrol -m 0xc0010069=0x800002b90000c44c /dev/cpuctl3
#6
cpucontrol -m 0xc001006a=0x800002960000d848 /dev/cpuctl0
cpucontrol -m 0xc001006a=0x800002960000d848 /dev/cpuctl1
cpucontrol -m 0xc001006a=0x800002960000d848 /dev/cpuctl2
cpucontrol -m 0xc001006a=0x800002960000d848 /dev/cpuctl3
#7
cpucontrol -m 0xc001006b=0x8000027a0040e844 /dev/cpuctl0
cpucontrol -m 0xc001006b=0x8000027a0040e844 /dev/cpuctl1
cpucontrol -m 0xc001006b=0x8000027a0040e844 /dev/cpuctl2
cpucontrol -m 0xc001006b=0x8000027a0040e844 /dev/cpuctl3
Bootup / autorun options — OPNsense documentation
Last edited: