Is there an environment variable to only show given GPUs in `nvidia-smi` like `CUDA_VISIBLE_DEVICES`?
Feb 19, 11:18pm

There is no environment variable that directly filters the output of nvidia-smi to show only specific GPUs, similar to how CUDA_VISIBLE_DEVICES works for CUDA applications. The CUDA_VISIBLE_DEVICES environment variable only affects which GPUs are visible to CUDA applications, not the nvidia-smi command itself. nvidia-smi always shows all available GPUs on the system, regardless of CUDA_VISIBLE_DEVICES settings.

If you want to restrict the GPUs visible to your applications, you should use CUDA_VISIBLE_DEVICES. For example:

bash
export CUDA_VISIBLE_DEVICES=0,2

This will make only GPUs 0 and 2 visible to CUDA applications, but nvidia-smi will still display all GPUs in the system.

Would you like a workaround to filter the output of nvidia-smi using shell commands?

Feb 19, 11:18pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.