Family Encyclopedia >> Electronics

How to Overclock Your Raspberry Pi 4

Priced at around $40, the Raspberry Pi 4 already gives you a lot of bang for your buck, but you can get even more out of this powerful single-board computer by overclocking it.

ContentsBefore you start:Everything you need to know about overclockingWhat you'll needInstall the official Raspberry Pi operating systemGet started in RaspbianConsider updating to the latest versionRaspberry Pi benchmarkingOverclock the CPUTest your results!Overclock the GPU

Overclocking the CPU and GPU can often provide a noticeable performance boost, which is especially useful if you perform resource-intensive tasks, such as playing games, streaming high-resolution media, or using your Raspberry Pi as a mini. laptop.

However you plan to use all that extra power, by the end of this article you will have successfully boosted your Raspberry Pi 4's CPU and GPU.

Before you start:everything you need to know about overclocking

Overclocking is the process of configuring your processor and memory to operate at speeds above their official speed rating.

Despite the performance benefits, many people avoid overclocking for fear of voiding their warranty. Unlike some organizations, the Raspberry Pi Foundation supports overclocking, so you can follow this tutorial without having to worry about your warranty. However, just be aware that there are certain modifications that will void your warranty, such as "overvaulting". If this article makes you want to explore other ways to improve the performance of your device, then you should review the Raspberry Pi Foundation Guidelines carefully to ensure you don't accidentally void your warranty!

What you'll need

To complete this tutorial you will need:

  • A Raspberry Pi 4
  • A keyboard and a way to attach this keyboard to your Raspberry Pi
  • A monitor
  • A micro HDMI cable
  • An SD card compatible with your model of Raspberry Pi. You will be erasing this SD card, so make sure it doesn't contain anything you want to keep.
  • A good quality diet. When running Raspberry Pi 4 at stock speeds, you can use just about any compatible third-party power supply, but if you plan to overclock Raspberry Pi, you should go with the official Raspberry Pi universal power supply. using the official power supply, you can be sure that your Raspberry Pi has enough power to run at overclocked speeds.
How to Overclock Your Raspberry Pi 4

When you have these tools, you are ready to increase your CPU and GPU.

Install the official Raspberry Pi operating system

For the purposes of this tutorial, we will write the Raspbian OS to our SD card, using Etcher. If Etcher is not already installed, you can download it for free from the Balena website.

  • Go to the Raspbian website and download the latest version.
  • Insert the SD card into your laptop or computer.
  • Launch the Etcher app.
  • In Etcher, click "Select Image", then choose the Rasbian system image you just downloaded.
How to Overclock Your Raspberry Pi 4
  • Click "Select target" and choose your target bootable media, which in this case is our SD card.

Etcher will now flash the Raspbian system image to your SD card.

Start in Raspbian

Once Raspbian is installed:

  • Remove the SD card from your laptop or computer and insert it into your Raspberry Pi.
  • Connect your monitor to the Raspberry Pi using the micro HDMI cable.
  • Connect your keyboard to the Raspberry Pi device.
  • Connect your Raspberry Pi to a power source.

Raspbian should now start automatically.

Consider-updating-to-the-latest-version

If you want to take advantage of the latest and greatest overclocking capabilities, you will need to upgrade Raspbian to the latest experimental firmware release. Note that experimental builds are more likely to contain bugs, flaws, and other errors, so you shouldn't use them in a production environment.

To update your firmware, select the small Terminal application in the toolbar and execute each of the following commands in succession:

sudo apt updatesudo apt dist-upgrade

When prompted, press "y" for "yes". Now run the following command:

sudo rpi-update

When prompted, type "y" again.

You will need to reboot your system to activate this new firmware, so click on the little Raspberry Pi icon in the top left corner, then select "Shutdown.... -> Restart.

Comparative analysis of Raspberry Pi

Before you overclock your device, you might want to save some information about its current performance so you can compare notes later!

There are many benchmarking tools on the market, but I'm going to use Banc Sys. Alternatively, you can skip this step altogether and go straight to overclocking.

In the Raspbian toolbar, select the Terminal icon. Type the following command in Terminal:

sudo apt-get install sysbench

Once Sysbench is installed, you can get a baseline of your Raspberry Pi's performance by typing the following command in the terminal:

sysbench --test=cpu --cpu-max-prime=2000 --num-threads=4 run> pre-benchmark.txt

This will create a "pre-benchmark" text file containing information about the current performance of your Raspberry Pi.

Overclock the processor

When you overclock the processor, you increase the clock speed of the central processing unit, which increases performance. Most workloads on a Raspberry Pi are influenced by clock speed rather than GPU. After overclocking the CPU, you should see a noticeable performance improvement no matter how you use your Raspberry Pi.

To edit your Raspberry Pi's config.txt file, we need elevated privileges, so run the following Terminal command:

sudo nano /boot/config.txt

The config.txt file will now open in Raspbian's Nano text editor with root-level privileges.

You can overclock the CPU by making a few changes to these basic configuration settings:

1. Scroll down the file and find the section marked [pi4].

2. On a new line just below [pi4], add the following:

over_voltage=2arm_freq=1750

Alternatively, if you have the latest experimental firmware installed, you can try these values ​​instead:

over_voltage=6arm_freq=2147

3. Save your changes with Ctrl + O and exit the file with the Ctrl + X keyboard shortcut.

You will need to restart the Raspberry Pi 4 before these new configuration settings are loaded, so run the following command in the Terminal window:

sudo reboot

If your overclock is successful, Raspbian will start using your new configuration settings.

Test your results!

If you took the time to create a report before overclocking, now is the time to generate a second report and compare the results.

Launch a Terminal window by clicking on the small icon in the toolbar, then run the following command:

sysbench --test=cpu --cpu-max-prime=2000 --num-threads=4 run> post-benchmark.txt

This will create a "post-benchmark" report. To view your reports, select the file icon in the Raspbian toolbar and open the "pre-benchmark" and "post-benchmark" files; you can now compare these reports to see exactly how much CPU boost you gained!

Overclock the GPU

Now on to the GPU:

1. Open Terminal and run the following command:

sudo nano /boot/config.txt

2. Scroll down to the [pi4] section and add the following on a new line:

gpu_freq=600

If you have the latest experimental firmware, you can try increasing this number to 750.

gpu_freq=750

3. If you are overclocking both the CPU and the GPU, it might be too stressful for your overvoltage setting, so find the line that says over_voltage=2 and replace it with the following:

over_voltage=6

4. Save your changes with the Ctrl + O shortcut and quit the Nano application using the Ctrl + X shortcut.

Now all you have to do is restart your Raspberry Pi and your changes will take effect!

With a faster Raspberry Pi, you can now put it to good use. Have you tried overclocking your device? Let us know your experiences in the comments below!