≡ 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
/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:

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
vi my-pi-temp.sh
Append the following code:

# 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+
# -------------------------------------------------------
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:
Sample outputs:

Thu 10 Mar 01:02:19 IST 2016 @ raspberrypi
GPU => temp=44.4'C
CPU => 44'C
Share this tutorial on:

{ 7 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:

  • Riven March 29, 2016, 7:22 pm

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

  • 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")"

  • hannes June 3, 2016, 7:37 am

    Thank you, great post!

    Just a simple addition to your ‘my-pi-temp.sh’ script:

    echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp | cut -d = -f2)"

    Makes the output a little cleaner ;-)

  • Larry Dighera July 25, 2016, 10:10 pm

    Below is the script I use for displaying RPi temperature and frequencies. It’s a hack, but usable.

    # Required for floating point arithmetic.  (Use bc to accommodate bash)
    # sensors.sh
    # A script to display Raspberry Pi on-board sensor data
    # LGD: Mon Dec 23 04:07:23 PST 2013
    # LGD: Mon Aug 10 14:02:46 PDT 2015: Added degree symbols, over-temperature based on degrees C so it will work without bc
    f2c(){                          # Fahrenheit to Celsius
      echo $(( ((${1}-32)*5)/9 ))
    c2f(){                          # Celsius to Fahrenheit
      echo $(( ${1}*9/5+32 ))
    addcomma(){                     # Format numbers with commas
      (echo "obase=1000"; cat) | bc | sed 's/^ *0*\([0-9]\)/\1/;s/ /,/g'
    # Display current clock frequencies
    FREQ (){ echo -e "\n\t\t\t`tput smso`  C L O C K    F R E Q U E N C I E S  `tput rmso`\n"
      for src in arm core h264 isp v3d uart pwm emmc pixel vec hdmi dpi ;do
        echo -e "\t$src\t$(vcgencmd measure_clock $src) Hz"
      done| pr --indent=5 -r -t -2 -e3
    TEMPC=$(/opt/vc/bin/vcgencmd measure_temp|awk -F "=" '{print $2}')      # Get Temp C
    TEMPf=$(echo -e "$TEMPC" | awk -F "\'" '{print $1}' 2>/dev/null)        # Get numeric-only Temp C
    TEMPF=$(c2f $TEMPf)                                                     # Convert CPU temp C to F
    OVRTMP=70                                                               # High-temp limit degrees C
    [[ `echo $TEMPC|cut -d. -f1` -gt ${OVRTMP:-70} ]] && ALRM="\n\t\t\t TOO HOT! \t TOO HOT! \t TOO HOT! "           # Check for over-temp: Max = 70C or 158F
    TEMPB4OVER=$(echo "${OVRTMP:-70}-${TEMPf}"|bc -l)                               # Calculate the number of degrees before over-temp condition
    echo -e "\n\t\t\t`tput smso`  S Y S T E M    T E M P E R A T U R E  `tput rmso`   `[[ -n $ALRM ]] || COLOR=green; setterm -foreground ${COLOR:-red}`${ALRM:-OK}"; setterm -foreground white
    echo -e "\n\tThe BCM2835 SoC (CPU/GPU) temperature is: ${TEMPF}° F\t(${TEMPf}° C) `tput smso;setterm -foreground red`$ALRM`setterm -foreground white;tput rmso`"        # ksh & bash
    echo -e "\t\t(${OVRTMP:-70}° C HIGH-TEMP LIMIT will be reached in `tput smso`${TEMPB4OVER}° C`tput rmso` higher)\n"
    echo -e "\n\t\t\t`tput smso`  S Y S T E M    V O L T A G E S  `tput rmso`"
    echo -e "\n\tThe Core voltage is:\t\t\c"
    /opt/vc/bin/vcgencmd measure_volts core|awk -F "=" '{print $2}'
    echo -e "\tThe sdram Core voltage is:\t\c"
    /opt/vc/bin/vcgencmd measure_volts sdram_c|awk -F "=" '{print $2}'
    echo -e "\tThe sdram I/O voltage is:\t\c"
    /opt/vc/bin/vcgencmd measure_volts sdram_i|awk -F "=" '{print $2}'
    echo -e "\tThe sdram PHY voltage is:\t\c"
    /opt/vc/bin/vcgencmd measure_volts sdram_p|awk -F "=" '{print $2 "\n"}'

Leave a Comment

   Tagged with: , ,