Skip to content

[UR] Document how to customize HIP directories #12127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions sycl/doc/GetStartedGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,17 @@ variable `SYCL_BUILD_PI_HIP_ROCM_DIR` which can be passed using the
python $DPCPP_HOME/llvm/buildbot/configure.py --hip \
--cmake-opt=-DSYCL_BUILD_PI_HIP_ROCM_DIR=/usr/local/rocm
```
If further customization is required — for instance when the layout of
individual directories can not be inferred from `SYCL_BUILD_PI_HIP_ROCM_DIR` —
it is possible to specify the location of HIP include, HSA include and HIP
library directories, using the following CMake variables:
* `SYCL_BUILD_PI_HIP_INCLUDE_DIR`,
* `SYCL_BUILD_PI_HIP_HSA_INCLUDE_DIR`,
* `SYCL_BUILD_PI_HIP_LIB_DIR`.
Please note that a similar customization would also be required for Unified
Runtime, see [the list of options provided by its
CMake](https://github.com/oneapi-src/unified-runtime#cmake-standard-options)
for details.

[LLD](https://llvm.org/docs/AMDGPUUsage.html) is necessary for the AMDGPU
compilation chain. The AMDGPU backend generates a standard ELF relocatable code
Expand Down
8 changes: 8 additions & 0 deletions sycl/plugins/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ else()
set(PI_HIP_LIB_DIR "${SYCL_BUILD_PI_HIP_LIB_DIR}")
endif()

# Set up defaults for UR
set(UR_HIP_INCLUDE_DIR "${PI_HIP_INCLUDE_DIR}" CACHE PATH
"Custom ROCm HIP include dir")
set(UR_HIP_HSA_INCLUDE_DIRS "${PI_HIP_HSA_INCLUDE_DIR}" CACHE PATH
"Custom ROCm HSA include dir")
set(UR_HIP_LIB_DIR "${PI_HIP_LIB_DIR}" CACHE PATH
"Custom ROCm HIP library dir")

# Mark override options for advanced usage
mark_as_advanced(SYCL_BUILD_PI_HIP_INCLUDE_DIR SYCL_BUILD_PI_HIP_HSA_INCLUDE_DIR SYCL_BUILD_PI_HIP_LIB_DIR)

Expand Down
12 changes: 6 additions & 6 deletions sycl/plugins/unified_runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
include(FetchContent)

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
# commit c2d78257ba7e7bbc230333f291282d16145aaac7
# Merge: 8bb539c5 b3a1d52d
# commit c53953ae492587698d5adbab8ffee254d97b6a4e
# Merge: 9f88cf88 66d52ace
# Author: Kenneth Benzie (Benie) <[email protected]>
# Date: Wed Jan 10 11:24:12 2024 +0000
# Merge pull request #1129 from sarnex/adapters
# [UR][L0] Make urPlatformGetBackendOption return -ze-opt-level=2 for -O1 and -O2
set(UNIFIED_RUNTIME_TAG c2d78257ba7e7bbc230333f291282d16145aaac7)
# Date: Wed Jan 10 14:50:23 2024 +0000
# Merge pull request #1170 from jchlanda/jakub/hip_custom_dirs
# [HIP] Allow custom location of ROCm components
set(UNIFIED_RUNTIME_TAG c53953ae492587698d5adbab8ffee254d97b6a4e)

if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")
Expand Down