Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Use nvidia-smi in Linux Environment

nvidia-smi is a command-line utility provided by NVIDIA that allows users to monitor and manage NVIDIA GPU devices installed on a system. It provides information about GPU utilization, temperature, power consumption, and memory usage. This tool is particularly important for Linux users who rely on NVIDIA GPUs for various tasks such as machine learning, data processing, and gaming.

To use nvidia-smi in the Linux environment, you need to have the NVIDIA driver installed on your system. The driver provides the necessary interface to communicate with the GPU devices. You can check if the driver is installed by running the following command in the terminal:

nvidia-smi

If the command executes successfully and displays GPU information, it means the NVIDIA driver is installed. Otherwise, you need to install the driver using the appropriate method for your Linux distribution. NVIDIA provides detailed instructions for driver installation on their website.

Once the driver is installed, you can use nvidia-smi to monitor and manage your GPU devices. Here are some common examples of using nvidia-smi in Linux:

  1. Display GPU Information: To display detailed information about all available GPUs, use the following command:
nvidia-smi

This command will show GPU utilization, memory usage, temperature, power consumption, and other relevant information for each GPU.

  1. Monitor GPU Utilization: To continuously monitor GPU utilization, you can use the following command:
watch -n 1 nvidia-smi

This will refresh the GPU utilization information every second.

  1. Limit GPU Memory Usage: If you want to limit the amount of GPU memory used by a specific process, you can use the following command:
nvidia-smi --gpu-reset -i <GPU_INDEX> -r

Replace <GPU_INDEX> with the index of the GPU device you want to limit the memory usage for. This command will reset the GPU and limit the memory usage for the specified GPU.

  1. Set GPU Fan Speed: To manually set the fan speed of a GPU, use the following command:
nvidia-smi -i <GPU_INDEX> -a [fan: <FAN_SPEED>]

Replace <GPU_INDEX> with the index of the GPU device you want to set the fan speed for, and <FAN_SPEED> with the desired fan speed percentage. This command will adjust the fan speed accordingly.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.