-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
84 lines (71 loc) · 3.2 KB
/
Dockerfile
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
ARG IMAGE="rocm_gpu:6.2.4"
FROM ${IMAGE}
ARG CP2K_BRANCH="v2024.3"
WORKDIR /tmp
ENV LD_LIBRARY_PATH=$ROCM_PATH/lib/hipblas:$ROCM_PATH/lib/hipfft:$ROCM_PATH/lib/rocfft:$ROCM_PATH/lib/rocblas:$LD_LIBRARY_PATH \
LIBRARY_PATH=$ROCM_PATH/lib/rocfft:$ROCM_PATH/lib/hipblas:$ROCM_PATH/lib/rocblas:$LIBRARY_PATH \
C_INCLUDE_PATH=$ROCM_PATH/include/rocfft:$ROCM_PATH/include/hipblas:$ROCM_PATH/include/hipfft:$ROCM_PATH/include/rocblas:$C_INCLUDE_PATH \
CPLUS_INCLUDE_PATH=$ROCM_PATH/include/rocfft:$ROCM_PATH/include/hipfft:$ROCM_PATH/include/hipblas:$ROCM_PATH/include/rocblas:$CPLUS_INCLUDE_PATH \
CP2K_DIR=/opt/cp2k
SHELL [ "/bin/bash", "-c" ]
WORKDIR /opt/
# Get CP2K
RUN git clone --recursive -b ${CP2K_BRANCH} https://github.com/cp2k/cp2k.git \
&& cd cp2k/tools/toolchain \
&& ./install_cp2k_toolchain.sh \
-j $(nproc) \
--install-all \
--mpi-mode=openmpi \
--math-mode=openblas \
--gpu-ver=Mi250 \
--enable-hip \
--with-gcc=system \
--with-openmpi=system \
--with-mkl=no \
--with-acml=no \
--with-ptscotch=no \
--with-superlu=no \
--with-pexsi=no \
--with-quip=no \
--with-plumed=no \
--with-sirius=no \
--with-gsl=no \
--with-libvdwxc=no \
--with-spglib=no \
--with-hdf5=no \
--with-spfft=no \
--with-libvori=no \
--with-libtorch=no \
--with-elpa=no \
--with-deepmd=no \
&& sed -i 's/hip\/bin/bin/' /opt/cp2k/tools/toolchain/install/arch/local_hip.psmp \
&& sed -i "s/gfx90a/$GPU_TARGET/" ${CP2K_DIR}/tools/toolchain/install/arch/local_hip.psmp \
&& sed -i "s/gfx90a/$GPU_TARGET/" ${CP2K_DIR}/exts/build_dbcsr/Makefile \
&& cp ${CP2K_DIR}/tools/toolchain/install/arch/* ${CP2K_DIR}/arch \
&& sed -i 's/-D__DBCSR_ACC//' ${CP2K_DIR}/arch/local_hip.psmp \
&& cat ${CP2K_DIR}/arch/local_hip.psmp \
&& source ${CP2K_DIR}/tools/toolchain/install/setup \
&& cd ${CP2K_DIR} \
&& make realclean ARCH=local_hip VERSION=psmp \
&& make -j $(nproc) ARCH=local_hip VERSION=psmp \
&& cp ${CP2K_DIR}/exe/local_hip/cp2k.psmp ${CP2K_DIR}/exe/local_hip/cp2k.psmp.no_dbcsr_gpu \
&& cp ${CP2K_DIR}/tools/toolchain/install/arch/* ${CP2K_DIR}/arch \
&& sed -i 's/-D__DBCSR_ACC/-D__DBCSR_ACC -D__NO_OFFLOAD_PW/' ${CP2K_DIR}/arch/local_hip.psmp \
&& make realclean ARCH=local_hip VERSION=psmp \
&& make -j $(nproc) ARCH=local_hip VERSION=psmp \
&& cp ${CP2K_DIR}/exe/local_hip/cp2k.psmp ${CP2K_DIR}/exe/local_hip/cp2k.psmp.no_pw_gpu \
&& chmod -R 777 /opt/cp2k \
&& ln -s /opt/cp2k/exe/local_hip/ /opt/cp2k/bin \
&& mkdir /tmp/benchmarks
COPY /scripts /scripts
RUN chmod -R 777 /scripts
# Adding environment variable for Running as ROOT
ENV PATH=$PATH:/opt/cp2k/bin:/scripts \
OMPI_MCA_pml=ucx \
OMPI_MCA_pml_ucx_tls=any \
OMPI_MCA_osc=ucx \
OMPI_MCA_btl=^vader,tcp,uct \
OMPI_MCA_pml_ucx_devices=any \
UCX_TLS=self,sm,tcp,rocm
WORKDIR /opt/cp2k/benchmarks
CMD ["/bin/bash"]