[ROCm][AMD] unify CUDA_VISIBLE_DEVICES usage in cuda/rocm (#6352)

This commit is contained in:
Hongxia Yang
2024-07-12 00:30:46 -04:00
committed by GitHub
parent d26a8b3f1f
commit b6c16cf8ff
5 changed files with 10 additions and 34 deletions

View File

@@ -386,10 +386,6 @@ def get_open_port() -> int:
def update_environment_variables(envs: Dict[str, str]):
if is_hip() and "CUDA_VISIBLE_DEVICES" in envs:
# Propagate changes to CUDA_VISIBLE_DEVICES to
# ROCm's HIP_VISIBLE_DEVICES as well
envs["HIP_VISIBLE_DEVICES"] = envs["CUDA_VISIBLE_DEVICES"]
for k, v in envs.items():
if k in os.environ and os.environ[k] != v:
logger.warning(