Skip to content

Commit

Permalink
Set ROCM_ROOT to ROCM_PATH when it exist (deepmodeling#4150)
Browse files Browse the repository at this point in the history
This small commit closes issue deepmodeling#4149 by checking if `rocm_root` is not
set, and then inferring it from `rocm_path`, if it exists.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Sigbjørn Løland Bore <31211370+sigbjobo@users.noreply.github.com>
  • Loading branch information
sigbjobo authored Sep 20, 2024
1 parent c084b20 commit 81b9d20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions backend/read_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion doc/install/install-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81b9d20

Please sign in to comment.