diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 586ff2485..70fd54c5e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,9 +41,6 @@ jobs: matrix: image: ['oldest', 'latest'] backend: ['cpu', 'cuda', 'hip'] - exclude: - - image: 'latest' # no ppa yet for hip in noble image - backend: 'hip' needs: id_repo runs-on: ubuntu-latest steps: @@ -98,8 +95,6 @@ jobs: - image: 'oldest' # nvcc 11 only supports C++-17 backend: 'cuda' cxx_version: '23' - - image: 'latest' # no ppa yet for hip in noble image - backend: 'hip' - image: 'latest' # nvcc 12 only supports C++-20 backend: 'cuda' cxx_version: '23' diff --git a/docker/latest/Dockerfile b/docker/latest/Dockerfile index 2101c86ba..2dcd50bdc 100644 --- a/docker/latest/Dockerfile +++ b/docker/latest/Dockerfile @@ -7,11 +7,15 @@ FROM ubuntu:noble LABEL "org.opencontainers.image.source"="https://github.com/Maison-de-la-Simulation/ddc" ARG BACKEND +ARG AMDGPU_VERSION=6.2 +ARG ROCM_VERSION=6.2 COPY bash_run /bin/ ENV BASH_ENV=/etc/profile SHELL ["/bin/bash", "-c"] +ENV PATH="${PATH:+$PATH:}/opt/rocm-${ROCM_VERSION}.0/bin" +ENV CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH:+$CMAKE_PREFIX_PATH:}/opt/rocm-${ROCM_VERSION}.0" RUN chmod +x /bin/bash_run \ && export DEBIAN_FRONTEND=noninteractive \ @@ -26,12 +30,12 @@ RUN chmod +x /bin/bash_run \ gpg \ wget \ && mkdir --parents --mode=0755 /etc/apt/keyrings \ -# && if [ "xhip" = "x${BACKEND}" ] \ -# ; then echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/5.7.3/ubuntu noble main" > /etc/apt/sources.list.d/amdgpu.list \ -# && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/5.7.3 noble main" > /etc/apt/sources.list.d/rocm.list \ -# && wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor --output /etc/apt/keyrings/rocm.gpg \ -# && echo -e "Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600" > /etc/apt/preferences.d/rocm-pin-600 \ -# ; fi \ + && if [ "xhip" = "x${BACKEND}" ] \ + ; then echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/${AMDGPU_VERSION}/ubuntu noble main" > /etc/apt/sources.list.d/amdgpu.list \ + && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/${ROCM_VERSION} noble main" > /etc/apt/sources.list.d/rocm.list \ + && wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor --output /etc/apt/keyrings/rocm.gpg \ + && echo -e "Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600" > /etc/apt/preferences.d/rocm-pin-600 \ + ; fi \ && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/pdidev-archive-keyring.gpg] https://raw.githubusercontent.com/pdidev/repo/ubuntu noble main" > /etc/apt/sources.list.d/pdi.list \ && wget -q -O /etc/apt/keyrings/pdidev-archive-keyring.gpg https://raw.githubusercontent.com/pdidev/repo/ubuntu/pdidev-archive-keyring.gpg \ && apt-get update -y \ @@ -57,10 +61,13 @@ RUN chmod +x /bin/bash_run \ nvidia-cuda-toolkit \ gcc-12 \ g++-12 \ -# ;; "hip") \ -# apt-get install -y --no-install-recommends \ -# rocm-hip-sdk \ - ;; esac \ + ;; "hip") \ + apt-get install -y --no-install-recommends \ + rocm-hip-sdk \ + && echo "/opt/rocm/lib" >> /etc/ld.so.conf.d/rocm.conf \ + && echo "/opt/rocm/lib64" >> /etc/ld.so.conf.d/rocm.conf \ + && ldconfig \ +;; esac \ && git clone -b v1.8.0 https://github.com/ginkgo-project/ginkgo.git \ && cd ginkgo \ && case "${BACKEND}" in \ @@ -68,8 +75,12 @@ RUN chmod +x /bin/bash_run \ cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGINKGO_BUILD_OMP=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \ ;; "cuda") \ cmake -S . -B build -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_CUDA_HOST_COMPILER=g++-12 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGINKGO_CUDA_ARCHITECTURES=70 -DGINKGO_BUILD_CUDA=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \ -# ;; "hip") \ -# cmake -S . -B build -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_HIP_ARCHITECTURES=gfx90a -DGINKGO_BUILD_HIP=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \ + ;; "hip") \ + # HIP_PATH needs to be set to avoid Ginkgo defining it (https://github.com/ginkgo-project/ginkgo/blob/develop/cmake/hip_path.cmake). + # The Ginkgo heuristic does not seem to be compatible with the new HIP v6 directory layout. + # This makes amdclang++ fail during cmake compiler test (https://releases.llvm.org/18.1.0/tools/clang/docs/HIPSupport.html#order-of-precedence-for-hip-path) + export HIP_PATH=`hipconfig --path` \ + && cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_HIP_ARCHITECTURES=gfx90a -DGINKGO_BUILD_HIP=ON -DGINKGO_BUILD_TESTS=OFF -DGINKGO_BUILD_EXAMPLES=OFF -DGINKGO_BUILD_BENCHMARKS=OFF \ ;; esac \ && cmake --build build \ && cmake --install build \ @@ -89,9 +100,6 @@ RUN chmod +x /bin/bash_run \ ; then echo 'CUDA_GCC=gcc-12' > /etc/profile.d/ddc-cuda.sh \ ; echo 'CUDA_GXX=g++-12' >> /etc/profile.d/ddc-cuda.sh \ ; fi -# && if [ "xhip" = "x${BACKEND}" ] \ -# ; then echo 'export LD_LIBRARY_PATH="/opt/rocm/lib"' > /etc/profile.d/10-rocm.sh \ -# ; fi USER ci:ci WORKDIR /data