SlideShare a Scribd company logo
1 of 13
Download to read offline
3 Ways to Significantly
Overclock your Raspberry Pi
The Raspberry Pi 3 has significantly improved processor performance
compared to previous models. Through various techniques such as
overclocking and overvoltage, we can get even more power out of the
Raspberry Pi 3.
Warning 1:
For now, there is no official support for overclocking the Raspberry Pi 3, so you
could damage your Pi. We are not responsible for any damage you may do to
your Pi. If you follow up any instruction in this document, you do it at your own
risk!
Warning 2:
Overclocking may heat up the hardware up to nearly 90 °C. That in turn, can
cause programs to crashes or, in the worst case, damage the CPU or memory
chip.
To prevent this, the most important chips have to be heatsinked. A fan
increases the effectiveness of cooling and is therefore highly recommended.
Do not follow up any instruction in this document
without cooling!
Additional Hardware
If you want to overclock your Raspberry Pi, you need to equip yourself with
three essential hardware accessories:
• Raspberry Pi
In this documentation, we use a Raspberry Pi 3 Model B V1.2 with Raspbian
GNU/Linux 8 (Jessie) running.
Important: upgrade your installed packages to their latest versions with the
command:
sudo apt-get update && sudo apt-get dist-upgrade
To check the system performance, you have to install the “sysbench” tool with
sudo apt-get install sysbench
• Power Supply
A good reliable power supply is strongly recommended. An overclocked Pi 3
could draw 1.5A and more. So, a 2A supply should be the minimum.
• Cooling equipment
To prevent the Raspberry Pi device from overheating we have to provide the
most important chips with a heatsink as well as with an additional fan.
The equipment we need for overclocking is represented in the picture below.
1.) Raspberry Pi
2.) Power supply 5 Volt with 2500 mA
3.) A fan for build in the chassis
4.) Three heat sinks
5.) A chassis with gaps for memory heat skins and fan
Here is the Raspberry Pi assembled and prepared for overclocking.
The large heatsink is under the fan, the copper heat sink is on the bottom.
Checkup Before Overclocking
Before we start to overclock our Raspberry Pi, we have to prepare and check
some conditions.
Monitor the CPU frequency
To learn the current frequency the CPU is setup and running, we have to read
out the proc files cpuinfo_min_freq, cpuinfo_max_freq and cpuinfo_cur_freq
from the /sys/devices/system/cpu/cpu0/cpufreq/ directory, where
cpuinfo_min_freq is the minimum frequency for the “idle” mode
cpuinfo_max_freq is the maximum frequency
cpuinfo_cur_freq is the current running frequency for Raspberry Pi
Monitor the CPU temperature
To know the current temperature of CPU, we can run the vcgencmd
measure_temp command. To watch the temperature every second, we can run
it in a “while” loop like this:
while true ; do vcgencmd measure_temp ; sleep 1 ; done
This loop is running until we terminate it with CTL+C.
Setup the default speed
The default CPU configuration for the Raspberry Pi board, which goes in idle
mode with no task is the following:
• arm_freq=600MHz
• core_freq=250MHz
If processes are running, the frequency goes up to:
• arm_freq=1200
• core_freq=400 (which is the maximum default values for the Raspberry
PI 3).
To prevent the idle mode from damaging, we have to set these lines in your
/boot/config.txt:
• force_turbo=1
• boot_delay=1
After that, reboot your Raspberry Pi and check the current running frequency
again. It should now be set to 1200000 KHz.
Performance test without overclocking
For the first performance test, we run the following command.
sysbench --test=memory --cpu-max-prime=2000 --num-threads=4 run
This gives us the following results as an output:
pi@raspberrypi:~ $ sysbench --test=cpu --cpu-max-prime=2000 --num-threads=4 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 4
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 2000
Test execution summary:
total time: 4.9497s
total number of events: 10000
total time taken by event execution: 19.7724
per-request statistics:
min: 1.96ms
avg: 1.98ms
max: 21.36ms
approx. 95 percentile: 1.98ms
Threads fairness:
events (avg/stddev): 2500.0000/7.31
execution time (avg/stddev): 4.9431/0.00
pi@raspberrypi:~ $
Keep that in mind for the test at the end with the overclocked Raspberry Pi.
Overclocking your Raspberry Pi
Raspberry Pi Overclocking Options
The configuration for the overclocking is set up in the /boot/config.txt file. And
to do the overclocking, you simply need to set various system configuration
parameters in this file.
There are several ways you can do the overclocking.
1. Overclocking the RPi CPU means changing the “arm_freq” parameter -
Frequency of ARM, measured in MHz.
2. Overclocking the RPi GPU means changing the “core_freq” parameter
- Frequency of GPU processor core, measured in MHz. It has an impact
on ARM performance since it drives L2 cache.
3. Overclocking the RPi Memory means changing the “sdram_freq”
parameter - Frequency of SDRAM, measured in MHz.
4. Additional extension for the RPi Memory, using ZRAM by
compressing the memory. (Additional way to p.3, see below)
5. Additional overclocking parameter: “over_voltage” - ARM/GPU core
voltage adjust. Values above 6 are only allowed when the “force_turbo”
or “current_limit_override” parameters are specified (which set the
warranty bit).
6. Additional overclocking parameter: “force_turbo” - Disables dynamic
cpufreq driver and minimum settings below. Voids Warranty.
Before you start to change any parameter, be sure you have made a backup of
the /boot/config.txt file.
Different Raspberry Pi models have different manufacturing tolerances. So, the
correct values can only be determined by trying out the widest variety of
parameters. Optimal values can only be found by testing them on every
Raspberry Pi board individually.
Overclocking problems
Most overclocking issues show up immediately with a failure to boot. If this
occurs, hold down the shift key during the next boot. This will temporarily
disable all overclocking, allowing you to boot and then edit your settings.
Overclocking Algorithm
Note: After each change to the /boot/config.txt you have to reboot
the system.
These are the default values for the Raspberry Pi 3.
arm_freq=1200
gpu_freq=400
core_freq=400
sdram_freq=450
over_voltage_sdram=0
With that in mind, write to /boot/config.txt file the following
configurations (then reboot the Pi):
arm_freq=1300
core_freq=500
sdram_freq=500
over_voltage_sdram=0
If not, you have to reduce the arm_freq value down until the Pi
is running again
1
2
5
If your Pi does not boot or running unstable, count up the values
for the over_voltage_sdram until the Pi is running fine.
4
If the Pi comes up and running we can go one step further and
try out the next configuration: step up the arm_freq value until
1500. Save it and reboot again
3
Overclocking with ZRAM
This is an additional option to increase the performance of your Raspberry Pi
device. This way involves expansion the internal memory. It can be done by
using ZRAM, which compresses the internal memory.
ZRAM uses the compression algorithms LZ4 and LZO, where LZO is the default
one. It creates a block device which can be used for swap or as general-
purpose RAM disk.
How to load ZRAM
Because ZRAM is integrated into the Linux Kernel, we just have to load the
module with the command sudo modprobe zram. To check if ZRAM module is
running, fulfill the command sudo lsmod | grep zram as shown below.
If we want to setup ZRAM optimized for RPi, we can get the script zram.sh
from GitHub - https://raw.githubusercontent.com/novaspirit/rpi_zram. This
script creates an additional compressed RAM swap disk for each CPU core and
activates it. No further configuration action is necessary.
You can download the script with this command:
sudo wget -O /usr/bin/zram.sh
https://raw.githubusercontent.com/novaspirit/rpi_zram/master/
zram.sh
Then, make it executable with as shown below.
Now, let’s see the memory information before we activate ZRAM.
The free -h and swap -s command shows that we have just 100MB swap-space
activated in our Raspberry Pi.
Now we can run ZRAM with the command sudo zram.sh.
This script will generate a swap space for each CPU core with a size of about
232 MB. Together we got an additional swap space from about 1 GB.
If we check again with the free -h command, it shows us that the swap space
is increased to 1GB RAM.
By running swap -s again we can see that we have four additional swap space
partitions created and running.
To setup the Raspberry Pi for automatic running ZRAM at boot time, we have
to edit the /etc/rc.local file and insert the line /usr/bin/zram.sh & at the end
but before the exit 0 line of the file.
See the end of the /etc/rc.local file.
After rebooting the Raspberry Pi, it comes up with the configured ZRAM
memory. Check it again with the free -h and swap -s commands to make sure
that ZRAM is up and running.
Performance test with overclocking
Now, after we have finished the overclocking of our Raspberry Pi, we want to
see the results of the performance test again.
For that, we should run the following command again.
sysbench --test=memory --cpu-max-prime=2000 --num-threads=4 run
The results are the following:
pi@raspberrypi:~ $ sysbench --test=cpu --cpu-max-prime=2000 --num-threads=4 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 4
Doing CPU performance benchmark
Threads started!
Done.
Maximum prime number checked in CPU test: 2000
Test execution summary:
total time: 4.0150s (4.9497s)
total number of events: 10000
total time taken by event execution: 16.0324 (19.7724)
per-request statistics:
min: 1.57ms (1.96ms)
avg: 1.60ms (1.98ms)
max: 23.99ms (21.36ms)
approx. 95 percentile: 1.58ms (1.98ms)
Threads fairness:
events (avg/stddev): 2500.0000/6.96 (2500.0000/7.31)
execution time (avg/stddev): 4.0081/0.00 (4.9431/0.00)
pi@raspberrypi:~ $
As we can see, all the values are better than before without overclocking. The
green values are the ones from the first run.
Remove overclocking
If you want to remove the overclocking from your Raspberry Pi, you just need
to remove the changes from the /boot/config.txt file. If you have made a
backup file, just copy it back to the /boot directory and overwrite the config.txt
file.
Also, you must remove the line /usr/bin/zram.sh & from the /etc/rc.local file.
Reboot your Raspberry Pi after that and all overclocking configurations will be
disabled.
Final Notes
Well, now you have successfully overclocked your Raspberry Pi device and you
are ready to start doing different projects on this marvelous and accelerated
ARM device.
Don’t know what to start from?
Get inspired by our TOP-10 Projects for Raspberry Pi!
Make up your own Retropie gaming machine >>>
Play PC games on Raspberry Pi >>>
Need Windows applications? Install Wine and reach any goal! >>>
Run a Remote Desktop on Raspberry Pi for different purposes >>>
Create your own MetaTrader Bot for Automated Forex Trading >>>
Run TeamViewer On Raspberry Pi >>>
Setup Spotify on Raspberry Pi for Music Library Control>>>
Run Plex Media Server on RPi >>>
Dropbox on Raspbian for Backup and Storage >>>
Set up a TeamSpeak 3 Server on Raspberry Pi >>>

More Related Content

Similar to Overclocking Raspberry Pi 3 Ulimate Guide

Building Apache Cassandra clusters for massive scale
Building Apache Cassandra clusters for massive scaleBuilding Apache Cassandra clusters for massive scale
Building Apache Cassandra clusters for massive scaleAlex Thompson
 
Marian Marinov, 1H Ltd.
Marian Marinov, 1H Ltd.Marian Marinov, 1H Ltd.
Marian Marinov, 1H Ltd.Ontico
 
Performance comparison of Distributed File Systems on 1Gbit networks
Performance comparison of Distributed File Systems on 1Gbit networksPerformance comparison of Distributed File Systems on 1Gbit networks
Performance comparison of Distributed File Systems on 1Gbit networksMarian Marinov
 
AIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge ShareAIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge Share.Gastón. .Bx.
 
Motherboard Components
Motherboard ComponentsMotherboard Components
Motherboard Componentsstooty s
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingMarian Marinov
 
Topics - , Addressing modes, GPU, .pdf
Topics - , Addressing modes, GPU,  .pdfTopics - , Addressing modes, GPU,  .pdf
Topics - , Addressing modes, GPU, .pdfShubhamSinghRajput46
 
tuningfor_oracle
 tuningfor_oracle tuningfor_oracle
tuningfor_oraclestyxyx
 
php & performance
 php & performance php & performance
php & performancesimon8410
 
Day 6 - Manage CISCO IOS
Day 6 - Manage CISCO IOSDay 6 - Manage CISCO IOS
Day 6 - Manage CISCO IOSanilinvns
 
Manage CISCO IOS
Manage CISCO IOSManage CISCO IOS
Manage CISCO IOSanilinvns
 
Live memory forensics
Live memory forensicsLive memory forensics
Live memory forensicsMehedi Hasan
 
Tuning tips for Apache Spark Jobs
Tuning tips for Apache Spark JobsTuning tips for Apache Spark Jobs
Tuning tips for Apache Spark JobsSamir Bessalah
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagentoMathew Beane
 
Oracle database 12c client quick installation guide 7
Oracle database 12c client quick installation guide 7Oracle database 12c client quick installation guide 7
Oracle database 12c client quick installation guide 7bupbechanhgmail
 
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...Joao Galdino Mello de Souza
 

Similar to Overclocking Raspberry Pi 3 Ulimate Guide (20)

Building Apache Cassandra clusters for massive scale
Building Apache Cassandra clusters for massive scaleBuilding Apache Cassandra clusters for massive scale
Building Apache Cassandra clusters for massive scale
 
Marian Marinov, 1H Ltd.
Marian Marinov, 1H Ltd.Marian Marinov, 1H Ltd.
Marian Marinov, 1H Ltd.
 
Performance comparison of Distributed File Systems on 1Gbit networks
Performance comparison of Distributed File Systems on 1Gbit networksPerformance comparison of Distributed File Systems on 1Gbit networks
Performance comparison of Distributed File Systems on 1Gbit networks
 
AIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge ShareAIX Advanced Administration Knowledge Share
AIX Advanced Administration Knowledge Share
 
Motherboard Components
Motherboard ComponentsMotherboard Components
Motherboard Components
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuilding
 
Overclocking
OverclockingOverclocking
Overclocking
 
Overclocking
OverclockingOverclocking
Overclocking
 
Topics - , Addressing modes, GPU, .pdf
Topics - , Addressing modes, GPU,  .pdfTopics - , Addressing modes, GPU,  .pdf
Topics - , Addressing modes, GPU, .pdf
 
tuningfor_oracle
 tuningfor_oracle tuningfor_oracle
tuningfor_oracle
 
Xen time machine
Xen time machineXen time machine
Xen time machine
 
php & performance
 php & performance php & performance
php & performance
 
Day 6 - Manage CISCO IOS
Day 6 - Manage CISCO IOSDay 6 - Manage CISCO IOS
Day 6 - Manage CISCO IOS
 
Manage CISCO IOS
Manage CISCO IOSManage CISCO IOS
Manage CISCO IOS
 
Live memory forensics
Live memory forensicsLive memory forensics
Live memory forensics
 
Tuning tips for Apache Spark Jobs
Tuning tips for Apache Spark JobsTuning tips for Apache Spark Jobs
Tuning tips for Apache Spark Jobs
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagento
 
Optimizing Linux Servers
Optimizing Linux ServersOptimizing Linux Servers
Optimizing Linux Servers
 
Oracle database 12c client quick installation guide 7
Oracle database 12c client quick installation guide 7Oracle database 12c client quick installation guide 7
Oracle database 12c client quick installation guide 7
 
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
z/VM 6.3 - Mudanças de Comportamento do hypervisor para suporte de partições ...
 

Recently uploaded

Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 

Recently uploaded (20)

Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 

Overclocking Raspberry Pi 3 Ulimate Guide

  • 1. 3 Ways to Significantly Overclock your Raspberry Pi The Raspberry Pi 3 has significantly improved processor performance compared to previous models. Through various techniques such as overclocking and overvoltage, we can get even more power out of the Raspberry Pi 3. Warning 1: For now, there is no official support for overclocking the Raspberry Pi 3, so you could damage your Pi. We are not responsible for any damage you may do to your Pi. If you follow up any instruction in this document, you do it at your own risk! Warning 2: Overclocking may heat up the hardware up to nearly 90 °C. That in turn, can cause programs to crashes or, in the worst case, damage the CPU or memory chip. To prevent this, the most important chips have to be heatsinked. A fan increases the effectiveness of cooling and is therefore highly recommended. Do not follow up any instruction in this document without cooling!
  • 2. Additional Hardware If you want to overclock your Raspberry Pi, you need to equip yourself with three essential hardware accessories: • Raspberry Pi In this documentation, we use a Raspberry Pi 3 Model B V1.2 with Raspbian GNU/Linux 8 (Jessie) running. Important: upgrade your installed packages to their latest versions with the command: sudo apt-get update && sudo apt-get dist-upgrade To check the system performance, you have to install the “sysbench” tool with sudo apt-get install sysbench • Power Supply A good reliable power supply is strongly recommended. An overclocked Pi 3 could draw 1.5A and more. So, a 2A supply should be the minimum. • Cooling equipment To prevent the Raspberry Pi device from overheating we have to provide the most important chips with a heatsink as well as with an additional fan.
  • 3. The equipment we need for overclocking is represented in the picture below. 1.) Raspberry Pi 2.) Power supply 5 Volt with 2500 mA 3.) A fan for build in the chassis 4.) Three heat sinks 5.) A chassis with gaps for memory heat skins and fan
  • 4. Here is the Raspberry Pi assembled and prepared for overclocking. The large heatsink is under the fan, the copper heat sink is on the bottom. Checkup Before Overclocking Before we start to overclock our Raspberry Pi, we have to prepare and check some conditions. Monitor the CPU frequency To learn the current frequency the CPU is setup and running, we have to read out the proc files cpuinfo_min_freq, cpuinfo_max_freq and cpuinfo_cur_freq from the /sys/devices/system/cpu/cpu0/cpufreq/ directory, where cpuinfo_min_freq is the minimum frequency for the “idle” mode cpuinfo_max_freq is the maximum frequency
  • 5. cpuinfo_cur_freq is the current running frequency for Raspberry Pi Monitor the CPU temperature To know the current temperature of CPU, we can run the vcgencmd measure_temp command. To watch the temperature every second, we can run it in a “while” loop like this: while true ; do vcgencmd measure_temp ; sleep 1 ; done This loop is running until we terminate it with CTL+C. Setup the default speed The default CPU configuration for the Raspberry Pi board, which goes in idle mode with no task is the following: • arm_freq=600MHz • core_freq=250MHz If processes are running, the frequency goes up to: • arm_freq=1200 • core_freq=400 (which is the maximum default values for the Raspberry PI 3). To prevent the idle mode from damaging, we have to set these lines in your /boot/config.txt: • force_turbo=1 • boot_delay=1
  • 6. After that, reboot your Raspberry Pi and check the current running frequency again. It should now be set to 1200000 KHz. Performance test without overclocking For the first performance test, we run the following command. sysbench --test=memory --cpu-max-prime=2000 --num-threads=4 run This gives us the following results as an output: pi@raspberrypi:~ $ sysbench --test=cpu --cpu-max-prime=2000 --num-threads=4 run sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 4 Doing CPU performance benchmark Threads started! Done. Maximum prime number checked in CPU test: 2000 Test execution summary: total time: 4.9497s total number of events: 10000 total time taken by event execution: 19.7724 per-request statistics: min: 1.96ms avg: 1.98ms max: 21.36ms approx. 95 percentile: 1.98ms Threads fairness: events (avg/stddev): 2500.0000/7.31 execution time (avg/stddev): 4.9431/0.00 pi@raspberrypi:~ $ Keep that in mind for the test at the end with the overclocked Raspberry Pi.
  • 7. Overclocking your Raspberry Pi Raspberry Pi Overclocking Options The configuration for the overclocking is set up in the /boot/config.txt file. And to do the overclocking, you simply need to set various system configuration parameters in this file. There are several ways you can do the overclocking. 1. Overclocking the RPi CPU means changing the “arm_freq” parameter - Frequency of ARM, measured in MHz. 2. Overclocking the RPi GPU means changing the “core_freq” parameter - Frequency of GPU processor core, measured in MHz. It has an impact on ARM performance since it drives L2 cache. 3. Overclocking the RPi Memory means changing the “sdram_freq” parameter - Frequency of SDRAM, measured in MHz. 4. Additional extension for the RPi Memory, using ZRAM by compressing the memory. (Additional way to p.3, see below) 5. Additional overclocking parameter: “over_voltage” - ARM/GPU core voltage adjust. Values above 6 are only allowed when the “force_turbo” or “current_limit_override” parameters are specified (which set the warranty bit). 6. Additional overclocking parameter: “force_turbo” - Disables dynamic cpufreq driver and minimum settings below. Voids Warranty. Before you start to change any parameter, be sure you have made a backup of the /boot/config.txt file. Different Raspberry Pi models have different manufacturing tolerances. So, the correct values can only be determined by trying out the widest variety of parameters. Optimal values can only be found by testing them on every Raspberry Pi board individually. Overclocking problems Most overclocking issues show up immediately with a failure to boot. If this occurs, hold down the shift key during the next boot. This will temporarily disable all overclocking, allowing you to boot and then edit your settings.
  • 8. Overclocking Algorithm Note: After each change to the /boot/config.txt you have to reboot the system. These are the default values for the Raspberry Pi 3. arm_freq=1200 gpu_freq=400 core_freq=400 sdram_freq=450 over_voltage_sdram=0 With that in mind, write to /boot/config.txt file the following configurations (then reboot the Pi): arm_freq=1300 core_freq=500 sdram_freq=500 over_voltage_sdram=0 If not, you have to reduce the arm_freq value down until the Pi is running again 1 2 5 If your Pi does not boot or running unstable, count up the values for the over_voltage_sdram until the Pi is running fine. 4 If the Pi comes up and running we can go one step further and try out the next configuration: step up the arm_freq value until 1500. Save it and reboot again 3
  • 9. Overclocking with ZRAM This is an additional option to increase the performance of your Raspberry Pi device. This way involves expansion the internal memory. It can be done by using ZRAM, which compresses the internal memory. ZRAM uses the compression algorithms LZ4 and LZO, where LZO is the default one. It creates a block device which can be used for swap or as general- purpose RAM disk. How to load ZRAM Because ZRAM is integrated into the Linux Kernel, we just have to load the module with the command sudo modprobe zram. To check if ZRAM module is running, fulfill the command sudo lsmod | grep zram as shown below. If we want to setup ZRAM optimized for RPi, we can get the script zram.sh from GitHub - https://raw.githubusercontent.com/novaspirit/rpi_zram. This script creates an additional compressed RAM swap disk for each CPU core and activates it. No further configuration action is necessary. You can download the script with this command: sudo wget -O /usr/bin/zram.sh https://raw.githubusercontent.com/novaspirit/rpi_zram/master/ zram.sh Then, make it executable with as shown below.
  • 10. Now, let’s see the memory information before we activate ZRAM. The free -h and swap -s command shows that we have just 100MB swap-space activated in our Raspberry Pi. Now we can run ZRAM with the command sudo zram.sh. This script will generate a swap space for each CPU core with a size of about 232 MB. Together we got an additional swap space from about 1 GB. If we check again with the free -h command, it shows us that the swap space is increased to 1GB RAM. By running swap -s again we can see that we have four additional swap space partitions created and running.
  • 11. To setup the Raspberry Pi for automatic running ZRAM at boot time, we have to edit the /etc/rc.local file and insert the line /usr/bin/zram.sh & at the end but before the exit 0 line of the file. See the end of the /etc/rc.local file. After rebooting the Raspberry Pi, it comes up with the configured ZRAM memory. Check it again with the free -h and swap -s commands to make sure that ZRAM is up and running.
  • 12. Performance test with overclocking Now, after we have finished the overclocking of our Raspberry Pi, we want to see the results of the performance test again. For that, we should run the following command again. sysbench --test=memory --cpu-max-prime=2000 --num-threads=4 run The results are the following: pi@raspberrypi:~ $ sysbench --test=cpu --cpu-max-prime=2000 --num-threads=4 run sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 4 Doing CPU performance benchmark Threads started! Done. Maximum prime number checked in CPU test: 2000 Test execution summary: total time: 4.0150s (4.9497s) total number of events: 10000 total time taken by event execution: 16.0324 (19.7724) per-request statistics: min: 1.57ms (1.96ms) avg: 1.60ms (1.98ms) max: 23.99ms (21.36ms) approx. 95 percentile: 1.58ms (1.98ms) Threads fairness: events (avg/stddev): 2500.0000/6.96 (2500.0000/7.31) execution time (avg/stddev): 4.0081/0.00 (4.9431/0.00) pi@raspberrypi:~ $ As we can see, all the values are better than before without overclocking. The green values are the ones from the first run. Remove overclocking If you want to remove the overclocking from your Raspberry Pi, you just need to remove the changes from the /boot/config.txt file. If you have made a backup file, just copy it back to the /boot directory and overwrite the config.txt file. Also, you must remove the line /usr/bin/zram.sh & from the /etc/rc.local file. Reboot your Raspberry Pi after that and all overclocking configurations will be disabled.
  • 13. Final Notes Well, now you have successfully overclocked your Raspberry Pi device and you are ready to start doing different projects on this marvelous and accelerated ARM device. Don’t know what to start from? Get inspired by our TOP-10 Projects for Raspberry Pi! Make up your own Retropie gaming machine >>> Play PC games on Raspberry Pi >>> Need Windows applications? Install Wine and reach any goal! >>> Run a Remote Desktop on Raspberry Pi for different purposes >>> Create your own MetaTrader Bot for Automated Forex Trading >>> Run TeamViewer On Raspberry Pi >>> Setup Spotify on Raspberry Pi for Music Library Control>>> Run Plex Media Server on RPi >>> Dropbox on Raspbian for Backup and Storage >>> Set up a TeamSpeak 3 Server on Raspberry Pi >>>