How to find out Raspberry Pi GPU and ARM CPU temperature on Linux nixCraft Updated Tutorials/Posts

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

The Raspberry Pi is a small and affordable computer for student and hobbyist. You can us it to learn programming, Linux, sysadmin and devops stuff. One can easily find out the Raspberry Pi GPU and ARM CPU core 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

Raspberry Pi get temperature – 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

Conclusion

This page explained how to monitor the core temperature of your Raspberry Pi. For more info see this page.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Facebook Comments

More Stuff

Helios4 Arm-Based Open Source NAS SBC For Linux/FreeBSD nixCraft Helios4 is ARM-based open source NAS SBC (Single-board computer) for Linux. This NAS (Network Attached Storage) comes with 4 SATA 3.0 port and comes w...
How the four components of a distributed tracing system work toget... Ten years ago, essentially the only people thinking hard about distributed tracing were academics and a handful of large internet companies. Today, it...
Why containers are the best way to test software performance Software performance and scalability are frequent topics when we talk about application development. A big reason for that is an application's perform...
Installing Nginx Web Server with MariaDB and PHP/PHP-FPM on Fedora... Fedora 23 has been released just a few days ago and we have been closely following ever since. We have already covered the installation of Fedora 23 W...
Spread the love

Posted by News Monkey