Check and Monitor Active GPU in Linux
Last Updated :
31 Jul, 2024
Monitoring the GPU(Graphics Processing Unit) on a Linux operating system is essential for performance testing, debugging, and ensuring usage. There are many tools for checking and monitoring the GPU activity of various GPUs like Nvidia, AMD, or Intel GPU. This article will teach us about multiple methods to check GPU monitors in the Linux Operating System.
What is GPU(Graphical Processing Unit)
In Computer systems, a graphical Processing Unit (GPU) is an electronic circuit designed to accelerate the processing of images and video. The main purpose of GPU is to render graphics in computer games and other visual applications. GPUs have evolved to handle a wide range of computational tasks.
Using 'lspci' command
The 'lspci' command is used in Linux to display information about all PCI (Peripheral Component Interconnect) buses in the system and the devices connected to them. It means this command shows all the PCI devices along with the GPUs
lspci | grep -i 'vga\|3d\|2d'
Output
Using nvidia-smi for(NVIDIA GPUs)
If you are are using the nvidia GPU and the NVIDIA drives installed, you can use 'nvidia-smi' to get detailed information about your GPU.
nvidia-smi
Using 'glxinfo' (For OpenGL information)
We can also used glxinfo command for getting information about the OpenGL implementation including the active GPU in the Linux operating system.
glxinfo | grep "OpenGL renderer"
Output
Using 'watch' with 'lspci'
There is one more command which is watch command with lspci. This commands allows you to continuously monitor the output of the lspci cmmand at regular intervals. This can be useful for observing changes in PCI devices in real-time , such as when you're adding or removing hardware components.
To watch the output of lscpi and update it every 2 seconds, You can use this command in linux operating system.
watch lspci
Output
Using htop with GPU Metrics
There is htop command in linux operating system that using to monitor GPU metrics can be very helpful for tracking GPU usage, memory, temperature, and other important parameters. In some distore does not include htop command. In this case you have to installed the htop command using the package manger.
htop
Output
Conclusion
In this article, we have learned to check and monitor active GPU usage in Linux Operating System. You can use several tools depending on your GPU type. For NVIDIA GPUs, the 'nvidia-smi' tool, which comes with the NVIDIA driver package, provides detailed information about GPU usage, including utilization, memory usage, temperature, and running processes You can watch GPU usage in tmux with running multiple commands. This allows you to run 'htop' in one pane for CPU monitoring and 'nvidia-smi' or 'radeontop' in another pane for GPU monitoring. It gives your a comprehensive view of system performance.
Similar Reads
How to Monitor System Activity in Linux | top Command
top command is used to show the Linux processes. It provides a dynamic real-time view of the running system. Usually, this command shows the summary information of the system and the list of processes or threads which are currently managed by the Linux Kernel. As soon as you will run this command it
10 min read
How to Monitor CPU and GPU temperature in Linux
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 pa
4 min read
ACPI command in Linux with examples
ACPI is the command in Linux that helps the users in managing power settings. It also helps in monitoring the hardware status efficiently. It facilitates with providing essential information such as battery health, CPU temperatures, and fan speeds, providing support in system maintenance and perform
4 min read
acpid command in Linux with Examples
The acpid daemon provides intelligent power management on a system and allows to query battery and configuration status by supporting the Advanced Configuration and Power Interface (ACPI). The ACPI events are notified to the user-space programs by acpid. The ACPI (Advanced Configuration and Power In
3 min read
acpi_available command in Linux with examples
acpi_available is a command in Linux that tests whether the ACPI (Advanced Configuration and Power Interface) subsystem is available or not. Syntax$ acpi_availableReturn Statuses of acpi_availableThe command returns one of three possible statuses:Status 0: Indicates that the ACPI subsystem is availa
2 min read
How to Check and Patch Meltdown CPU Vulnerability in Linux?
Here we will check and Patch Meltdown CPU Vulnerability in Linux. CPU hardware implementations are found vulnerable to side-channel attacks, They are known as: MeltdownSpectre Meltdown: It is a security vulnerability found in hardware that is affecting Intel x86 microprocessors, IBM POWER processors
3 min read
How to Install and Use Htop on Linux?
Htop is a powerful and interactive system-monitoring tool for Linux, offering a real-time, user-friendly interface to track system performance. It provides detailed information on system processes, CPU usage, memory usage, and more. This guide will walk you through the steps to install and use Htop
3 min read
lsmod command in Linux with Examples
lsmod command is used to display the status of modules in the Linux kernel. It results in a list of loaded modules. lsmod is a trivial program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded. Syntax: lsmod Example: Run lsmod at the command lin
1 min read
arch command in Linux with examples
The arch command is a simple yet powerful utility in Linux used to display the architecture of the system's hardware. By running this command, users can quickly determine the type of processor their system is running on, such as i386, x86_64, or arm. Knowing the architecture is crucial for installin
2 min read
How to check Fibre Channel HBAs in Linux?
Fibre Channel (FC) Host Bus Adapters (HBA) are interface cards that link the host system to a fibre channel network or devices. QLogic and Emulex are the two leading producers of FC HBAs, and many HBA drivers are provided in-box with the operating systems. If the drivers are not offered by your Linu
2 min read