Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to monitor the behavior of CPU and GPU in Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to monitor the behavior of CPU and GPU in Linux". In the daily operation, I believe that many people have doubts about how to monitor the behavior of CPU and GPU in Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the questions of "how to monitor the behavior of CPU and GPU in Linux". Next, please follow the editor to study!

Monitor CPU temperature in Linux

For the CPU temperature, we will use the watch with the sensors command. An interesting article about the graphical user interface version of this tool has been introduced in It's FOSS. However, we will use the command line version here:

Watch-n 2 sensors

Watch ensures that the readings are updated every 2 seconds (of course, the periodic value can be changed according to your needs):

Every 250s: sensorsiwlwifi-virtual-0Adapter: Virtual devicetemp1: + 39.0° Cacpitz-virtual-0Adapter: Virtual devicetemp1: + 27.8C (crit = + 119.0 °C) temp2: + 29.8C (crit = + 119.0 °C) coretemp-isa-0000Adapter: ISA adapterPackage id 0: + 37.0C (high = + 82.0C, crit = + 100.0 °C) Core 0: + 35.0C (high = + 82.0C, crit = + 100.0 °C) Core 1: + 35.0C (high = + 82.0C, crit = + 100.0 °C) Core 2: + 33.0C (high = + 100.0 °C) Crit = + 100.0 °C) Core 3: + 36 °C (high = + 82 °C, crit = + 100.0 °C) Core 4: + 37 °C (high = + 82 °C, crit = + 100.0 °C) Core 5: + 35 °C (high = + 82 °C, crit = + 100.0 °C)

In addition, we can also get the following information:

We have five cores in use (and the current maximum temperature is 37.0 ℃).

Temperatures above 82 ℃ are considered to be overheated.

Temperatures above 100.0 ℃ are considered to exceed the threshold.

Based on the above temperature, we can conclude that the current workload of my computer is very small.

Monitor GPU temperature in Linux

Now let's take a look at the graphics card. I have never used an AMD graphics card, so I will focus on the Nvidia graphics card. The first thing we need to do is to download the appropriate latest driver from the Ubuntu add-on driver.

In Ubuntu (the same for Zorin or Linux Mint), go to the "Software and updates > additional drivers" option and select the latest available drivers. In addition, you can add or enable the official ppa of the graphics card (via the command line or through "Software and updates > other Software"). After installing the driver, you will be able to use the "Nvidia X Server" GUI program as well as the command line tool nvidia-smi (Nvidia system Administration Interface). So we will use watch and nvidia-smi:

Watch-n 2 nvidia-smi

As in the case of CPU, we get updated readings every two seconds:

Every 2000s: nvidia-smiFri Apr 19 20:45:30 2019 Nvidia-SMI Driver Version: 418.56 CUDA Version: 10.1 | |- -- + | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | = = + = | 0 GeForce GTX 106. Off | 00000000433MiB 00.0 On | Nameba | | 0% 54C P8 10W / 120W | 433MiB / 6077MiB | 4% Default | +-+ +- -+ | Processes: GPU Memory | | GPU PID Type Process name Usage | | = = | | 0 1557 G / usr/lib/xorg/Xorg 190MiB | | 0 1820 G / usr/bin/gnome-shell 174MiB | | 0 7820 G... equest-channel-token=303407235874180773 65MiB | +-- -+

From this table, we get the following information about the display card:

It is using an open source driver with version 418.56.

The current temperature of the video card is 54.0 ℃ and the fan usage is 0%.

Electricity consumption is very low: only 10W.

The total amount of vram (Video Random access memory) is 6GB and only 433MB is used.

Vram is being used by three processes with ID of 1557, 1820, and 7820, respectively.

Most of these facts or numbers make it clear that we are not playing any games that consume system resources or dealing with heavy tasks. These values start to rise when we start playing games, dealing with videos, or other similar tasks.

At this point, the study on "how to monitor the behavior of CPU and GPU in Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report