Monitoring CPU and GPU Temperatures on Linux
Last updated May 19, 2020 By Community 30 Comments
Brief: This articles discusses two simple ways of monitoring CPU and GPU temperatures in Linux command line.
Because of Steam (including Steam Play, aka Proton) and other developments, GNU/Linux is becoming the gaming platform of choice for more and more computer users everyday. A good number of users are also going for GNU/Linux when it comes to other resource-consuming computing tasks such as video editing or graphic design (Kdenlive and Blender are good examples of programs for these).
Whether you are one of those users or otherwise, you are bound to have wondered how hot your computer’s CPU and GPU can get (even more so if you do overclocking). If that is the case, keep reading. We will be looking at a couple of very simple commands to monitor CPU and GPU temps.
Since we are talking about commands, you may want to learn how to get GPU details in Linux command line.
My setup includes a Slimbook Kymera and two displays (a TV set and a PC monitor) which allows me to use one for playing games and the other to keep an eye on the temperatures. Also, since I use Zorin OS I will be focusing on Ubuntu and Ubuntu derivatives.
To monitor the behaviour of both CPU and GPU we will be making use of the watch command to have dynamic readings every certain number of seconds.
Monitoring CPU Temperature in Linux
For CPU temps, we will combine sensors with the watch command. The sensors command is already installed on Ubuntu and many other Linux distributions. If not, you can install it using your distribution’s package manager. It is available as sensors or lm-sensors package.
An interesting article about a gui version of this tool to check CPU temperature has already been covered on It’s FOSS. However, we will use the terminal version here:
The watch command guarantees that the readings will be updated every 2 seconds (and this value can — of course — be changed to what best fit your needs):
Amongst other things, we get the following information:
- We have 6 cores in use at the moment (with the current highest temperature being 37.0ºC).
- Values higher than 82.0ºC are considered high.
- A value over 100.0ºC is deemed critical.
The values above lead us to the conclusion that the computer’s workload is very light at the moment.
Monitoring GPU Temperature in Linux
Let us turn to the graphics card now. I have never used an AMD dedicated graphics card, so I will be focusing on Nvidia ones. The first thing to do is download the appropriate, current driver through additional drivers in Ubuntu.
On Ubuntu (and its forks such as Zorin or Linux Mint), going to Software & Updates > Additional Drivers and selecting the most recent one normally suffices. Additionally, you can add/enable the official ppa for graphics cards (either through the command line or via Software & Updates > Other Software ).
After installing the driver you will have at your disposal the Nvidia X Server gui application along with the command line utility nvidia-smi (Nvidia System Management Interface). So we will use watch and nvidia-smi:
And — the same as for the CPU — we will get updated readings every two seconds:
The chart gives the following information about the graphics card:
- it is using the open source driver version 418.56.
- the current temperature of the card is 54.0ºC — with the fan at 0% of its capacity.
- the power consumption is very low: only 10W.
- out of 6 GB of vram (video random access memory), it is only using 433 MB.
- the used vram is being taken by three processes whose IDs are — respectively — 1557, 1820 and 7820.
Most of these facts/values show that — clearly — we are not playing any resource-consuming games or dealing with heavy workloads. Should we started playing a game, processing a video — or the like —, the values would start to go up.
Althoug there are gui tools, I find these two commands very handy to check on your hardware in real time.
What do you make of them? You can learn more about the utilities involved by reading their man pages.
Do you have other preferences? Share them with us in the comments, ;).
Halof. (Have a lot of fun. ).
It’s FOSS Community Contributor
I developed a liking for electronics, linguistics, herpetology and computers (particularly GNU/Linux and FOSS). I am LPIC-2 certified and currently work as a technical consultant and Moodle administrator in the Department for Lifelong Learning at the Ministry of Education in Murcia, Spain. I am a firm believer in lifelong learning, the sharing of knowledge and computer-user freedom.
Like what you read? Please share it with others.
How to measure GPU usage?
Using the top command in the terminal lists processes, sorted by their CPU usage (and you can change it to sort by another parameter)
Is there an equivalent for the GPU?
8 Answers 8
- For Nvidia GPUs there is a tool nvidia-smi that can show memory usage, GPU utilization and temperature of GPU.
- For Intel GPU’s you can use the intel-gpu-tools.
AMD has two options
fglrx (closed source drivers):
Nvidia: to continuously update the output of nvidia-smi , you can use nvidia-smi —loop=1 (refresh interval of 1 second) or nvidia-smi —loop-ms=1000 (refresh interval of 1000 milliseconds).
You can use gpustat , which is a simple command-line script (wrapper for nvidia-smi) for querying and monitoring GPU status:
Install intel-gpu-tools (its likely that they are installed already)
Start the top like utility with
Check your stats and then exit with Ctrl + C
Thats what you get:
You can use the monitoring program glances with its GPU monitoring plug-in:
- open source
- to install: sudo apt-get install -y python-pip; sudo pip install glances[gpu]
- to launch: sudo glances
It also monitors the CPU, disk IO, disk space, network, and a few other things:
I use the following command:
and it gives me updates every 2 seconds.
I like to use conky as a real-time monitor for both CPU and GPU. Installation is straightforward:
Intel i7-6700HQ iGPU HD 530
In this instance I’ve booted using the integrated GPU rather than the nVidia GTX 970M:
The conky code adapts depending on if booted with prime-select intel or prime-select nvidia :
nVidia GPU GTX 970M
In this instance I’ve booted using the nVidia GTX 970M rather than the integrated GPU:
The conky code was recently modified to auto-sense the GPU. Now it doesn’t have to be hand modified when rebooting to a different GPU:
Different versions of the full code listing can be found in these answers:
Hardware, programming and astronomy tutorials and reviews.
Monitoring AMD, Intel and NVIDIA graphics card usage under Linux
Graphics card resource usage monitoring is quite rare. Most desktop widgets and applications will just show CPU and RAM usage. There are however tools that can be used to monitor AMD, nVidia and Intel graphics cards under Linux. It can be used for fancy graphics or to locate the weakest chain in the GPU rendering process when trying to determine why some tasks are so slow.
In case of Intel integrated GPUs we can use some tools from intel-gpu-tools, like for example:
- intel_gpu_time: just like time , but will show average CPU and GPU usage for the application it started.
- intel_gpu_top: just like top , but for the GPU, not CPU.
So when using:
intel_gpu_top in action
intel_gpu_top can also log to file (check —help for such options).
For the closed source driver we can use nvidia-smi, which will show GPU temperature, fan speed and memory usage. Some fully supported models will have more detailed data displayed (use —help to see extra options, a list of supported models as well as other goodies like a Python library). At the moment the list looks like so:
nvidia-smi in action
You can also try using nvidia-settings.
For example I’ve noticed that old Quadro FX 580 had a big FPS drop from 66.37 to 21.3 on Xonotic phoronix benchmarks between High and Ultra quality. Looking at GPU memory usage (512MB) at ultra the GPU was quite likely lacking needed RAM space as whole RAM was used. At high quality there are only few MB of RAM free. Graphics cards with more RAM doesn’t show such effect in Xonotic benchmarks and drop FPS more gently with increasing quality.
For the binary closed source driver (fglrx) we can use aticonfig, although it won’t give much:
For the open (radeon) and closed source drivers we can use more advanced radeontop (also available in some repositories, like Ubuntu).
aticonfig in action
radeontop output during benchmarks
There is also a desktop application — radeon-profile which works with open and closed source drivers.
Linux and programming, 12 May 2014, Piotr Maliński
Improving Celeron J1900 gaming performance by connecting external graphics card to PCIe x1 2.0 slot
Low power Bay Trail, Celeron or AMD APU Athlons, Semprons are storming the market allowing users to create quiet or even fanless PCs for multimedia or daily home use. Most of motherboards offer PCIe connect, but as a limited to x4 (AMD) or x1 (Intel) version. We can connect a USB3 or Firewire 800 PCIe controller to it, but can we use an external graphics card to improve the gaming performance of such low power quiet PCs? Can PCIe x1 2.0 can provide enough bandwidth for the GPU to perform at a good or acceptable level? Or maybe can it give some extra features like CUDA cores or multiple display support that can be used to some specific tasks?
In this article I’ll test and compare three basic and cheap graphics cards I got from local bidding site quite cheap. Will Celeron J1900 be able to run games faster and what will be the difference between x1 and x16 on a classical motherboard?
Benchmarking Celeron J1900 on Xubuntu Linux
After building a PC with Celeron J1900 it’s time to run some benchmarks. Aside of other Intel CPUs there are AMD competitors like new Sempron and Athlon 25W CPUs with good graphics or the old E-350 still available on the market. Most of them are similarly priced.
To run benchmarks I’ve used phoronix benchmark tool, as well some bootchart for system boot up time charts and power usage monitor to check how much power the PC is taking.
Angry Birds Go — a race game with unexpected problems on Android
Angry Birds Go! is a new game made by Rovio with a Angry Birds theme. This time we will be racing to get to the final prize. Our team will consist of birds as well as of piggies.
On the other side the game faces some hardware/software problems. Many good-brand devices is marked as incompatible. Secondly many players are reporting problems with the game — crashes, blank screens and so on. So we have a good game and surprising problems.
Testing small external lenses for phones and other mobile devices
China can make quite interesting gadgets like for example external lenses for phones and other devices. They alter how the built-in lens works allowing for wide field, macro or telephoto effect. Some will even give you fish-eye ultra wide field effect. Such lenses cost few Euros and are quite basic in design. I’ll take a look at two of them — 2x telephoto and macro/wide field lens.
RkBlog — email@example.com. Hosting megiteam.pl.
Site uses third party cookies and traffic analytics. No login or registration is required. Site uses Disqus third party widget for comments.