forked from ginkgo-project/ginkgo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Removing hip path manipulation
This merge removes the setting of the `HIP_PATH` environment variable. It also removes setting the paths for each rocm library individually. Instead, it is expected that user provide the correct `CMAKE_PREFIX_PATH` during configuration. Additionally, a check is introduced to warn about rocm's faulty CMake setup. For rocm 5.0-5.6 the default installation (as provided in the rocm/dev images) has some bugs, which prevent even the simplest CMake setup to enable the HIP language. Related PR: ginkgo-project#1673
- Loading branch information
Showing
8 changed files
with
63 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
function(ginkgo_find_hip_version) | ||
find_program( | ||
HIP_HIPCONFIG_EXECUTABLE | ||
NAMES hipconfig | ||
PATHS | ||
"${HIP_ROOT_DIR}" | ||
ENV ROCM_PATH | ||
ENV HIP_PATH | ||
/opt/rocm | ||
/opt/rocm/hip | ||
PATH_SUFFIXES bin | ||
NO_DEFAULT_PATH | ||
) | ||
if(NOT HIP_HIPCONFIG_EXECUTABLE) | ||
# Now search in default paths | ||
find_program(HIP_HIPCONFIG_EXECUTABLE hipconfig) | ||
endif() | ||
|
||
execute_process( | ||
COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --version | ||
OUTPUT_VARIABLE GINKGO_HIP_VERSION | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
ERROR_STRIP_TRAILING_WHITESPACE | ||
) | ||
set(GINKGO_HIP_VERSION ${GINKGO_HIP_VERSION} PARENT_SCOPE) | ||
endfunction() | ||
|
||
# This function checks if ROCm might not be detected correctly. | ||
# ROCm < 5.7 has a faulty CMake setup that requires setting | ||
# CMAKE_PREFIX_PATH=$ROCM_PATH/lib/cmake, otherwise HIP will not be detected. | ||
function(ginkgo_check_hip_detection_issue) | ||
if(NOT CMAKE_HIP_COMPILER) | ||
ginkgo_find_hip_version() | ||
if (GINKGO_HIP_VERSION AND GINKGO_HIP_VERSION VERSION_LESS 5.7) | ||
message(WARNING | ||
"Could not find a HIP compiler, but HIP version ${GINKGO_HIP_VERSION} was detected through " | ||
"hipconfig. Try setting the environment variable CMAKE_PREFIX_PATH=$ROCM_PATH/lib/cmake, or " | ||
"update to ROCm >= 5.7." | ||
) | ||
endif () | ||
endif () | ||
endfunction() | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters