diff --git a/sample_factory/utils/gpu_utils.py b/sample_factory/utils/gpu_utils.py index fec0f4553..d94673f30 100644 --- a/sample_factory/utils/gpu_utils.py +++ b/sample_factory/utils/gpu_utils.py @@ -24,7 +24,7 @@ def get_available_gpus() -> List[int]: Returns indices of GPUs specified by CUDA_VISIBLE_DEVICES. """ orig_visible_devices = os.environ[f"{CUDA_ENVVAR}"] - available_gpus = [int(g.strip()) for g in orig_visible_devices.split(",") if g] + available_gpus = [int(g.strip()) for g in orig_visible_devices.split(",") if g and not g.isspace()] return available_gpus