Finally: Overclocking EPYC Rome ES

efschu3

Member
Mar 11, 2019
52
9
8
For anyone interested, here my ugly frequency scaler. Using 32C QS EPYC, depending on your linux installation, you can modify by your own.
Code:
#!/bin/bash
MAX=3825
MIN=3000
CURR=3350
OLDCURR=3350
CNTB=0
CNTS=0
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
function round() {
  printf "%.${2}f" "${1}"
}

#function current {
#grep MHz /proc/cpuinfo | awk '{ print $4 }'| awk ' {total = total + $1}END{print total/64}'
#}

function current {
FREQ=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu6/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu7/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu8/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu9/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu10/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu11/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu12/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu13/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu14/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu15/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu16/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu17/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu18/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu19/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu20/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu21/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu22/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu23/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu24/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu25/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu26/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu27/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu28/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu29/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu30/cpufreq/scaling_cur_freq)))
FREQ=$(($FREQ + $(cat /sys/devices/system/cpu/cpu31/cpufreq/scaling_cur_freq)))
echo $FREQ | awk '{ print $1/32/1000}'
}

# bigger smaller : 1 else 0
numCompare() {
   awk -v n1="$1" -v n2="$2" 'BEGIN {printf (n1<n2?"1":"0")}'
#awk -v n1="$1" -v n2="$2" 'BEGIN {printf "%s " (n1<n2?"<":">=") " %s\n", n1, n2}'
}
#echo $(current)
#echo $(($(round $(current) 0)))
#numCompare $(($(round $(current) 0))) $1

while :
do
   if [[ $(numCompare $(($(round $(current) 0))) $(($CURR - 75)) ) -eq 0 ]]
   then
      CNTB=$(($CNTB + 1))
      CNTS=0
      if [[ $CNTB -eq 2 ]]
      then
         CURR=$(($CURR + 25))
         CNTB=0
      fi
   else
      CNTS=$(($CNTS + 1))
      CNTB=0
      if [[ $CNTS -eq 2 ]]
      then
         CURR=$(($CURR - 25))
         CNTS=0
      fi
   fi
   if [[ "$CURR" -gt "$MAX" ]]
   then
      CURR=$MAX
   fi
   if [[ "$CURR" -lt "$MIN" ]]
   then
      CURR=$MIN
   fi
   if [[ $CURR -eq $OLDCURR ]]
   then
   BLAH=BLAH
   else
      OLDCURR=$CURR
      sudo ./zenstates.py --oc-frequency $CURR > /dev/null
   fi
done
 
Last edited:

gsrcrxsi

Member
Dec 12, 2018
51
3
8
i've spent the last few hours reading various threads here, but with conversations constantly flipping between Naples/Rome, rev1/rev2 boards, etc it's leaving me a bit confused for my own case.

I have 3 systems, all running EPYC Rome CPUs (I believe retail, dont think they are OEM) and I would like to try to increase the all-core clocks if I can. My systems run linux and I cannot switch to Windows, so I cannot use the windows based tools that have been mentioned.

1. AsrockRack EPYCD8 w/BIOS 2.40 - EPYC 7402P (24c), 4x SKHynix 2Rx8 16GB DDR4-3200
--Using Supermicro SNK-P0064AP4 air cooler
--everything in BIOS set to auto for CPU/mem settings
--CPU seems to run at about 3.1GHz all core, temps ~74C

2. AsrockRack EPYCD8 w/BIOS 2.10 - EPYC 7402P (24c), 4x Micron 1Rx4 16GB DDR4-3200
--Using custom water cooled loop w/EK waterblock and 360mm radiator
--everything in BIOS set to auto for CPU/mem
--CPU stays around 3.25GHz all core, temps ~46C

3. Supermicro H11DSi-NT rev2 - 2x EPYC 7642 (48c), 8x Micron 2Rx8 16GB DDR4-3200
--Using Supermicro SNK-P0064AP4 air coolers
--everything in BIOS set to auto for CPU/mem settings
--CPU seems to run at about 2.7GHz all core, temps ~60C (CPU2) / ~65C (CPU1)

I'm not really familiar with the menu options in these EPYC boards (I come from Intel) so i really don't know what settings will affect CPU speed. can anyone explain? are there any settings I can tweak to get faster all-core clocks? I couldn't really find any TDP options but maybe I just didn't know what menu they were under in the BIOS? do they exist?

another thing I will note, is that the Asrock EPYCD8 2.40 bios seems bugged for fan control. there are no fan control options in the BIOS at all, but they are there in the 2.10 BIOS. I had to unplug my PWM pin to force the CPU fan at 100% to get the temps down. has anyone else noticed this and/or reported it to Asrock?
bermp
 

gsrcrxsi

Member
Dec 12, 2018
51
3
8
2. AsrockRack EPYCD8 w/BIOS 2.10 - EPYC 7402P (24c), 4x Micron 1Rx4 16GB DDR4-3200
--Using custom water cooled loop w/EK waterblock and 360mm radiator
--everything in BIOS set to auto for CPU/mem
--CPU stays around 3.25GHz all core, temps ~46C
well i finally found the buried settings that seem to deal with overclocking and power limits on the quoted system.

Advanced -> AMD CBS -> NBIO -> SMU Common Options (this seems like a very obscure place, coming from intel BIOSs)

I changed the cTDP to 200W
changed the Determinism to Performance
changed the Package Power Limit to 200W
changed the BoostFmaxEn to 3400

no change to clock speeds at all, and zen monitor still reports package power of only ~160W when running my applications. with clock speeds of about 3.15-3.25GHz.

is there a way to clock higher? it seems i have power and thermal headroom. I'd like to run it at at least the full boost clock 3.35GHz if possible.

is there a way to see what is my limit here?

 

mirrormax

Member
Apr 10, 2020
48
25
18
I have 3 systems, all running EPYC Rome CPUs (I believe retail, dont think they are OEM) and I would like to try to increase the all-core clocks if I can. My systems run linux and I cannot switch to Windows, so I cannot use the windows based tools that have been mentioned.
So first off, please note that this only works on CPU’s which have the “Engineering Sample” tag in their name, E.g. ZS1406E2VJUG5 (64-core), ZS1711E3VIVG5 (32-core), 2S1404E2VJUG5 (64-core), 2S1705E3VIVG5 (32-core) but also the OEM EPYCs (the ones with a normal production number with -04 at the end of the number). It will not work on normal retail EPYCs.
you are out of luck unfortunately, only the ES cpus are unlocked.
 

gsrcrxsi

Member
Dec 12, 2018
51
3
8
you are out of luck unfortunately, only the ES cpus are unlocked.
But increasing the cTDP did help.

it raised clock speeds by 100-200mhz when I changed the TDP on the 7402P to 200W (180W default) and on the 7642 to 240W (225W default)
 

gsrcrxsi

Member
Dec 12, 2018
51
3
8
But increasing the cTDP did help.

it raised clock speeds by 100-200mhz when I changed the TDP on the 7402P to 200W (180W default) and on the 7642 to 240W (225W default)
also to note, the AsrockRack EPYCD8 bios version P2.10, while it seems to support the 7402P CPU and runs just fine, none of the TDP settings work and the processor seems locked to 160W TDP. only after updating to bios version P2.40 do the TDP settings take effect. even stranger, is that the CPU compatibility list for this board lists that the 7402P requires BIOS P2.30, but that version doesn't even exist on the download page?

but as i mentioned before, the P2.40 bios is bugged and all PWM fans seem locked to 50%. in order to get good CPU temps on the air cooled system, I had to remove the 4th PWM pin from the fan connector so that it locks to 100%.

is there any way to UNDERvolt these CPUs? if i could reduce the voltage a bit, i might be able to reduce the temps and power consumption.