From 81b9d206163aa4f24e7249419673fd5464374869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20L=C3=B8land=20Bore?= <31211370+sigbjobo@users.noreply.github.com> Date: Fri, 20 Sep 2024 22:43:57 +0200 Subject: [PATCH] Set ROCM_ROOT to ROCM_PATH when it exist (#4150) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This small commit closes issue #4149 by checking if `rocm_root` is not set, and then inferring it from `rocm_path`, if it exists. ## Summary by CodeRabbit - **New Features** - Enhanced flexibility in retrieving the ROCM root directory by checking both `ROCM_ROOT` and `ROCM_PATH` environment variables. - Updated installation documentation to clarify the fallback mechanism for locating the ROCM toolkit, ensuring users have clear guidance on configuration options. --------- Signed-off-by: Sigbjørn Løland Bore <31211370+sigbjobo@users.noreply.github.com> --- backend/read_env.py | 2 ++ doc/install/install-from-source.md | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/read_env.py b/backend/read_env.py index c3fe2d5127..ae82778f4e 100644 --- a/backend/read_env.py +++ b/backend/read_env.py @@ -60,6 +60,8 @@ def get_argument_from_env() -> Tuple[str, list, list, dict, str, str]: cmake_minimum_required_version = "3.21" cmake_args.append("-DUSE_ROCM_TOOLKIT:BOOL=TRUE") rocm_root = os.environ.get("ROCM_ROOT") + if not rocm_root: + rocm_root = os.environ.get("ROCM_PATH") if rocm_root: cmake_args.append(f"-DCMAKE_HIP_COMPILER_ROCM_ROOT:STRING={rocm_root}") hipcc_flags = os.environ.get("HIP_HIPCC_FLAGS") diff --git a/doc/install/install-from-source.md b/doc/install/install-from-source.md index 6f17a272c6..a725be0133 100644 --- a/doc/install/install-from-source.md +++ b/doc/install/install-from-source.md @@ -155,7 +155,8 @@ The path to the CUDA toolkit directory. CUDA 9.0 or later is supported. NVCC is **Type**: Path; **Default**: Detected automatically -The path to the ROCM toolkit directory. +The path to the ROCM toolkit directory. If `ROCM_ROOT` is not set, it will look for `ROCM_PATH`; if `ROCM_PATH` is also not set, it will be detected using `hipconfig --rocmpath`. + ::: :::{envvar} DP_ENABLE_TENSORFLOW