From 5ff2eeb526bb9bd55e65dd4839ee7f2da6818aac Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 11 Oct 2022 19:45:45 -0400 Subject: [PATCH 01/16] add rocm build tests --- .github/workflows/build_cc.yml | 2 ++ source/install/build_cc.sh | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 22cfaacf08..576cfd9c62 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -12,6 +12,7 @@ jobs: include: - variant: cpu - variant: cuda + - variant: rocm steps: - name: work around permission issue run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit @@ -22,6 +23,7 @@ jobs: if: matrix.variant == 'cpu' - run: apt-get update && apt-get install -y nvidia-cuda-toolkit if: matrix.variant == 'cuda' + - run: echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/4.1/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list && apt-get update && apt-get install -y rocm-dkms - run: source/install/build_cc.sh env: DP_VARIANT: ${{ matrix.variant }} diff --git a/source/install/build_cc.sh b/source/install/build_cc.sh index 27955c7b7d..d87b56b237 100755 --- a/source/install/build_cc.sh +++ b/source/install/build_cc.sh @@ -3,6 +3,9 @@ set -e if [ "$DP_VARIANT" == "cuda" ] then CUDA_ARGS="-DUSE_CUDA_TOOLKIT=TRUE" +elif [ "$DP_VARIANT" == "rocm" ] +then + CUDA_ARGS="-DUSE_ROCM_TOOLKIT=TRUE" fi #------------------ From 0cce38b60fe25747197ef53dfbafec904a50322c Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 11 Oct 2022 20:00:29 -0400 Subject: [PATCH 02/16] change version to 5.3 Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 576cfd9c62..a8c4d7669d 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -23,7 +23,7 @@ jobs: if: matrix.variant == 'cpu' - run: apt-get update && apt-get install -y nvidia-cuda-toolkit if: matrix.variant == 'cuda' - - run: echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/4.1/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list && apt-get update && apt-get install -y rocm-dkms + - run: echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list && apt-get update && apt-get install -y rocm-dkms - run: source/install/build_cc.sh env: DP_VARIANT: ${{ matrix.variant }} From 3fe902f50668e042dc4f3d9b6c7edffdf26b7d90 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 11 Oct 2022 20:12:08 -0400 Subject: [PATCH 03/16] add gpg key Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index a8c4d7669d..1c96b83352 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -23,7 +23,11 @@ jobs: if: matrix.variant == 'cpu' - run: apt-get update && apt-get install -y nvidia-cuda-toolkit if: matrix.variant == 'cuda' - - run: echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list && apt-get update && apt-get install -y rocm-dkms + - run: | + echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list \ + && wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ + && apt-get update \ + && apt-get install -y rocm-dkms - run: source/install/build_cc.sh env: DP_VARIANT: ${{ matrix.variant }} From b53554f996bd051e8f706c76fccc222b7853b481 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 11 Oct 2022 20:17:42 -0400 Subject: [PATCH 04/16] replace wget with curl Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 1c96b83352..d7e77305c1 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -25,7 +25,7 @@ jobs: if: matrix.variant == 'cuda' - run: | echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list \ - && wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ + && curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ && apt-get update \ && apt-get install -y rocm-dkms - run: source/install/build_cc.sh From 7eec6e9e1c671a8df7d4ec982f7e41a1b502f57e Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 11 Oct 2022 20:50:31 -0400 Subject: [PATCH 05/16] Update build_cc.yml Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index d7e77305c1..1d986e6181 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -24,7 +24,8 @@ jobs: - run: apt-get update && apt-get install -y nvidia-cuda-toolkit if: matrix.variant == 'cuda' - run: | - echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list \ + apt-get update && apt-get install -y gnupg2 \ + && echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list \ && curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ && apt-get update \ && apt-get install -y rocm-dkms From 111cbf523d19694e60994709a05c13781af54b6c Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 11 Oct 2022 21:24:49 -0400 Subject: [PATCH 06/16] use jammy Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 1d986e6181..68d8739d97 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -25,7 +25,7 @@ jobs: if: matrix.variant == 'cuda' - run: | apt-get update && apt-get install -y gnupg2 \ - && echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list \ + && echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ jammy main' | tee /etc/apt/sources.list.d/rocm.list \ && curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ && apt-get update \ && apt-get install -y rocm-dkms From 28e09858e4d5426bee6df264e49edfb0917fd3a2 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 11 Oct 2022 21:33:06 -0400 Subject: [PATCH 07/16] rocm-dev Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 68d8739d97..8ca2b8e791 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -28,7 +28,7 @@ jobs: && echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ jammy main' | tee /etc/apt/sources.list.d/rocm.list \ && curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ && apt-get update \ - && apt-get install -y rocm-dkms + && apt-get install -y rocm-dev - run: source/install/build_cc.sh env: DP_VARIANT: ${{ matrix.variant }} From fb17bc3421d6082c771c0d623769497c533f0562 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 11 Oct 2022 21:45:55 -0400 Subject: [PATCH 08/16] add --no-install-recommends Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 8ca2b8e791..4d421ec73c 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -28,7 +28,7 @@ jobs: && echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ jammy main' | tee /etc/apt/sources.list.d/rocm.list \ && curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ && apt-get update \ - && apt-get install -y rocm-dev + && apt-get install -y --no-install-recommends rocm-dev - run: source/install/build_cc.sh env: DP_VARIANT: ${{ matrix.variant }} From 3229a7be4aa10e6a6d93defa1fcb080a0b47cbdd Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 17 Oct 2022 10:32:22 -0400 Subject: [PATCH 09/16] Fix compatibility with ROCm>=3.5.1; fix typo in hip neighbor_list --- source/cmake/FindROCM.cmake | 44 +++++++++++++++++------------- source/lib/src/rocm/CMakeLists.txt | 11 +++++--- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/source/cmake/FindROCM.cmake b/source/cmake/FindROCM.cmake index cab69e4999..d6432792ab 100644 --- a/source/cmake/FindROCM.cmake +++ b/source/cmake/FindROCM.cmake @@ -8,12 +8,9 @@ # define the search path list(APPEND ROCM_search_PATHS ${ROCM_ROOT}) +list(APPEND ROCM_search_PATHS $ENV{ROCM_PATH}) list(APPEND ROCM_search_PATHS "/opt/rocm/") -# define the libs to find -if (NOT ROCM_FIND_COMPONENTS) - set(ROCM_FIND_COMPONENTS hip_hcc hiprtc) -endif () # includes find_path (ROCM_INCLUDE_DIRS @@ -31,21 +28,6 @@ if (NOT ROCM_INCLUDE_DIRS AND ROCM_FIND_REQUIRED) "You can manually set the ROCM install path by -DROCM_ROOT ") endif () -# libs -foreach (module ${ROCM_FIND_COMPONENTS}) - find_library(ROCM_LIBRARIES_${module} - NAMES ${module} - PATHS ${ROCM_search_PATHS} PATH_SUFFIXES "lib" NO_DEFAULT_PATH - ) - if (ROCM_LIBRARIES_${module}) - list(APPEND ROCM_LIBRARIES ${ROCM_LIBRARIES_${module}}) - elseif (ROCM_FIND_REQUIRED) - message(FATAL_ERROR - "Not found lib/'${module}' in '${ROCM_search_PATHS}' " - "You can manually set the ROCM install path by -DROCM_ROOT ") - endif () -endforeach () - # FindHIP.cmake find_path (HIP_CMAKE NAMES @@ -64,6 +46,30 @@ endif () list (APPEND CMAKE_MODULE_PATH ${HIP_CMAKE}) find_package(HIP) +# define the libs to find +if (NOT ROCM_FIND_COMPONENTS) + if (HIP_VERSION VERSION_GREATER_EQUAL 3.5.1) + set(ROCM_FIND_COMPONENTS amd_comgr amdhip64) + else() + set(ROCM_FIND_COMPONENTS hip-hcc hiprtc) + endif() +endif () + +# libs +foreach (module ${ROCM_FIND_COMPONENTS}) + find_library(ROCM_LIBRARIES_${module} + NAMES ${module} + PATHS ${ROCM_search_PATHS} PATH_SUFFIXES "lib" NO_DEFAULT_PATH + ) + if (ROCM_LIBRARIES_${module}) + list(APPEND ROCM_LIBRARIES ${ROCM_LIBRARIES_${module}}) + elseif (ROCM_FIND_REQUIRED) + message(FATAL_ERROR + "Not found lib/'${module}' in '${ROCM_search_PATHS}' " + "You can manually set the ROCM install path by -DROCM_ROOT ") + endif () +endforeach () + # define the output variable if (ROCM_INCLUDE_DIRS AND ROCM_LIBRARIES AND HIP_CMAKE) set(ROCM_FOUND TRUE) diff --git a/source/lib/src/rocm/CMakeLists.txt b/source/lib/src/rocm/CMakeLists.txt index 602f2f4524..cce35b6cb5 100644 --- a/source/lib/src/rocm/CMakeLists.txt +++ b/source/lib/src/rocm/CMakeLists.txt @@ -1,18 +1,21 @@ # required cmake version -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.21) # project name project(deepmd_op_rocm) set(CMAKE_LINK_WHAT_YOU_USE TRUE) # set c++ version c++11 -SET(CMAKE_CXX_STANDARD 11) -SET(CMAKE_HIP_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_HIP_STANDARD 14) add_definitions("-DCUB_IGNORE_DEPRECATED_CPP_DIALECT") add_definitions("-DCUB_IGNORE_DEPRECATED_CPP_DIALECT") message(STATUS "HIP major version is " ${HIP_VERSION_MAJOR}) -set (HIP_HIPCC_FLAGS -hc; -fno-gpu-rdc; --amdgpu-target=gfx906; -fPIC; -O3; --std=c++11) +set (HIP_HIPCC_FLAGS -fno-gpu-rdc; -fPIC --std=c++14) # --amdgpu-target=gfx906 +if (HIP_VERSION VERSION_LESS 3.5.1) + set (HIP_HIPCC_FLAGS -hc; ${HIP_HIPCC_FLAGS}) +endif() file (GLOB SOURCE_FILES "*.hip.cu" ) From 642df6afea60860c92b82189b316319d40a11cce Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 17 Oct 2022 10:51:46 -0400 Subject: [PATCH 10/16] Fix the typo in neighbor_list --- source/lib/src/rocm/neighbor_list.hip.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/lib/src/rocm/neighbor_list.hip.cu b/source/lib/src/rocm/neighbor_list.hip.cu index 3bdfbee770..64f2b31497 100644 --- a/source/lib/src/rocm/neighbor_list.hip.cu +++ b/source/lib/src/rocm/neighbor_list.hip.cu @@ -288,7 +288,7 @@ void use_nei_info_gpu_rocm( dim3 block_grid(nloc, nblock); dim3 thread_grid(1, TPB); DPErrcheck(hipMemset(ntype, 0, sizeof(int) * nloc * nnei)); - DPErrcheck(hipMemset(nmask, 0, sizeof(FPTYPE) * nloc * nnei)); + DPErrcheck(hipMemset(nmask, 0, sizeof(bool) * nloc * nnei)); if (b_nlist_map){ hipLaunchKernelGGL(map_nei_info, block_grid, thread_grid, 0, 0, nlist, ntype, nmask, type, nlist_map, nloc, nnei, ntypes); } @@ -301,4 +301,4 @@ void use_nei_info_gpu_rocm( template int build_nlist_gpu_rocm(InputNlist & nlist, int * max_list_size, int * nlist_data, const float * c_cpy, const int & nloc, const int & nall, const int & mem_size, const float & rcut); template int build_nlist_gpu_rocm(InputNlist & nlist, int * max_list_size, int * nlist_data, const double * c_cpy, const int & nloc, const int & nall, const int & mem_size, const float & rcut); -} \ No newline at end of file +} From 911e2481f3505520e6e7859b034ecaac60efefba Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 17 Oct 2022 13:41:33 -0400 Subject: [PATCH 11/16] use cmake native module to find rocm --- doc/install/install-from-source.md | 2 +- setup.py | 2 +- source/cmake/FindROCM.cmake | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/install/install-from-source.md b/doc/install/install-from-source.md index cc28ee523a..c436238566 100644 --- a/doc/install/install-from-source.md +++ b/doc/install/install-from-source.md @@ -177,7 +177,7 @@ One may add the following arguments to `cmake`: | -DUSE_CUDA_TOOLKIT=<value> | `TRUE` or `FALSE` | `FALSE` | If `TRUE`, Build GPU support with CUDA toolkit. | | -DCUDA_TOOLKIT_ROOT_DIR=<value> | Path | Detected automatically | The path to the CUDA toolkit directory. CUDA 7.0 or later is supported. NVCC is required. | | -DUSE_ROCM_TOOLKIT=<value> | `TRUE` or `FALSE` | `FALSE` | If `TRUE`, Build GPU support with ROCM toolkit. | -| -DROCM_ROOT=<value> | Path | Detected automatically | The path to the ROCM toolkit directory. | +| -DCMAKE_HIP_COMPILER_ROCM_ROOT=<value> | Path | Detected automatically | The path to the ROCM toolkit directory. | | -DLAMMPS_SOURCE_ROOT=<value> | Path | - | Only neccessary for LAMMPS plugin mode. The path to the [LAMMPS source code](install-lammps.md). LAMMPS 8Apr2021 or later is supported. If not assigned, the plugin mode will not be enabled. | | -DUSE_TF_PYTHON_LIBS=<value> | `TRUE` or `FALSE` | `FALSE` | If `TRUE`, Build C++ interface with TensorFlow's Python libraries(TensorFlow's Python Interface is required). And there's no need for building TensorFlow's C++ interface.| diff --git a/setup.py b/setup.py index 36751a192b..fd873ff33d 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ cmake_args.append("-DUSE_ROCM_TOOLKIT:BOOL=TRUE") rocm_root = os.environ.get("ROCM_ROOT") if rocm_root: - cmake_args.append(f"-DROCM_ROOT:STRING={rocm_root}") + cmake_args.append(f"-DCMAKE_HIP_COMPILER_ROCM_ROOT:STRING={rocm_root}") else: raise RuntimeError("Unsupported DP_VARIANT option: %s" % dp_variant) diff --git a/source/cmake/FindROCM.cmake b/source/cmake/FindROCM.cmake index d6432792ab..3e105f7307 100644 --- a/source/cmake/FindROCM.cmake +++ b/source/cmake/FindROCM.cmake @@ -7,10 +7,9 @@ # ROCM_LIBRARIES # define the search path -list(APPEND ROCM_search_PATHS ${ROCM_ROOT}) -list(APPEND ROCM_search_PATHS $ENV{ROCM_PATH}) -list(APPEND ROCM_search_PATHS "/opt/rocm/") - +cmake_minimum_required(VERSION 3.21) +include(CMakeDetermineHIPCompiler) +set(ROCM_search_PATHS ${CMAKE_HIP_COMPILER_ROCM_ROOT}) # includes find_path (ROCM_INCLUDE_DIRS From 342573935a97431a6f39b9c12185da76ba6fba29 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 26 Oct 2022 18:38:42 -0400 Subject: [PATCH 12/16] add Pin-Priority Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 4d421ec73c..740128e6ee 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -26,9 +26,11 @@ jobs: - run: | apt-get update && apt-get install -y gnupg2 \ && echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ jammy main' | tee /etc/apt/sources.list.d/rocm.list \ + && echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | tee /etc/apt/preferences.d/rocm-pin-600 \ && curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ && apt-get update \ && apt-get install -y --no-install-recommends rocm-dev + if: matrix.variant == 'rocm' - run: source/install/build_cc.sh env: DP_VARIANT: ${{ matrix.variant }} From b19750542412756ffe8117f3a613e7f56cdc8fec Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 26 Oct 2022 18:53:35 -0400 Subject: [PATCH 13/16] Update build_cc.yml Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index 740128e6ee..13598a10ca 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -26,7 +26,7 @@ jobs: - run: | apt-get update && apt-get install -y gnupg2 \ && echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ jammy main' | tee /etc/apt/sources.list.d/rocm.list \ - && echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | tee /etc/apt/preferences.d/rocm-pin-600 \ + && printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | tee /etc/apt/preferences.d/rocm-pin-600 \ && curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ && apt-get update \ && apt-get install -y --no-install-recommends rocm-dev From 8e287b1244260b3373b1366374dff6545eb1a8cd Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 26 Oct 2022 19:12:10 -0400 Subject: [PATCH 14/16] use `=` to compare strings Signed-off-by: Jinzhe Zeng --- source/install/build_cc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/install/build_cc.sh b/source/install/build_cc.sh index d87b56b237..ffb6ea0d57 100755 --- a/source/install/build_cc.sh +++ b/source/install/build_cc.sh @@ -1,9 +1,9 @@ set -e -if [ "$DP_VARIANT" == "cuda" ] +if [ "$DP_VARIANT" = "cuda" ] then CUDA_ARGS="-DUSE_CUDA_TOOLKIT=TRUE" -elif [ "$DP_VARIANT" == "rocm" ] +elif [ "$DP_VARIANT" = "rocm" ] then CUDA_ARGS="-DUSE_ROCM_TOOLKIT=TRUE" fi From b36b518568094107bca93575721b30b6894102d5 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 26 Oct 2022 19:34:56 -0400 Subject: [PATCH 15/16] set ROCM_PATH Signed-off-by: Jinzhe Zeng --- source/cmake/FindROCM.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/source/cmake/FindROCM.cmake b/source/cmake/FindROCM.cmake index 3e105f7307..fa8ee2c20f 100644 --- a/source/cmake/FindROCM.cmake +++ b/source/cmake/FindROCM.cmake @@ -9,6 +9,7 @@ # define the search path cmake_minimum_required(VERSION 3.21) include(CMakeDetermineHIPCompiler) +set(ROCM_PATH ${CMAKE_HIP_COMPILER_ROCM_ROOT}) set(ROCM_search_PATHS ${CMAKE_HIP_COMPILER_ROCM_ROOT}) # includes From e6cc22632083d6d837085470398a910a135b4700 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 26 Oct 2022 19:40:37 -0400 Subject: [PATCH 16/16] install hipcub-dev Signed-off-by: Jinzhe Zeng --- .github/workflows/build_cc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_cc.yml b/.github/workflows/build_cc.yml index b8ed600d34..324017a4b6 100644 --- a/.github/workflows/build_cc.yml +++ b/.github/workflows/build_cc.yml @@ -30,7 +30,7 @@ jobs: && printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | tee /etc/apt/preferences.d/rocm-pin-600 \ && curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \ && apt-get update \ - && apt-get install -y rocm-dev + && apt-get install -y rocm-dev hipcub-dev if: matrix.variant == 'rocm' - run: apt-get update && apt-get install -y clang if: matrix.variant == 'clang'