In the high-performance computing, Nvidia Graphics Processing Units (GPUs) have emerged as powerful devices that excel at handling complex computations and graphics-intensive tasks. By using the nvidia-smi command, we can easily retrieve the GPU count. It can be useful for optimizing workloads, allocating resources effectively in multi-GPU environments and configuring GPU-specific software. This tutorial explains how to get the number of Nvidia GPUs on a system using nvidia-smi.
The nvidia-smi is a command line tool that comes bundled with the Nvidia GPU driver package. It is available on Windows and Linux systems.
To obtain the number of Nvidia GPUs on the system, use the following:
nvidia-smi --query-gpu=count --format=csv,noheader
After running the command, the output will present a single number that indicates the count of Nvidia GPUs detected on the system. Output example:
1
Leave a Comment
Cancel reply