10

I'm setting up a Puppet instance that will manage a bunch of RPis. This means I cannot overclock them one by one using raspi-config.

Overclocking should be as simple as creating /boot/config.txt:

root@rpi-032113 ~ # file /boot/config.txt 
/boot/config.txt: ASCII text
root@rpi-032113 ~ # cat /boot/config.txt 
gpu_mem=32
arm_freq=950
core_freq=250
sdram_freq=450
over_voltage=6

However, whenever I reboot and stress test it stays at 700MHz:

root@rpi-032113 ~ # nice yes >/dev/null &
[1] 3238
root@rpi-032113 ~ # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
700000

root@rpi-032113 ~ # /opt/vc/bin/vcgencmd get_config int
arm_freq=950
core_freq=250
sdram_freq=450
over_voltage=6
temp_limit=85
force_pwm_open=1

It clearly stays at 700MHz (also after waiting another 15 extra seconds), while it should be at 950MHz.

What am I missing? Is there a sticky bit that has to be set in the CPU before this will work?

2 Answers 2

5

The cpu frequency is scaled on demand. You can set the threshold via the `up_threshold' sysctl variable. You can set it via:

sudo sh -c "echo 20 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold"

This will set the threshold to 20% CPU utilization.

The scaling governor can be set to ondemand via:

sudo sh -c "echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"

You can put this in your /etc/rc.local, so it will be executed during boot. You can leave out the sudo sh -c stuff then, because rc.local is run as root anyway.

More documentation on CPU clocking can be found here.

6
  • -bash: /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold: No such file or directory -- However, setting "ondemand" solved it, thanks -- root@rpi-032113 ~ # nice yes >/dev/null & [1] 4650 root@rpi-032113 ~ # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 950000
    – Tuinslak
    Commented Aug 7, 2013 at 9:18
  • I got the same error as Tuinslak, but after snooping around the files in /sys...cpufreq/ I found a file that does the same thing.
    – Matthew
    Commented Aug 7, 2013 at 14:52
  • Yeah, maybe you need to leave out the cpu0. Maybe this only exists on multi core systems. Haven't got my Pi with me to verify this.
    – Arne
    Commented Aug 7, 2013 at 15:23
  • Yup, seems you need to kick out the cpu0: raspberrypi.org/phpBB3/viewtopic.php?f=24&t=20156
    – Arne
    Commented Aug 7, 2013 at 15:24
  • Yes, great. Seems to be working like a charm now. I guess these commands are included in a raspbian install (why it worked fine on 3 other RPi's), but not when you bootstrap it from scratch for my Puppet setup. Thanks.
    – Tuinslak
    Commented Aug 7, 2013 at 16:11
0

The overclock only activates if there is a high enough CPU Usage. To change the minimum arm freq do

sudo nano /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

Nano is my favorite command line text editor, but you can use others such as vi or vim. The number in the file is the current arm freq in kHz (Not mHz!). To increase the minimum arm freq just increase the number. For tuinslack's case the number would be 950000.

In the cpufreq folder you can find some other settings, such as the maxiumum arm freq. If you hold shift at boot the overclock will be disabled. Keeping the overclock activated will dramatically increase the temperature of the CPU.

2
  • While this should fix it, it will also cause the CPU to be at 950MHz, even when idle (which is something I'd like to avoid, as OC'ing still has some risks); as it's the "minimum" the CPU's clock can be at. I wanted to dynamically overclock on as-needed basis (see the other answer).
    – Tuinslak
    Commented Aug 7, 2013 at 16:15
  • @tuinslak This is just another way of doing it.
    – Matthew
    Commented Aug 10, 2013 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.