Warning: as of yet, there is no official support for overclocking the Raspberry Pi 3, so you could damage your small computer. Just a reminder.

Update: I’ve managed to make a DIY heatsink for the Raspberry Pi 3 for $4, and it’s running stable at 1.5GHz. Click here to read.

The new version of Raspberry Pi 3 was released yesterday, so I naturally had to get two. I’m using two as Stratum-1 NTP servers, and with the old Raspberry Pi 2, I had hit the roof when it came down to getting better time resolution. So when I read that a new 50% faster version had been released, I raced to the nearest store and got a couple. I have one experimental NTP server that isn’t handing out time on the internet and another one that is the primary server, connected to the NTP Pool Project.

I installed the experimental Raspberry Pi 3 first, so I could test performance and try to overclock it. And it went very well.

Overclocking

Raspberry-Pi-3-cpu-heatsinkNaturally, I want to get the most out of the Raspberry Pi 3, so I got some small heat sinks. There’s one larger for the CPU/GPU, so that was easy enough. But then it got confusing. What to do with the other two smaller heatsinks included in the “overclock kit” for the Raspberry Pi. The immediate instinct is to put it on the other large IC, but after searching for SMSC LAN9514 I realized it was the controller for Ethernet and USB and had a hard time trying to understand why the Internet was full of pictures of people putting a heatsink on a network/USB controller. I wanted to overclock the processor and memory. The memory chip is on the underside of the board, so I decided to put both of the smaller heatsinks on the SDRAM instead. Seems to me to be a better place to put a heatsink. But It comes with a problem. Space. Most enclosures for the Raspberry Pi doesn’t have enough room for heatsinks on the bottom side of the card. Fortunately, my board uses spacers, so I could use longer standoffs and fit the board correctly, even putting a wee bit of pressure on the heatsinks to help with the cooling.

Raspberry-Pi-3-heatsink-memory

Overclock Testing

Time to fire the new Raspberry Pi 3 up and try to get the max performance out of it. I booted it with the already installed Linux Raspian, and all worked as normal, just…you know, faster. Time to test. First I put the CPU cores in “Performance” mode so they wouldn’t go down to a slower speed. A Raspberry Pi have different CPU modes like conservative, on demand, userspace, power save and performance. When the processor has a light load, it goes into power saving mode, that switches to a lower CPU speed. So I put all the CPU cores in performance mode by writing the following command line.

echo "performance" |sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

I wrote a small shell script to monitor the CPU speed and the temperature to be able to see if it gets too hot during my experiments.
I created a file called check_cpu_speed_temp.sh

pico check_cpu_speed_temp.sh

and wrote:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
/opt/vc/bin/vcgencmd measure_temp

Now it was time to try how much I could overclock it. I opened the config.txt file in the /boot/ directory and changed the arm_freq setting to:
arm_freq=1400 I rebooted and everything looked good. So to test if the Raspberry Pi 3 would be stable under heavy load I wrote this on the command line, just to get the cores working at 100% CPU usage:
fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; fulload
This just creates four threads that copy zeros into /dev/null, the Linux equivalent of a digital trashcan. This puts all four cores at close to 100% all the time.
I started the small shell script, having it update every two seconds by writing:
watch ./check_cpu_speed_temp.sh
And watched as the temperature climbed. It stopped around 58-59 °C and stayed there. The next step, going up to 1.45 GHz didn’t work, the machine refused to boot. So I put the SD-card in my Macbook Pro and edited the /boot/config.txt, adding voltage boost by adding the line:

arm_freq=1400
over_voltage=6

Now the machine booted up without a problem. I managed to run the Raspberry Pi 3 at 1.5 GHz but decided not to overdo it. I compromised and settled on a CPU frequency of 1.45 GHz.

If you want to kill the processes that bog down the CPU, just write killall dd and they will stop.
Raspberry-Pi-3-temp-cpu

Memory Overclocking

Next step, overclock the memory speed. It seems like the new Raspberry Pi 3 has the same SDRAM memory as the Raspberry Pi 2. The standard rate is 400 MHz. I tried to bump it up, but it maxed out at 500 MHz. So I added sdram_freq=500 in /boot/config.txt. It worked perfectly. Next up was 550, but then the machine got unstable, so I settled for 500.

Graphics

I haven’t tried to increase the speed of the GPU. My Raspberry Pi runs as a headless server, but I realize that the GPU speed is connected to the speed of the L2 cache, so maybe this is something to experiment with at a later time. Raspberry Pi 2 and newer have separate L2 Cache between CPU and GPU.

Running Your Raspberry Pi 3 at Full Speed All The Time

If you add the following two lines, your Raspberry Pi 3 will run at full speed all the time. Doing this will guarantee that you’re violating your warranty if something goes wrong. Just a warning.

force_turbo=1

Not all Raspberry Pi 3 are created equal

So I now had a Raspberry Pi 3 that run with 1000 MHz more combined processing power than the standard one and with a speed boost of the SDRAM. Naturally, I had to try it out on my other unit. No such luck. As soon as I tried to increase the CPU speed, it quickly climbed to over 80 °C and became unstable. So It seems like you have to cross your fingers when it comes to the possibility to overclock your Raspberry Pi 3. I quickly moved the faster card to my main server, because it is the one that needs the most speed.

Is the Raspberry Pi 3 faster?

I’m running the two Raspberry Pi as NTP-servers. Here’s a before-after plot of the time resolution on my Stratum-1 NTP-server loopback statistics.

ntp-offsets-Raspberry-Pi-3

Nano Second Raspberry Pi 3 NTP Server

The servers precision has gone from 0.95367431640625 µS calculated precision to 0.476837158203125 µS. So I’m now in the nanoSecond territory on my Stratum-1 NTP-server. Unfortunately, the Raspberry Pi’s Ethernet goes through USB at 100Mbit/sec, so that’s a bottleneck.

The overclocked Raspberry Pi 3 has now been running for 24 hours, handing out time to thousands of computers and it is stable as a rock. Update 2016-03-16: Still running one of the Raspberry Pi 3’s at 1350 MHz and 500 MHz memory settings and it’s rock solid.

So it seems like it’s a crap shoot if you’re going to be able to overclock your Raspberry Pi 3. I got lucky with one of the cards. And let’s face it, a 1.2 Quad Core 64-bit computer for $40 is fantastic!

Benchmarking the Overclocked Raspberry Pi 3

After comments about the overclocking not working, here are my results. The test program seems to be a single thread, but I can debunk the idea of the processor going slower when overclocking.

Standard Raspberry Pi 3 - no overclocking

BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)

TEST                : Iterations/sec.  : Old Index   : New Index
                    :                  : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT        :          650.05  :      16.67  :       5.48
STRING SORT         :          66.218  :      29.59  :       4.58
BITFIELD            :      1.8311e+08  :      31.41  :       6.56
FP EMULATION        :          124.03  :      59.52  :      13.73
FOURIER             :          6531.7  :       7.43  :       4.17
ASSIGNMENT          :          8.6217  :      32.81  :       8.51
IDEA                :          1858.7  :      28.43  :       8.44
HUFFMAN             :          896.88  :      24.87  :       7.94
NEURAL NET          :          9.7445  :      15.65  :       6.58
LU DECOMPOSITION    :          314.82  :      16.31  :      11.78
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX       : 29.905
FLOATING-POINT INDEX: 12.378
Baseline (MSDOS*)   : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0
==============================LINUX DATA BELOW===============================
CPU                 : 4 CPU ARMv7 Processor rev 4 (v7l)
L2 Cache            : 
OS                  : Linux 4.1.17-v7-atom-pps+
C compiler          : gcc version 4.9.2 (Raspbian 4.9.2-10) 
libc                : libc-2.19.so
MEMORY INDEX        : 6.347
INTEGER INDEX       : 8.426
FLOATING-POINT INDEX: 6.865
Baseline (LINUX)    : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38
* Trademarks are property of their respective holder.

Overclocked Raspberry Pi 3 to 1350 MHz CPU and 500 MHz SDRAM clock speed

BYTEmark* Native Mode Benchmark ver. 2 (10/95)
Index-split by Andrew D. Balsa (11/97)
Linux/Unix* port by Uwe F. Mayer (12/96,11/97)

TEST                : Iterations/sec.  : Old Index   : New Index
                    :                  : Pentium 90* : AMD K6/233*
--------------------:------------------:-------------:------------
NUMERIC SORT        :          685.76  :      17.59  :       5.78
STRING SORT         :          68.556  :      30.63  :       4.74
BITFIELD            :      1.9658e+08  :      33.72  :       7.04
FP EMULATION        :          129.07  :      61.93  :      14.29
FOURIER             :          6460.8  :       7.35  :       4.13
ASSIGNMENT          :          10.302  :      39.20  :      10.17
IDEA                :          1972.1  :      30.16  :       8.96
HUFFMAN             :          930.43  :      25.80  :       8.24
NEURAL NET          :          10.065  :      16.17  :       6.80
LU DECOMPOSITION    :          400.31  :      20.74  :      14.97
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX       : 31.995
FLOATING-POINT INDEX: 13.506
Baseline (MSDOS*)   : Pentium* 90, 256 KB L2-cache, Watcom* compiler 10.0
==============================LINUX DATA BELOW===============================
CPU                 : 4 CPU ARMv7 Processor rev 4 (v7l)
L2 Cache            : 
OS                  : Linux 4.1.17-v7-atom-pps+
C compiler          : gcc version 4.9.2 (Raspbian 4.9.2-10) 
libc                : libc-2.19.so
MEMORY INDEX        : 6.977
INTEGER INDEX       : 8.834
FLOATING-POINT INDEX: 7.491
Baseline (LINUX)    : AMD K6/233*, 512 KB L2-cache, gcc 2.7.2.3, libc-5.4.38
* Trademarks are property of their respective holder.