Skip to content

Commit

Permalink
docker: update compilers to more recent versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jan 29, 2025
1 parent 82cdb29 commit e0f6066
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pytest-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
base: "devitocodes/bases:nvidia-nvc"
tags: ["self-hosted", "nvidiagpu"]
test_drive_cmd: "nvidia-smi"
flags: '--gpus all --rm -t --name testrun-nvc'
flags: '--init --gpus all --rm -t --name testrun-nvc'

- name: pytest-gpu-omp-amd
test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openmp.py"
Expand All @@ -66,7 +66,7 @@ jobs:
test_drive_cmd: "rocm-smi"
# Attach the AMD GPU devices `/dev` and add user to video and render (109 on wampa) group
# Options from https://rocmdocs.amd.com/en/latest/ROCm_Virtualization_Containers/ROCm-Virtualization-&-Containers.html
flags: "--network=host --device=/dev/kfd --device=/dev/dri --ipc=host --group-add video --group-add $(getent group render | cut -d: -f3) --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm -t --name testrun-amd"
flags: "--init --network=host --device=/dev/kfd --device=/dev/dri --ipc=host --group-add video --group-add $(getent group render | cut -d: -f3) --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm -t --name testrun-amd"

steps:
- name: Checkout devito
Expand Down
29 changes: 19 additions & 10 deletions docker/Dockerfile.amd
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# Based on https://github.com/amd/InfinityHub-CI/tree/main/base-gpu-mpi-rocm-docker
##############################################################

ARG ROCM_VERSION=5.5.1
ARG ROCM_VERSION=6.3.2

FROM rocm/dev-ubuntu-22.04:${ROCM_VERSION}-complete as sdk-base

ARG UCX_BRANCH="v1.13.1"
ARG OMPI_BRANCH="v4.1.4"
ARG UCX_BRANCH="v1.14.1"
ARG OMPI_BRANCH="v5.0.6"

# Update and Install basic Linux development tools
RUN rm /etc/apt/sources.list.d/* \
Expand Down Expand Up @@ -46,7 +46,7 @@ ENV ROCM_HOME=/opt/rocm \
OMPI_HOME=/opt/ompi

# Until rocm base has it fixed
RUN ln -s /opt/rocm/llvm/bin/offload-arch /opt/rocm/bin/offload-arch
RUN ln -s /opt/rocm/llvm/bin/offload-arch /opt/rocm/bin/offload-arch | echo "offload-arch already exis"

# Install tmpi
RUN curl https://raw.githubusercontent.com/Azrael3000/tmpi/master/tmpi -o /usr/local/bin/tmpi
Expand All @@ -73,10 +73,14 @@ RUN cd /tmp/ \
--without-knem \
--without-xpmem \
--without-cuda \
--without-java \
--enable-mt \
--enable-optimizations \
--disable-logging \
--disable-debug \
--disable-examples \
--disable-assertions \
--disable-params-check \
&& make -j ${nproc} \
&& make install

Expand All @@ -87,17 +91,22 @@ RUN cd /tmp \
&& ./autogen.pl \
&& mkdir build \
&& cd build \
&& ../configure --prefix=$OMPI_HOME --with-ucx=$UCX_HOME \
CC=amdclang CXX=amdclang++ FC=amdflang F90=amdflang \
--enable-mca-no-build=btl-uct \
&& ../configure CC=amdclang CXX=amdclang++ FC=amdflang F90=amdflang \
--prefix=$OMPI_HOME \
--with-ucx=$UCX_HOME \
--with-rocm=$ROCM_HOME \
--enable-mca-no-build=btl-uct \
--without-verbs \
--with-pmix \
--enable-mpi \
--enable-mpi-fortran=yes \
--enable-mpi1-compatibility \
--enable-mpi-fortran=no \
--disable-debug \
&& make -j ${nproc} \
&& make install

# UCX config
ENV UCX_WARN_UNUSED_ENV_VARS=n
ENV UCX_TLS=sm,shm,self,rocm

# Cleanup
RUN rm -rf /tmp/ucx && rm -rf /tmp/ompi

Expand Down
10 changes: 8 additions & 2 deletions docker/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apt-get update && \
# Install for basic base not containing it
RUN apt-get install -y vim wget git flex libnuma-dev tmux \
numactl hwloc curl \
autoconf libtool build-essential procps
autoconf libtool build-essential procps software-properties-common

# Install tmpi
RUN curl https://raw.githubusercontent.com/Azrael3000/tmpi/master/tmpi -o /usr/local/bin/tmpi
Expand All @@ -37,6 +37,12 @@ CMD ["/bin/bash"]
##############################################################
FROM base as gcc

# Install gcc 13 for better hardware and software support
RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && apt update && \
apt install gcc-13 g++-13 -y && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100

ARG OMPI_BRANCH="v4.1.4"
# Install OpenMPI
RUN mkdir -p /deps && mkdir -p /opt/openmpi && cd /deps && \
Expand All @@ -47,7 +53,7 @@ RUN mkdir -p /deps && mkdir -p /opt/openmpi && cd /deps && \
--enable-mca-no-build=btl-uct --enable-mpi1-compatibility && \
make -j ${nproc} && \
make install && \
rm -rf /deps/openmpi
cd /deps && rm -rf /deps/openmpi

# Set OpenMPI path
ENV PATH=${PATH}:/opt/openmpi/bin
Expand Down

0 comments on commit e0f6066

Please sign in to comment.