FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
devito/docker/Dockerfile.amd at main · devitocodes/devito · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
devitocodes
/
devito
Public
Notifications
You must be signed in to change notification settings
Fork
259
Star
714
Code
Issues
109
Pull requests
45
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
devito
/
docker
/
Dockerfile.amd
Copy path
More file actions
More file actions
Latest commit
History
History
History
131 lines (110 loc) · 4.08 KB
Breadcrumbs
devito
/
docker
/
Dockerfile.amd
Copy path
File metadata and controls
131 lines (110 loc) · 4.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
##############################################################
# This Dockerfile contains AMD compilers
# Based on https://github.com/amd/InfinityHub-CI/tree/main/base-gpu-mpi-rocm-docker
##############################################################
ARG ROCM_VERSION=7.0.2
FROM rocm/dev-ubuntu-22.04:${ROCM_VERSION}-complete AS sdk-base
ARG UCX_BRANCH="v1.17.x"
ARG OMPI_BRANCH="v5.0.x"
# Update and Install basic Linux development tools
RUN rm /etc/apt/sources.list.d/* \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
dh-autoreconf python3-venv python3-dev python3-pip git \
ca-certificates ssh make libtinfo* initramfs-tools libelf-dev \
wget build-essential autoconf automake libtool \
pkg-config libnuma* gfortran flex hwloc cmake
ENV ROCM_HOME=/opt/rocm\
UCX_HOME=/opt/ucx \
OMPI_HOME=/opt/ompi
# Adding ROCM
ENV PATH=$ROCM_HOME/bin:$PATH \
LD_LIBRARY_PATH=$ROCM_HOME/lib:$ROCM_HOME/lib/llvm/lib:$LD_LIBRARY_PATH
# Until rocm base has it fixed
RUN ln -s /opt/rocm/llvm/bin/offload-arch /opt/rocm/bin/offload-arch || echo "offload-arch already exists"
# Install UCX
RUN cd /tmp/ \
&& git clone --depth 1 https://github.com/openucx/ucx.git -b ${UCX_BRANCH} \
&& cd ucx \
&& ./autogen.sh \
&& mkdir build \
&& cd build \
&& ../contrib/configure-release --prefix=$UCX_HOME \
--with-rocm=$ROCM_HOME \
--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
# Install OpenMPI
RUN cd /tmp \
&& git clone --depth 1 --recursive https://github.com/open-mpi/ompi.git -b ${OMPI_BRANCH} \
&& cd ompi \
&& ./autogen.pl \
&& mkdir build \
&& cd build \
&& ../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 \
--enable-mpi1-compatibility \
--enable-mpi-fortran=no \
--disable-debug \
--disable-oshmem \
--disable-man-pages \
&& make -j ${nproc} \
&& make install
# UCX config
ENV UCX_WARN_UNUSED_ENV_VARS=n
ENV UCX_TLS=sm,self,rocm,rocm_copy,rocm_ipc
# Cleanup
RUN rm -rf /tmp/ucx && rm -rf /tmp/ompi
# Adding OpenMPI and UCX to Environment
ENV PATH=$OMPI_HOME/bin:$UCX_HOME/bin:$PATH \
LD_LIBRARY_PATH=$OMPI_HOME/lib:$UCX_HOME/lib:$LD_LIBRARY_PATH \
C_INCLUDE_PATH=$OMPI_HOME/include:$UCX_HOME/include:$C_INCLUDE_PATH \
CPLUS_INCLUDE_PATH=$OMPI_HOME/include:$UCX_HOME/include:$CPLUS_INCLUDE_PATH \
CPATH=$OMPI_HOME/include:$UCX_HOME/include:$CPATH \
INCLUDE=$OMPI_HOME/include:$UCX_HOME/include:$INCLUDE \
PKG_CONFIG_PATH=$OMPI_HOME/lib/pkgconfig:$UCX_HOME/lib/pkgconfig:$PKG_CONFIG_PATH
# Adding environment variable for Running as ROOT
ENV OMPI_ALLOW_RUN_AS_ROOT=1
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
RUN apt-get clean && apt-get autoclean && apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
EXPOSE 8888
CMD ["/bin/bash"]
########################################################################
# AOMP for GPUs (OpenMP offloading)
########################################################################
# This will only trigger if arch is aomp since the final stage depends on it
FROM sdk-base AS amdclang
# MPI env
ENV OMPI_CC="amdclang"
ENV OMPI_CXX="amdclang++"
# Devito env
ENV DEVITO_ARCH="aomp"
ENV DEVITO_PLATFORM="amdgpuX"
ENV DEVITO_LANGUAGE="openmp"
########################################################################
# HIPCC for GPUs (HIP)
########################################################################
# This will only trigger if arch is hip since the final stage depends on it
FROM sdk-base AS hip
# MPI env
ENV OMPI_CC="hipcc"
ENV OMPI_CXX="hipcc"
# Devito env
ENV DEVITO_ARCH="hip"
ENV DEVITO_PLATFORM="amdgpuX"
ENV DEVITO_LANGUAGE="hip"
Back
|
FazBrowse Home
|
New Git URL