Skip to content
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

Use rocm 6.2 in noble image #597

Merged
merged 1 commit into from
Aug 28, 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
5 changes: 0 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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'
Expand Down
38 changes: 23 additions & 15 deletions docker/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -57,19 +61,26 @@ 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 \
"cpu") \
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` \
tpadioleau marked this conversation as resolved.
Show resolved Hide resolved
&& 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 \
Expand All @@ -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
Expand Down