From 1cdf4f9465bd8b228f9c680b439ae6ec1c296820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Widera?= Date: Thu, 21 Dec 2023 08:08:50 +0100 Subject: [PATCH] add support for ROCm 6.0 (#2210) * support for ROCm 6.0 - update HIP install script - ROCm 6 shipped clang is broken and `clang -v` is failing. Therefore this PR is changing all compiler `-v` querries to `--version`. - CMake: set ROCM 6.0 as supported version --- README.md | 2 +- cmake/alpakaCommon.cmake | 6 ++++++ script/install_clang.sh | 2 +- script/install_hip.sh | 5 +++++ script/install_oneapi.sh | 4 ++-- script/job_generator/generate_job_yaml.py | 2 ++ script/job_generator/versions.py | 2 +- script/run.sh | 2 +- 8 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 35e1a2226e87..1140d4ffa719 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ This library uses C++17 (or newer when available). | TBB | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | CUDA (nvcc) | :white_check_mark:
(CUDA 11.0 - 12.2)[^2] | :white_check_mark:
(CUDA 11.4 - 12.0)[^2] | :white_check_mark:
(CUDA 12.0 - 12.2) | :x: | :white_check_mark:
(CUDA 11.0-11.2; 11.6 - 12.0)[^2] | :white_check_mark:
(CUDA 11.2, 11.6 - 12.0)[^2] | :white_check_mark:
(CUDA 11.6 - 12.0)[^2] | :white_check_mark:
(CUDA 11.7 - 12.0) | :white_check_mark:
(CUDA 11.8 - 12.0) | :white_check_mark:
(CUDA 12.2) | :x: | :x: | :x: | :x: | :x: | | CUDA (clang) | - | - | - | :x: | :x: | :x: | :x: | :x: | :white_check_mark: (CUDA 11.0 - 11.5) | :white_check_mark: (CUDA 11.0 - 11.5)[^1] | :white_check_mark: (CUDA 11.0 - 11.5)[^1] | :white_check_mark: (CUDA 11.0 - 11.8)[^1] | :x: | - | - | -| [HIP](https://alpaka.readthedocs.io/en/latest/install/HIP.html) (clang) | - | - | - | :x: | :x: | :x: | :x: | :x: | :white_check_mark: (HIP 5.0 - 5.2) | :white_check_mark: (HIP 5.3 - 5.4) | :white_check_mark: (HIP 5.5 - 5.6) | :white_check_mark: (HIP 5.7) | :x: | - | - | +| [HIP](https://alpaka.readthedocs.io/en/latest/install/HIP.html) (clang) | - | - | - | :x: | :x: | :x: | :x: | :x: | :white_check_mark: (HIP 5.0 - 5.2) | :white_check_mark: (HIP 5.3 - 5.4) | :white_check_mark: (HIP 5.5 - 5.6) | :white_check_mark: (HIP 5.7 - 6.0) | :x: | - | - | | SYCL | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :white_check_mark:[^4] | :x: | :x: | Other compilers or combinations marked with :x: in the table above may work but are not tested in CI and are therefore not explicitly supported. diff --git a/cmake/alpakaCommon.cmake b/cmake/alpakaCommon.cmake index fcc275354f2c..6d30dbfa0c91 100644 --- a/cmake/alpakaCommon.cmake +++ b/cmake/alpakaCommon.cmake @@ -509,11 +509,17 @@ if(alpaka_ACC_GPU_HIP_ENABLE) # supported HIP version range set(_alpaka_HIP_MIN_VER 5.0) set(_alpaka_HIP_MAX_VER 5.7) + set(_alpaka_HIP_NEXT_MAJOR_MIN_VER 6.0) + find_package(hip "${_alpaka_HIP_MIN_VER}...${_alpaka_HIP_MAX_VER}") if(NOT TARGET hip) message(WARNING "Could not find HIP <=v${_alpaka_HIP_MAX_VER}. Now searching for unsupported HIP >v${_alpaka_HIP_MAX_VER}") find_package(hip "${_alpaka_HIP_MAX_VER}") + if(NOT TARGET hip) + message(WARNING "Could not find HIP >=v${_alpaka_HIP_MAX_VER}. Now searching for unsupported HIP >v${_alpaka_HIP_NEXT_MAJOR_MIN_VER}") + find_package(hip "${_alpaka_HIP_NEXT_MAJOR_MIN_VER}") + endif() endif() if(NOT TARGET hip) diff --git a/script/install_clang.sh b/script/install_clang.sh index 55238e06f7ca..8c8382c90eee 100755 --- a/script/install_clang.sh +++ b/script/install_clang.sh @@ -68,4 +68,4 @@ then fi which "${CXX}" -${CXX} -v +${CXX} --version diff --git a/script/install_hip.sh b/script/install_hip.sh index ecfa860c5bd9..9a1bd568146d 100755 --- a/script/install_hip.sh +++ b/script/install_hip.sh @@ -12,6 +12,8 @@ source ./script/set.sh : "${ALPAKA_CI_HIP_ROOT_DIR?'ALPAKA_CI_HIP_ROOT_DIR must be specified'}" : "${ALPAKA_CI_HIP_VERSION?'ALPAKA_CI_HIP_VERSION must be specified'}" +function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } + if agc-manager -e rocm@${ALPAKA_CI_HIP_VERSION} ; then export ROCM_PATH=$(agc-manager -b rocm@${ALPAKA_CI_HIP_VERSION}) else @@ -30,6 +32,9 @@ else fi apt install --no-install-recommends -y rocm-llvm${ALPAKA_CI_ROCM_VERSION} hip-runtime-amd${ALPAKA_CI_ROCM_VERSION} rocm-dev${ALPAKA_CI_ROCM_VERSION} rocm-utils${ALPAKA_CI_ROCM_VERSION} rocrand-dev${ALPAKA_CI_ROCM_VERSION} rocminfo${ALPAKA_CI_ROCM_VERSION} rocm-cmake${ALPAKA_CI_ROCM_VERSION} rocm-device-libs${ALPAKA_CI_ROCM_VERSION} rocm-core${ALPAKA_CI_ROCM_VERSION} rocm-smi-lib${ALPAKA_CI_ROCM_VERSION} + if [ $(version ${ALPAKA_CI_ROCM_VERSION}) -ge $(version "6.0.0") ]; then + apt install --no-install-recommends -y hiprand-dev${ALPAKA_CI_ROCM_VERSION} + fi export ROCM_PATH=/opt/rocm fi # ROCM_PATH required by HIP tools diff --git a/script/install_oneapi.sh b/script/install_oneapi.sh index 0494c1f4eeed..507799f56086 100755 --- a/script/install_oneapi.sh +++ b/script/install_oneapi.sh @@ -44,7 +44,7 @@ then fi which "${CXX}" -${CXX} -v +${CXX} --version which "${CC}" -${CC} -v +${CC} --version sycl-ls diff --git a/script/job_generator/generate_job_yaml.py b/script/job_generator/generate_job_yaml.py index 96e660b357fc..137f70d0206a 100644 --- a/script/job_generator/generate_job_yaml.py +++ b/script/job_generator/generate_job_yaml.py @@ -353,6 +353,8 @@ def job_variables(job: Dict[str, Tuple[str, str]]) -> Dict[str, str]: variables["ALPAKA_CI_CLANG_VER"] = "16" elif job[DEVICE_COMPILER][VERSION] == "5.7": variables["ALPAKA_CI_CLANG_VER"] = "17" + elif job[DEVICE_COMPILER][VERSION] == "6.0": + variables["ALPAKA_CI_CLANG_VER"] = "17" else: raise RuntimeError( "generate_job_yaml.job_variables(): unknown hip version: " diff --git a/script/job_generator/versions.py b/script/job_generator/versions.py index a4297d37df9a..41c6ac7182fa 100644 --- a/script/job_generator/versions.py +++ b/script/job_generator/versions.py @@ -27,7 +27,7 @@ "12.1", "12.2", ], - HIPCC: ["5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7"], + HIPCC: ["5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7", "6.0"], ICPX: ["2023.1.0", "2023.2.0"], # Contains all enabled back-ends. # There are special cases for ALPAKA_ACC_GPU_CUDA_ENABLE and ALPAKA_ACC_GPU_HIP_ENABLE diff --git a/script/run.sh b/script/run.sh index b3309c3e941b..4249c21c8d75 100755 --- a/script/run.sh +++ b/script/run.sh @@ -104,7 +104,7 @@ then fi which "${CXX}" - ${CXX} -v + ${CXX} --version fi if [ "$ALPAKA_CI_OS_NAME" = "Linux" ]