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:
bashexport 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?