Skip to content

Commit 6331ebf

Browse files
authored
Merge pull request #2526 from devitocodes/docker-compilers-update
docker: update compilers to more recent versions
2 parents 82cdb29 + 4b2744b commit 6331ebf

8 files changed

Lines changed: 40 additions & 25 deletions

File tree

.github/workflows/docker-devito.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ jobs:
2020
include:
2121
- base: 'bases:nvidia-nvc'
2222
tag: 'nvidia-nvc'
23-
flag: '--gpus all'
23+
flag: '--init --gpus all'
2424
test: 'tests/test_gpu_openacc.py tests/test_gpu_common.py'
2525
runner: ["self-hosted", "nvidiagpu"]
2626

2727
# Runtime gpu flags from https://hub.docker.com/r/rocm/tensorflow/
2828
- base: 'bases:amd'
2929
tag: 'amd'
30-
flag: '--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'
30+
flag: '--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'
3131
test: 'tests/test_gpu_openmp.py'
3232
runner: ["self-hosted", "amdgpu"]
3333

3434
- base: 'bases:cpu-gcc'
3535
tag: "gcc"
36-
flag: ''
36+
flag: '--init -t'
3737
test: 'tests/test_operator.py'
3838
runner: ubuntu-latest
3939

4040
- base: 'bases:cpu-icx'
4141
tag: "icx"
42-
flag: ''
42+
flag: '--init -t'
4343
test: 'tests/test_operator.py'
4444
runner: ubuntu-latest
4545

.github/workflows/pytest-core-mpi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ jobs:
8787
8888
- name: Test with pytest
8989
run: |
90-
docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e OMP_NUM_THREADS=1 --name testrun devito_img pytest tests/test_mpi.py
90+
docker run --init -t --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e OMP_NUM_THREADS=1 --name testrun devito_img pytest tests/test_mpi.py
9191
9292
- name: Test examples with MPI
9393
run: |
94-
docker run --rm -t ${{ matrix.mpiflag }} -e DEVITO_MPI=1 -e OMP_NUM_THREADS=1 --name examplerun devito_img mpiexec -n 2 pytest examples/seismic/acoustic
95-
docker run --rm -t -e DEVITO_MPI=1 -e OMP_NUM_THREADS=1 --name examplerun devito_img mpiexec -n 2 pytest examples/seismic/tti
94+
docker run --init -t --rm ${{ matrix.mpiflag }} -e DEVITO_MPI=1 -e OMP_NUM_THREADS=1 --name examplerun devito_img mpiexec -n 2 pytest examples/seismic/acoustic
95+
docker run --init -t --rm -e DEVITO_MPI=1 -e OMP_NUM_THREADS=1 --name examplerun devito_img mpiexec -n 2 pytest examples/seismic/tti

.github/workflows/pytest-core-nompi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
- name: Set run prefix
135135
run: |
136136
if [[ "${{ matrix.name }}" =~ "docker" ]]; then
137-
echo "RUN_CMD=docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
137+
echo "RUN_CMD=docker run --init -t --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
138138
else
139139
echo "RUN_CMD=" >> $GITHUB_ENV
140140
fi

.github/workflows/pytest-gpu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
base: "devitocodes/bases:nvidia-nvc"
5858
tags: ["self-hosted", "nvidiagpu"]
5959
test_drive_cmd: "nvidia-smi"
60-
flags: '--gpus all --rm -t --name testrun-nvc'
60+
flags: '--init --gpus all --rm -t --name testrun-nvc'
6161

6262
- name: pytest-gpu-omp-amd
6363
test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openmp.py"
@@ -66,7 +66,7 @@ jobs:
6666
test_drive_cmd: "rocm-smi"
6767
# Attach the AMD GPU devices `/dev` and add user to video and render (109 on wampa) group
6868
# Options from https://rocmdocs.amd.com/en/latest/ROCm_Virtualization_Containers/ROCm-Virtualization-&-Containers.html
69-
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"
69+
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"
7070

7171
steps:
7272
- name: Checkout devito

.github/workflows/tutorials.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- name: Set run prefix
7676
run: |
7777
if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py39' ]; then
78-
echo "RUN_CMD=docker run --rm -t --name testrun devito_img" >> $GITHUB_ENV
78+
echo "RUN_CMD=docker run --init -t --rm --name testrun devito_img" >> $GITHUB_ENV
7979
else
8080
echo "RUN_CMD=" >> $GITHUB_ENV
8181
fi

devito/arch/archinfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def cbk(deviceid=0):
270270
for line in lines:
271271
if 'GPU' in line:
272272
# Product
273-
pattern = r'GPU\[(\d+)\].*?Card series:\s*(.*?)\s*$'
273+
pattern = r'GPU\[(\d+)\].*?Card [sS]eries:\s*(.*?)\s*$'
274274
match1 = re.match(pattern, line)
275275

276276
if match1:
@@ -280,7 +280,7 @@ def cbk(deviceid=0):
280280
gpu_infos[gid]['product'] = match1.group(2)
281281

282282
# Model
283-
pattern = r'GPU\[(\d+)\].*?Card model:\s*(.*?)\s*$'
283+
pattern = r'GPU\[(\d+)\].*?Card [mM]odel:\s*(.*?)\s*$'
284284
match2 = re.match(pattern, line)
285285

286286
if match2:

docker/Dockerfile.amd

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# Based on https://github.com/amd/InfinityHub-CI/tree/main/base-gpu-mpi-rocm-docker
44
##############################################################
55

6-
ARG ROCM_VERSION=5.5.1
6+
ARG ROCM_VERSION=6.3.2
77

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

10-
ARG UCX_BRANCH="v1.13.1"
11-
ARG OMPI_BRANCH="v4.1.4"
10+
ARG UCX_BRANCH="v1.14.1"
11+
ARG OMPI_BRANCH="v5.0.6"
1212

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

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

5151
# Install tmpi
5252
RUN curl https://raw.githubusercontent.com/Azrael3000/tmpi/master/tmpi -o /usr/local/bin/tmpi
@@ -73,10 +73,14 @@ RUN cd /tmp/ \
7373
--without-knem \
7474
--without-xpmem \
7575
--without-cuda \
76+
--without-java \
77+
--enable-mt \
7678
--enable-optimizations \
7779
--disable-logging \
7880
--disable-debug \
7981
--disable-examples \
82+
--disable-assertions \
83+
--disable-params-check \
8084
&& make -j ${nproc} \
8185
&& make install
8286

@@ -87,17 +91,22 @@ RUN cd /tmp \
8791
&& ./autogen.pl \
8892
&& mkdir build \
8993
&& cd build \
90-
&& ../configure --prefix=$OMPI_HOME --with-ucx=$UCX_HOME \
91-
CC=amdclang CXX=amdclang++ FC=amdflang F90=amdflang \
92-
--enable-mca-no-build=btl-uct \
94+
&& ../configure CC=amdclang CXX=amdclang++ FC=amdflang F90=amdflang \
95+
--prefix=$OMPI_HOME \
96+
--with-ucx=$UCX_HOME \
97+
--with-rocm=$ROCM_HOME \
98+
--enable-mca-no-build=btl-uct \
9399
--without-verbs \
94-
--with-pmix \
95-
--enable-mpi \
96-
--enable-mpi-fortran=yes \
100+
--enable-mpi1-compatibility \
101+
--enable-mpi-fortran=no \
97102
--disable-debug \
98103
&& make -j ${nproc} \
99104
&& make install
100105

106+
# UCX config
107+
ENV UCX_WARN_UNUSED_ENV_VARS=n
108+
ENV UCX_TLS=sm,self,rocm,rocm_copy,rocm_ipc
109+
101110
# Cleanup
102111
RUN rm -rf /tmp/ucx && rm -rf /tmp/ompi
103112

docker/Dockerfile.cpu

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN apt-get update && \
1818
# Install for basic base not containing it
1919
RUN apt-get install -y vim wget git flex libnuma-dev tmux \
2020
numactl hwloc curl \
21-
autoconf libtool build-essential procps
21+
autoconf libtool build-essential procps software-properties-common
2222

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

40+
# Install gcc 13 for better hardware and software support
41+
RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && apt update && \
42+
apt install gcc-13 g++-13 -y && \
43+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 && \
44+
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
45+
4046
ARG OMPI_BRANCH="v4.1.4"
4147
# Install OpenMPI
4248
RUN mkdir -p /deps && mkdir -p /opt/openmpi && cd /deps && \
@@ -47,7 +53,7 @@ RUN mkdir -p /deps && mkdir -p /opt/openmpi && cd /deps && \
4753
--enable-mca-no-build=btl-uct --enable-mpi1-compatibility && \
4854
make -j ${nproc} && \
4955
make install && \
50-
rm -rf /deps/openmpi
56+
cd /deps && rm -rf /deps/openmpi
5157

5258
# Set OpenMPI path
5359
ENV PATH=${PATH}:/opt/openmpi/bin

0 commit comments

Comments
 (0)