≡ Menu

How to find out Raspberry Pi GPU and ARM CPU temperature on Linux

I am using a Raspberry PI 2/3 credit size computer. How do I find out my GPU or ARM CPU temperature from Linux operating system command line option?

You can easily find out the GPU and ARM CPU temperature using the following commands.

Show Raspberry Pi GPU temperature

Open the Terminal application and type the following command to view GPU (Graphics Processing Unit) temperature:
vcgencmd measure_temp
OR
/opt/vc/bin/vcgencmd measure_temp
Sample output:

Fig.01: Find Raspberry pi GPU temperature

Fig.01: Find Raspberry pi GPU temperature

Display Raspberry Pi ARM CPU temperature

Type the following cat command:
cat /sys/class/thermal/thermal_zone0/temp
Divide it by 1000 to get the ARM CPU temperature in more human readable format:

cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$((cpu/1000)) c"

Sample outputs:

Fig.02: Check on the ARM CPU temperature of Raspberry Pi

Fig.02: Check on the ARM CPU temperature of Raspberry Pi

Putting it all together

Create a simple bash script called my-pi-temp.sh to see both ARM CPU and GPU temperature of Raspberry Pi. Type the following command:
nano my-pi-temp.sh
OR
vi my-pi-temp.sh
Append the following code:

#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU  temperature of Raspberry Pi 2/3 
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"

Save and close the file. Set permission:
chmod +x my-pi-temp.sh
Run it as follows:
./my-pi-temp.sh
Sample outputs:

Thu 10 Mar 01:02:19 IST 2016 @ raspberrypi
-------------------------------------------
GPU => temp=44.4'C
CPU => 44'C
Share this tutorial on:
{ 5 comments… add one }
  • onebuck March 12, 2016, 2:52 pm

    The temperature sensor for the SoC is on the same silicon. Your reading the same sensor for CPU when you say access to GPU. Propagation(delay) is what you are seeing when accessing the temperature for the CPU when you are assigning for the GPU temperature. Same sensor, CPU temperature access is correct but your GPU does not have a sensor independently. Just a CPU temperature can be truly accessed. Leave out the GPU temp and you will be correct. Same metric for temperatures.

    • meow April 28, 2016, 11:05 am

      You are right, no need for measuring CPU and GPU separately for SoC.

  • Riven March 29, 2016, 7:16 pm

    best way to see thermal temps and arm_freq via terminal command:
    while true; do vcgencmd measure_clock arm; vcgencmd measure_temp; sleep 1; done

    To check it under 100% CPU load:
    sudo apt-get install sysbench
    while true; do vcgencmd measure_clock arm; vcgencmd measure_temp; sleep 1; done& sysbench –num-threads=8 –test=cpu –cpu-max-prime=10000000000 run

    For optimizing, benching, and overclocking, see:
    https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=138840

  • Riven March 29, 2016, 7:22 pm

    to see all cores and load % (hit ‘1’), enter in terminal:
    top

  • dmaraid April 10, 2016, 7:08 am

    In one line:

    echo -e "CPU => $(echo "scale=1; $(cat /sys/class/thermal/thermal_zone0/temp)/1000" | bc)'C\nGPU => $(/opt/vc/bin/vcgencmd measure_temp | sed "s/^.....//g")"

Leave a Comment


   Tagged with: , ,