Home > System Tutorial > LINUX > body text

Top 7 Linux GPU Monitoring and Diagnostic Command Line Tools

WBOY
Release: 2024-02-11 20:48:12
forward
1254 people have browsed it

A video card is a special circuit board used to control what is displayed on a computer monitor. It is also called a Graphics Processing Unit (GPU) and computes 3D images and graphics for Linux games and other purposes. Let’s take a look at the top 7 Linux GPU monitoring and diagnostics command line tools to solve your problems.

The following tools are available on Linux for GPU monitoring and diagnostic purposes, as well as on other operating systems such as FreeBSD. Today, most Linux and FreeBSD users use Nvidia, Intel, and AMD GPUs.

Linux GPU Monitoring and Diagnostic Command Line Tool

We can use the following tools to monitor, diagnose and inspect Linux or *BSD based systems.

To get graphics processor information just run:

linuxmi@linuxmi:~/www.linuxmi.com$ sudo lshw -C display -short
[sudo] linuxmi password:

The output is as follows:

H/W path                   Device      Class          Description
=================================================================
/0/100/f                               display        SVGA II Adapter
Copy after login

linuxmi@linuxmi:~/www.linuxmi.com$ lspci -v | more

1. glmark2 – Stress test GPU performance on Linux

glmark2 is an OpenGL 2.0 and ES 2.0 benchmark command line utility. We can install it by entering the following command:

linuxmi@linuxmi:~/www.linuxmi.com$ sudo apt install glmark2

Now, run as follows:

linuxmi@linuxmi:~/www.linuxmi.com$ glmark2

It will then start testing as follows and will stress test your GPU on Linux:

7大Linux GPU监控和诊断命令行工具

Linux glmark2 test screen

My benchmark results, running on Ubuntu Linux 20.04 LTS:

** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
=======================================================
    glmark2 2014.03+git20150611.fa71af2d
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa/X.org
    GL_RENDERER:   llvmpipe (LLVM 11.0.0, 256 bits)
    GL_VERSION:    3.1 Mesa 20.2.1
=======================================================
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=false: FPS: 150 FrameTime: 6.667 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=true: FPS: 164 FrameTime: 6.098 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=nearest: FPS: 190 FrameTime: 5.263 ms
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=linear: FPS: 172 FrameTime: 5.814 ms
=======================================================
                                  glmark2 Score: 169 
=======================================================
Copy after login

2., glxgears – a simple Linux GPU performance testing tool

It will display a set of rotating gears and periodically print out the frame rate. It has become extremely popular as an essential benchmarking tool for Linux and Unix-like systems like FreeBSD. Install and run it as follows:

linuxmi@linuxmi:~/www.linuxmi.com$ sudo apt install mesa-utils

linuxmi@linuxmi:~/www.linuxmi.com$ glxgears

7大Linux GPU监控和诊断命令行工具

Measures the GPU frame rate every five seconds and publishes it to the screen. The final result will look like this:

4005 frames in 5.0 seconds = 800.123 FPS
1348 frames in 5.0 seconds = 269.529 FPS
1259 frames in 5.0 seconds = 251.788 FPS
1047 frames in 5.0 seconds = 209.265 FPS
651 frames in 5.0 seconds = 130.198 FPS
651 frames in 5.0 seconds = 130.070 FPS
759 frames in 5.0 seconds = 151.732 FPS
……

3. A simple tool to get Nvidia GPU statistics on Linux and FreeBSD Unix

It is written in Python and is the perfect tool for CLI users, especially ML/AI developers. It can be installed using PIP as follows:

linuxmi@linuxmi:~/www.linuxmi.com

pip3 install gpustat

Run as follows:

linuxmi@linuxmi:~/www.linuxmi.com$ gpustat

linuxmi@linuxmi:~/www.linuxmi.com$ gpustat -cp

View help:

linuxmi@linuxmi:~/www.linuxmi.com$ gpustat -h

4. intel_gpu_top – A top-like summary showing Intel GPU usage on Linux

First install the tool and run:

linuxmi@linuxmi:~/www.linuxmi.com$ sudo apt install intel-gpu-tools

## CentOS/RHEL/Fedora Linux users try dnf command

##linuxmi@linuxmi:~/www.linuxmi.com$ sudo dnf install intel-gpu-tools

Fedora, RHEL and CentOS Linux users can use the podman command to install as follows:

linuxmi@linuxmi:~/www.linuxmi.com$ podman run –rm –priviledged registry.freedesktop.org/drm/igt-gpu-tools/igt:master

The tool collects data using performance counters (PMUs) exposed by i915 and other platform drivers such as RAPL (power) and Uncore IMC (memory bandwidth). Run it as follows on a Linux system:

linuxmi@linuxmi:~/www.linuxmi.com$ sudo intel_gpu_top

5. nvidia-smi – NVIDIA system management interface program
nvidia-smi provides monitoring and management capabilities for the Fermi and higher architecture families of NVIDIA Tesla, Quadro, GRID and GeForce devices. Most features of GeForce Titan series devices are supported, while the remaining Geforce brand information is very limited. NVSMI is a cross-platform tool that supports all standard NVIDIA drivers supported by Linux and FreeBSD. After installing the Nvidia driver on Ubuntu Linux, follow these steps to install it:

linuxmi@linuxmi:~/www.linuxmi.com$sudo apt install nvidia-smi

Open the terminal and run:

linuxmi@linuxmi:~/www.linuxmi.com nvidia-smi -q -g 0 -d UTILIZATION -l 1
linuxmi@linuxmi:~/www.linuxmi.com sudo nvidia-smi
linuxmi@linuxmi:~/www.linuxmi.com nvidia-smi –help

\6. nvtop – NVIDIA GPU top

Another great but very useful NVIDIA GPU tool. Similar to htop command or top command, it is an ncurses-based GPU status viewer for NVIDIA GPUs. We can install it as follows:

linuxmi@linuxmi:~/www.linuxmi.com

apt install nvtop ## Run this attack linuxmi@linuxmi:~/www.linuxmi.com

nvtop

7. radeontop – a tool to display AMD GPU utilization on Linux

View your AMD GPU utilization, both as a percentage of total activity and as an individual block on Linux. Install as follows:

linuxmi@linuxmi:~/www.linuxmi.com

sudo radeontop

It works with R600 and higher GPUs, even Southern Islands should work fine. Works with open source AMD drivers and AMD Catalyst clone source drivers.

Summarize

You now understand the various Linux GPU commands and tools used for monitoring and diagnostic purposes on Linux and BSD-based systems. If I missed your favorite tool, please let me know in the comments section below. Thanks. The above is the Linu system related content shared by Tutorial.com for all friends. If you want to learn more about Linux, remember to follow the official account "Linux", or scan the QR code below to follow. More useful information is waiting for you!

7大Linux GPU监控和诊断命令行工具

The above is the detailed content of Top 7 Linux GPU Monitoring and Diagnostic Command Line Tools. For more information, please follow other related articles on the PHP Chinese website!

source:lxlinux.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!