Skip to content

Commit e8bf1fb

Browse files
authored
Merge pull request #2529 from devitocodes/amd-offload-flag
CI: Revert amd CI to a stable rocm for openmp offloading
2 parents 6046f82 + 3bf89eb commit e8bf1fb

File tree

3 files changed

+34
-24
lines changed

3 files changed

+34
-24
lines changed

.github/workflows/docker-bases.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ jobs:
222222
file: './docker/Dockerfile.amd'
223223
push: true
224224
target: 'amdclang'
225+
build-args: |
226+
ROCM_VERSION=5.5.1
227+
UCX_BRANCH=v1.13.1
228+
OMPI_BRANCH=v4.1.4
225229
tags: devitocodes/bases:amd
226230

227231
- name: AMD HIP image
@@ -231,6 +235,4 @@ jobs:
231235
file: './docker/Dockerfile.amd'
232236
push: true
233237
target: 'hip'
234-
build-args: |
235-
arch=hip
236238
tags: devitocodes/bases:amd-hip

docker/Dockerfile.amd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ ENV ROCM_HOME=/opt/rocm \
4545
UCX_HOME=/opt/ucx \
4646
OMPI_HOME=/opt/ompi
4747

48+
# Adding ROCM
49+
ENV PATH=$ROCM_HOME/bin:$PATH \
50+
LD_LIBRARY_PATH=$ROCM_HOME/lib:$ROCM_HOME/lib/llvm/lib:$LD_LIBRARY_PATH
51+
4852
# Until rocm base has it fixed
4953
RUN ln -s /opt/rocm/llvm/bin/offload-arch /opt/rocm/bin/offload-arch | echo "offload-arch already exis"
5054

docker/Dockerfile.devito

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,46 @@ ARG USER_ID=1000
1212
ARG GROUP_ID=1000
1313

1414
################## Install devito ############################################
15-
# Copy Devito
16-
ADD . /app/devito
1715

18-
# Update if outdated
19-
RUN apt-get update
16+
# Update if outdated and install extras
17+
RUN apt-get update && \
18+
apt-get install -y git cmake libncurses5-dev libncursesw5-dev libdrm-dev libsystemd-dev
2019

21-
# Remove git files
22-
RUN rm -rf /app/devito/.git
20+
# Usefull utilities
21+
# Nvtop
22+
RUN git clone https://github.com/Syllo/nvtop.git /app/nvtop && \
23+
mkdir -p /app/nvtop/build && cd /app/nvtop/build && \
24+
cmake .. -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON -DINTEL_SUPPORT=ON && \
25+
make && make install
2326

24-
# Install pip dependencies and devito as a pip package
27+
# Install pip dependencies
2528
RUN python3 -m venv /venv && \
2629
/venv/bin/pip install --no-cache-dir --upgrade pip && \
2730
/venv/bin/pip install --no-cache-dir jupyter && \
2831
/venv/bin/pip install --no-cache-dir wheel && \
29-
eval "$MPI4PY_FLAGS /venv/bin/pip install --no-cache-dir -r /app/devito/requirements-mpi.txt" && \
30-
/venv/bin/pip install --no-cache-dir -e /app/devito[extras,tests] && \
31-
rm -rf ~/.cache/pip
32-
33-
# Usefull utilities
34-
# Nvtop
35-
RUN apt-get install -y git cmake libncurses5-dev libncursesw5-dev libdrm-dev libsystemd-dev cmake && \
36-
git clone https://github.com/Syllo/nvtop.git /app/nvtop && \
37-
mkdir -p /app/nvtop/build && cd /app/nvtop/build && \
38-
cmake .. -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON -DINTEL_SUPPORT=ON && \
39-
make && \
40-
make install && \
4132
ln -fs /app/nvtop/build/src/nvtop /venv/bin/nvtop
4233

43-
# Safety cleanup
44-
RUN apt-get clean && apt-get autoclean && apt-get autoremove -y && \
45-
rm -rf /var/lib/apt/lists/*
34+
# Copy Devito
35+
ADD . /app/devito
36+
37+
# Remove git files
38+
RUN rm -rf /app/devito/.git
39+
40+
# Mpi4py
41+
RUN eval "$MPI4PY_FLAGS /venv/bin/pip install --no-cache-dir --verbose -r /app/devito/requirements-mpi.txt"
42+
43+
# Devito
44+
RUN /venv/bin/pip install --no-cache-dir -e /app/devito[extras,tests] && rm -rf ~/.cache/pip
4645

4746
FROM $base as user
4847
# COPY is much faster than RUN chown by order of magnitude so we have a final step that
4948
# just copies the built image into the user.
5049

50+
# Last installs (such as gdb needed in user mode) and cleanup
51+
RUN apt-get update && apt install gdb -y && \
52+
apt-get clean && apt-get autoclean && apt-get autoremove -y && \
53+
rm -rf /var/lib/apt/lists/*
54+
5155
# User/Group Ids
5256
ARG USER_ID=1000
5357
ARG GROUP_ID=1000

0 commit comments

Comments
 (0)