Open In App

How to Monitor CPU and GPU temperature in Linux

Last Updated : 01 Dec, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

This article will discuss How to Monitor CPU and GPU temperature in Linux. There are several ways to do this here in this article we will discuss a few of them. The utilization of currently running programs or applications has no bearing on the CPU or GPU temperature. Operating sensitive computer parts, such as CPUs, at temperatures over a predetermined threshold (or at higher temperatures generally) might reduce their lifespan. Additionally, it can result in thermal throttling, particularly if the fan is not delivering enough cooling. 

It is to prevent overheating from harming your system’s CPU, It is crucial to keep an eye on its temperature. In this post, we’ll discuss a few helpful command-line utilities that may be used to monitor the temperature of your CPU and GPU.

Monitoring CPU and GPU temperature in Linux

We can monitor the CPU and GPU temperature in Linux through 3 different methods:

  • Method 1: Sensors
  • Method 2: Glances
  • Method 3: Hardinfo

Now we will look at these methods to Monitor CPU and GPU temperature in Linux.

Method 1: Sensors

A command-line tool called Sensors shows the most recent values from all sensor chips, including the CPU. Some Linux distributions, like Ubuntu, come with already installed by default; if not, install it as directed.

Step 1: Execute the below command to install the sensors tool on your system.

sudo apt-get install lm-sensors

 

Step 2: Once the sensors are detected then run the following command to measure CPU temperature, GPU temperature, Fan speed, etc.

sudo sensors-detect

Output

 

After the above process, the sensors will be detected and the temperature will be shown using that sensor using the Sensors method of Monitor CPU and GPU temperature in Linux.

Method 2: Glances

Glances is a Python-based, cross-platform system monitoring program that uses curses. Your system’s data is retrieved using the psutil library. All of the necessary information is presented in one convenient location, either through a web-based interface or curses. Depending on the size of the user interface, the information changes dynamically. Glances have the ability to track a variety of system metrics, including CPU, memory, swap, system load average, process list, network interface, disc I/O, raid, sensors (such as CPU temperature), battery, filesystem utilization, Docker, monitor, alert, system info, uptime, etc.

Step 1: Execute the below command to install the glances tool.

sudo apt install glances -y

 

In the above pictures and in the next two pictures Glances is Installing

 

 

At this point, we have successfully installed Glances.  Once it is installed, start glances and press the ‘f’ key to view the sensor’s information 

Output:

 

The above picture is showing the temperature of the CPU and GPU using Glances after following the final step.

Method 3: Hardinfo 

The system profiler and benchmark program Hardinfo is compact and built for hardware analysis and report creation. It offers thorough data on system hardware and enables the creation of HTML reports on the hardware of your system.

Step 1: To install the hard info package on your Ubuntu Linux system, run the following command:

sudo apt install hardinfo

 

In the above picture, the Hardinfo is installed and after installation, it will look like above

Step 2: You can use the following command to launch hardinfo after the installation is finished and display device details.

$ hardinfo -rma devices.so

 

In above picture and next three pictures the Hardinfo is launching…..

 

 

 

Step 3: Use the following command to open the GUI app, or look for “System Profiler and Benchmark” in the system menu or Dash.

$ hardinfo

 

The above picture finally shows the CPU and GPU temperature using hardinfo method of Monitor CPU and GPU temperature in Linux

In this article, we went through useful command-line tools for viewing CPU and GPU temperatures in Ubuntu system.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads