Commit abf008ef authored by zhuwenwen's avatar zhuwenwen
Browse files

resolve the issue of requiring HIP_VISIBLEDEVICES to be set in order to run multiple cards

parent 469a3a88
......@@ -48,10 +48,13 @@ class MultiprocessingDistributedExecutor(DistributedExecutorBase):
f"is less than than max local gpu count ({cuda_device_count})")
# Set CUDA_VISIBLE_DEVICES for the driver, inherited by workers
if "CUDA_VISIBLE_DEVICES" not in os.environ:
if "CUDA_VISIBLE_DEVICES" or "HIP_VISIBLE_DEVICES" not in os.environ:
update_environment_variables({
"CUDA_VISIBLE_DEVICES": (",".join(map(str, range(world_size))))
})
update_environment_variables({
"HIP_VISIBLE_DEVICES": (",".join(map(str, range(world_size))))
})
def _init_executor(self) -> None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment