Linux, CPU and GPU Behavior Monitoring

Since Steam (including Steam Play, namely Proton) and a number of other developments, the GNU / Linux  is becoming more and more choices everyday gaming platform of computer users. There are also a considerable number of users in the face like video editing or graphic design (Kdenlive Blender and such application is a good example) when the resource-consuming computing task will use GNU / Linux.

Whether you are a user of one of these or other users, you also will want to know your computer CPU and GPU how hot can (if you want to overclock will be more so). If so, then read on. We will introduce two very simple command to monitor CPU and GPU temperature.

My apparatus comprises a Slimbook Kymera and two monitors (one monitor TV and a PC), so that I can play a game, watch another to monitor the temperature. In addition, because I use Zorin OS, I will focus on the Ubuntu derivative distributions and Ubuntu.

In order to monitor the behavior of the CPU and GPU, we will use practical watch  command to dynamically get readings after every few seconds.

Monitor CPU temperature in Linux

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

watch -n 2 sensors

will watch to ensure that the reading time (of course, this cycle values ​​can change according to your needs) updated every 2 seconds:

Every 2,0s: sensors

iwlwifi-virtual-0
Adapter: Virtual device
temp1: +39.0°C

acpitz-virtual-0
Adapter: Virtual device
temp1: +27.8°C (crit = +119.0°C)
temp2: +29.8°C (crit = +119.0°C)

CoreTemp-one-0000
Adapter: ISA adapter
Package id 0: +37.0°C (high = +82.0°C, crit = +100.0°C)
Core 0: +35.0°C (high = +82.0°C, crit = +100.0°C)
Core 1: +35.0°C (high = +82.0°C, crit = +100.0°C)
Core 2: +33.0°C (high = +82.0°C, crit = +100.0°C)
Core 3: +36.0°C (high = +82.0°C, crit = +100.0°C)
Core 4: +37.0°C (high = +82.0°C, crit = +100.0°C)
Core 5: +35.0°C (high = +82.0°C, crit = +100.0°C)

In addition, we can obtain the following information:

  • We have five core is being used (and the current maximum temperature of 37.0 ℃).
  • Temperature exceeds 82.0 deg.] C is considered to be overheated.
  • 100.0 deg.] C over the temperature will be considered exceeding a critical value.

According to the above temperature values ​​we can conclude that my computer now work load is very small.

GPU temperature monitoring in Linux

Now let's look at the video card. I never used AMD graphics card, so I will focus on the Nvidia graphics card. The first thing we need to do is to download the latest drivers from the appropriate additional driving Ubuntu's.

In Ubuntu (Zorin or Linux Mint is the same), go to "Software and Updates> Additional Drivers" option, select the latest available drivers. In addition, you can add or official ppa enabled graphics card (be accomplished through the command line or through the "software and updates> Other Software"). After installing the driver, you will be able to use the "Nvidia X Server" GUI program and command-line tools nvidia-smi (Nvidia System Management Interface). Therefore, we will use the watch and nvidia-smi:

watch -n 2 nvidia-smi

As in the case of the CPU, we will get readings every two seconds in the last update:

Every 2,0s: nvidia-smi

Fri Apr 19 20:45:30 2019
+-----------------------------------------------------------------------------+
| Nvidia-SMI 418.56 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 | 00000000:01:00.0 On | N/A |
| 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 graphics card:

  • It is using the version number is 418.56 open source drivers.
  • The current temperature display card is 54.0 ℃, and the fan is used in an amount of 0%.
  • Power consumption is very low: only 10W.
  • 6GB total amount of VRAM (video random access memory), using only 433MB.
  • vram is being used by three processes, their ID 1557,1820 and 7820 respectively.

Most of these values ​​are clearly facts or that we did not play any games or consumption of system resources large load processing tasks. When we started playing games, video processing, or other similar tasks, these values ​​will begin to rise.

in conclusion

Even if we have GUI tools, but I found these two commands for real-time monitoring hardware is very handy.

How would you go to use them? You can learn more about these tool tips by reading their man pages.

There are other tools you prefer it? We share it in the comments;).

have fun!

Guess you like

Origin www.cnblogs.com/linuxprobe-sarah/p/11014598.html