@J_Na I had the same problem and created a package available on github 69 that can parse the output of nvidia-smi automatically and returns a list of all unused gpus. The gpus are filtered in python (not by nvidia-smi) so you could redefine “available” to mean whatever criterion you prefer.