How to Benchmark a Raspberry Pi Using Vcgencmd

Vcgencmd
(Image credit: Tom's Hardware)

The vcgencmd has been buried deep in Raspberry Pi OS for many years, but it took the Raspberry Pi 5 for us to truly learn to love it. At its most basic level, the command is used to output information from the VideoCore GPU, which forms part of the SoC. But with a few extra options / arguments we can get live CPU temperature data, voltages, clock speeds for many different components and much more. 

In this how to we will introduce the basic usage of the command and then write a custom Bash script which will benchmark any Raspberry Pi system.

Latest Videos FromTom's Hardware
Les Pounder
Associate Editor

Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".

  • bit_user
    Thanks for publishing this. I had previously used some stuff in /sys/ to get info about the CPU clockspeed and temperature, which was fine for my purposes. It would've been very nice to see some explicit confirmation of when throttling happened, however.

    A few suggestions:
    The bash script is simple enough for the data collection, but analysis would benefit from Python, at which point I'd recommend using numpy.array to hold the data. It gives you a nice way to represent tabular data in a single data structure, and then select just the columns you're interested in.
    You can then use matplotlib to make nice plots.
    As for benchmarking, stress-ng is my go-to and I think a vastly deeper tool than stress. Try it with options: –cpu 4 –cpu-method matrixprodTo exercise the GPU, I think one command I've used is: glmark2-es2 –off-screen –run-forever (of course, you should first ensure you're using the actual GPU driver and not software emulation).Overall, thanks! I hope this means we can look forward to more detailed power & temperature data in future Pi benchmarks!
    ; )
    Reply
  • DotNetMaster777
    Good description of Vcgencmd !
    Reply
  • Spardorp
    I ran into issues that my Pi didnot know the vcgencmd.
    Then I found this https://www.nicm.dev/vcgencmd/So should anyone have the same issue, use that guide to install vcgencmd.
    Reply