Raspberry Pi boosts Pi 5 performance with SDRAM tuning

tl;dr Raspberry Pi engineers tweaked SDRAM timings and other memory settings on the Pi, resulting in a 10-20% speed boost at the default 2.4 GHz clock. I of course had to test overclocking, which got me a 32% speedup at 3.2 GHz! Changes may roll out in a firmware update for all Pi 5 and Pi 4 users soon.

Raspberry Pi 5 with SDRAM tweaks applied on desk

My quest for the world record Geekbench 6 score on a Pi 5 continues, as a couple months ago Martin Rowan used cooling and NUMA emulation tricks to beat my then-record score.

But Raspberry Pi's engineers are tweaking memory timings even further. They've talked to Micron and implemented a number of small tweaks that—along with NUMA emulation—really add up to a performance improvement for multi-core workloads. And even a little improvement for single-core!

The sdram refresh interval is currently using the default data sheet settings. You can actually monitor the temperature of the sdram and it reports if refresh at half or quarter the rate can be done. That allows the overhead due to refresh to be reduced by a half or a quarter which does improve benchmark results.

We got in contact with Micron, and there is good news. They have said they actually test their 8GB sdram with the 4GB refresh rate timing (rather than the slower jedec timings), and so it was be safe to run the 8GB parts with 4GB timing.

The tweaks can also give the Pi 4 a boost, but the Pi 5 improves more dramatically:

Pi 5 also has faster sdram, better access to sdram (i.e. wider/faster internal buses), so generally the improvements with NUMA are greater.

SDRAM Tweaks

To get the latest RAM speedups for now (this may be default soon):

  1. Update the Pi's firmware to the latest version: sudo rpi-update (confirm with Y)
  2. Edit the bootloader config: sudo rpi-eeprom-config -e
  3. Add the configuration SDRAM_BANKLOW=1 (for Pi 5... for Pi 4, use 3)
  4. Reboot

NUMA Emulation

Since my first post on NUMA emulation on the Pi 5, the patches required have been added to Raspberry Pi's OS kernel.

So to use NUMA, all you have to do is make sure you're on the latest Pi OS (e.g. sudo apt full-upgrade).

To check if NUMA emulation is working, run dmesg | grep NUMA and make sure it says something like mempolicy: NUMA default policy overridden to 'interleave:0-7'. You can tweak the settings if you want by adding numa=fake=[n] inside /boot/firmware/cmdline.txt, though the defaults should be appropriate for most use cases.

Overclocking

Following my own guide for overclocking the Pi 5, I set the following inside /boot/firmware/config.txt:

over_voltage_delta=72000
arm_freq=3200
gpu_freq=1000

After rebooting, I set the fan to 100%, hacked the kernel with my pi-overvolt project to boost the core voltage, and set the scaling governor to performance:

$ pinctrl FAN_PWM op dl
$ cd pi-overvolt && sudo ./removelimit && vcgencmd cache_flush
$ echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

Geekbench World Record, Part 2

With just the default firmware changes, my Geekbench scores already increase quite a bit (+8% single, +18% multi). Adding a 3.2 GHz overclock on top (using my pi-overvolt hack to boost voltages), those increases go to +32% single, +31% multi, resulting in yet another world-record Geekbench 6 score!

Geekbench Result Pi 5 - defaults SDRAM + NUMA 3.2 GHz OC
Single 833 899 (+8%) 1153 (+32%)
Multi 1805 2169 (+32%) 2468 (+31%)

I also ran these tests with just an Argon THRML 30-AC Active Cooler. To try to keep temps under control, I boosted the fan speed to 100%: pinctrl FAN_PWM op dl.

A word on overclocking: I've now overclocked around 20 Pi 5s, and found most to be capable of 2.6 or 2.8 GHz, and many (about half) to be capable of 3.0 GHz. But beyond that, very few can hit 3.1 GHz or beyond. More exotic overclocking (to 3.4 or 3.5 GHz) is much more difficult, and I've only had one Pi 5 that even boots reliably at those speeds, with more extensive cooling. RAM timings were already not happy at those speeds, and with the extra SDRAM tweaks, I imagine extreme overclocking will be even more unstable.

Conclusion

These optimizations could become default soon. I started looking into this after someone on Twitter mentioned seeing Pi 500 Geekbench results starting in September—all seemingly with these tweaks in place already!

Memory speed has been a thorn in the Pi 5's side in comparison to many RK3588 boards. It's nice to see the SDRAM tweaks giving it a significant speed boost, over a year post-launch.

And eagle-eyed readers may note I only overclocked to 3.2 GHz instead of 3.4 GHz this time. I'll leave the door open for someone else to combine all the above tricks to hit another new WR score ;)

Comments

For the Pi 5, see the benchmark results table—the first result is a Pi 5 with current Pi OS out of the box (unaltered), the second result is with the firmware update and new NUMA and SDRAM tweaks applied (which is the most significant gain). Third result is with a ridiculous 3.2 GHz overclock that is quite overkill for most people.

Thanks for the optimizations Jeff. I always look forward to reading your latest posts on the RPs and trying them out at home. The RP5 seems indeed a bit snappier now and becoming more viable as a "light' desktop PC for the basics with the applied changes, NVME drive and overclocking. Its not the destination and end result but the journey itself which makes it fun to tinker with the raspberry pi.

Great! But kind of baffling to hear only now their memory supplier tells them how to properly use their product

According to the forum post, they originally followed the spec sheet, but after investigation and after discussing it with Micron, they found out the spec sheet was too conservative with the numbers. So then they pushed it. I'd rather have engineers start from the documentation and follow specs, then later adjust if possible, than YOLOing things for best performance first!

Hello Jeff! We are designing an expansion board based on the CM5, featuring rich functionalities and ease of use—perfect for makers and developers. We’d be happy to send you a sample for unboxing and review to share your experience. Would you be interested? Looking forward to hearing from you! 😊

The stock clock SDRAM + NUMA result in the table doesn't match the body text - 1805 -> 2169 is ~20%.