Commit 386e5c47 authored by zhuwenwen's avatar zhuwenwen
Browse files

update rocm.py

parent e3cacb3b
...@@ -75,12 +75,12 @@ _ROCM_DEVICE_ID_NAME_MAP: dict[str, str] = { ...@@ -75,12 +75,12 @@ _ROCM_DEVICE_ID_NAME_MAP: dict[str, str] = {
} }
# Prevent use of clashing `{CUDA/HIP}_VISIBLE_DEVICES`` # Prevent use of clashing `{CUDA/HIP}_VISIBLE_DEVICES``
if "HIP_VISIBLE_DEVICES" in os.environ: # if "HIP_VISIBLE_DEVICES" in os.environ:
val = os.environ["HIP_VISIBLE_DEVICES"] # val = os.environ["HIP_VISIBLE_DEVICES"]
if cuda_val := os.environ.get("CUDA_VISIBLE_DEVICES", None): # if cuda_val := os.environ.get("CUDA_VISIBLE_DEVICES", None):
assert val == cuda_val # assert val == cuda_val
else: # else:
os.environ["CUDA_VISIBLE_DEVICES"] = val # os.environ["CUDA_VISIBLE_DEVICES"] = val
# AMDSMI utils # AMDSMI utils
# Note that NVML is not affected by `{CUDA/HIP}_VISIBLE_DEVICES`, # Note that NVML is not affected by `{CUDA/HIP}_VISIBLE_DEVICES`,
......
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