From 1aa9ae871e51fc95c113cfb952bd9c8a8e4edfa3 Mon Sep 17 00:00:00 2001 From: caic99 Date: Fri, 17 Nov 2023 14:12:33 +0800 Subject: [PATCH 1/3] Build: update MKL version --- Dockerfile.intel | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/Dockerfile.intel b/Dockerfile.intel index ec5d7a53d6..8d65201dce 100644 --- a/Dockerfile.intel +++ b/Dockerfile.intel @@ -5,38 +5,29 @@ RUN apt-get update && apt-get install -y \ libcereal-dev libxc-dev libgtest-dev libgmock-dev # Following steps by https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/apt.html . -RUN cd /tmp && \ - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ - apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ - rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ - echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - -# To save disk space, only install the required components, but not the whole intel-hpckit. -RUN apt-get update --allow-unauthenticated && \ - apt-get install -y --no-install-recommends \ +RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \ + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \ + | sudo tee /etc/apt/sources.list.d/oneAPI.list + +# To save disk space, only install the essential components, but not the whole toolkit. +RUN apt-get update && \ + apt-get install -y \ intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \ intel-oneapi-compiler-fortran \ intel-oneapi-mkl-devel \ intel-oneapi-mpi-devel \ intel-oneapi-vtune -# These environment variables are the most essential part generated by `source /opt/intel/oneapi/setvars.sh`. -# It is recommended to do it again if this docker image is used for development. -ENV I_MPI_ROOT='/opt/intel/oneapi/mpi/latest' \ - LIBRARY_PATH=/opt/intel/oneapi/tbb/latest/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/latest/libfabric/lib:/opt/intel/oneapi/mpi/latest/lib/release:/opt/intel/oneapi/mpi/latest/lib:/opt/intel/oneapi/mkl/latest/lib/intel64:/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin:/opt/intel/oneapi/compiler/latest/linux/lib \ - LD_LIBRARY_PATH=/opt/intel/oneapi/tbb/latest/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/latest/libfabric/lib:/opt/intel/oneapi/mpi/latest/lib/release:/opt/intel/oneapi/mpi/latest/lib:/opt/intel/oneapi/mkl/latest/lib/intel64:/opt/intel/oneapi/debugger/10.1.2/gdb/intel64/lib:/opt/intel/oneapi/debugger/10.1.2/libipt/intel64/lib:/opt/intel/oneapi/debugger/10.1.2/dep/lib:/opt/intel/oneapi/compiler/latest/linux/lib:/opt/intel/oneapi/compiler/latest/linux/lib/x64:/opt/intel/oneapi/compiler/latest/linux/lib/emu:/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin \ - PATH=/opt/intel/oneapi/vtune/latest/bin64:/opt/intel/oneapi/mpi/latest/libfabric/bin:/opt/intel/oneapi/mpi/latest/bin:/opt/intel/oneapi/mkl/latest/bin/intel64:/opt/intel/oneapi/dev-utilities/latest/bin:/opt/intel/oneapi/debugger/10.1.2/gdb/intel64/bin:/opt/intel/oneapi/compiler/latest/linux/bin/intel64:/opt/intel/oneapi/compiler/latest/linux/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - MKLROOT='/opt/intel/oneapi/mkl/latest' \ - FI_PROVIDER_PATH='/opt/intel/oneapi/mpi/latest/libfabric/lib/prov:/usr/lib64/libfabric' \ - CMAKE_PREFIX_PATH='/opt/intel/oneapi/vpl/latest:/opt/intel/oneapi/tbb/latest/env/..:/opt/intel/oneapi/dnnl/latest/cpu_dpcpp_gpu_dpcpp/../lib/cmake:/opt/intel/oneapi/dal/latest:/opt/intel/oneapi/compiler/latest/linux/IntelDPCPP' \ - CMPLR_ROOT='/opt/intel/oneapi/compiler/latest' - -ENV CC=mpiicc CXX=mpiicpc FC=mpiifort - +RUN echo "source /opt/intel/oneapi/setvars.sh \nsource /opt/intel/oneapi/compiler/2024.0/env/vars.sh" >> ${HOME}/.bashrc SHELL ["/bin/bash", "-c"] + +# Install ELPA with `icx` compiler fails for AVX instruction checks. Fall back to `icc`. RUN source /opt/intel/oneapi/setvars.sh && \ + source /opt/intel/oneapi/compiler/2024.0/env/vars.sh && \ + export CC=mpiicc CXX=mpiicpc FC=mpiifort && \ cd /tmp && \ - ELPA_VER=2021.05.002 && \ + ELPA_VER=2021.11.001 && \ wget -q https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/$ELPA_VER/elpa-$ELPA_VER.tar.gz && \ tar xzf elpa-$ELPA_VER.tar.gz && rm elpa-$ELPA_VER.tar.gz && \ cd elpa-$ELPA_VER && mkdir build && cd build && \ @@ -51,15 +42,17 @@ RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-wit unzip -q libtorch.zip -d /opt && rm libtorch.zip ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake \ - I_MPI_CXX=icpx + CC=mpiicx CXX=mpiicpx FC=mpiifx ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/develop /dev/null -RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \ +RUN source /opt/intel/oneapi/setvars.sh && \ + source /opt/intel/oneapi/compiler/2024.0/env/vars.sh && \ + git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \ cd abacus-develop && \ cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON && \ cmake --build build -j`nproc` && \ cmake --install build && \ rm -rf build && \ - cd .. + abacus --version #&& rm -rf abacus-develop From 9899cce5b96b4ce7d2b5089554f4b31b28fbe997 Mon Sep 17 00:00:00 2001 From: caic99 Date: Fri, 17 Nov 2023 15:46:08 +0800 Subject: [PATCH 2/3] Update Dockerfile with new ELPA version and configure options --- Dockerfile.intel | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile.intel b/Dockerfile.intel index 8d65201dce..42881f9681 100644 --- a/Dockerfile.intel +++ b/Dockerfile.intel @@ -21,17 +21,16 @@ RUN apt-get update && \ RUN echo "source /opt/intel/oneapi/setvars.sh \nsource /opt/intel/oneapi/compiler/2024.0/env/vars.sh" >> ${HOME}/.bashrc SHELL ["/bin/bash", "-c"] +ENV CC=mpiicx CXX=mpiicpx FC=mpiifx -# Install ELPA with `icx` compiler fails for AVX instruction checks. Fall back to `icc`. RUN source /opt/intel/oneapi/setvars.sh && \ source /opt/intel/oneapi/compiler/2024.0/env/vars.sh && \ - export CC=mpiicc CXX=mpiicpc FC=mpiifort && \ cd /tmp && \ - ELPA_VER=2021.11.001 && \ + ELPA_VER=2022.11.001 && \ wget -q https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/$ELPA_VER/elpa-$ELPA_VER.tar.gz && \ tar xzf elpa-$ELPA_VER.tar.gz && rm elpa-$ELPA_VER.tar.gz && \ cd elpa-$ELPA_VER && mkdir build && cd build && \ - ../configure FCFLAGS="-qmkl=cluster" --enable-openmp && \ + ../configure CFLAGS="-O3 -march=native" FCFLAGS="-O3 -qmkl=cluster" --enable-openmp && \ make -j`nproc` && \ make PREFIX=/usr/local install && \ ln -s /usr/local/include/elpa_openmp-$ELPA_VER/elpa /usr/local/include/ && \ @@ -41,8 +40,7 @@ RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-wit --no-check-certificate --quiet -O libtorch.zip && \ unzip -q libtorch.zip -d /opt && rm libtorch.zip -ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake \ - CC=mpiicx CXX=mpiicpx FC=mpiifx +ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/develop /dev/null From d32a3a995a24c0e5d2f7af316c2f817234f26049 Mon Sep 17 00:00:00 2001 From: caic99 Date: Fri, 17 Nov 2023 16:02:21 +0800 Subject: [PATCH 3/3] remove intel classic cpp compilers --- Dockerfile.intel | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile.intel b/Dockerfile.intel index 42881f9681..f4e2a042ff 100644 --- a/Dockerfile.intel +++ b/Dockerfile.intel @@ -13,18 +13,18 @@ RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRO # To save disk space, only install the essential components, but not the whole toolkit. RUN apt-get update && \ apt-get install -y \ - intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \ + intel-oneapi-compiler-dpcpp-cpp \ intel-oneapi-compiler-fortran \ intel-oneapi-mkl-devel \ intel-oneapi-mpi-devel \ intel-oneapi-vtune -RUN echo "source /opt/intel/oneapi/setvars.sh \nsource /opt/intel/oneapi/compiler/2024.0/env/vars.sh" >> ${HOME}/.bashrc +RUN echo "source /opt/intel/oneapi/setvars.sh" >> ${HOME}/.bashrc SHELL ["/bin/bash", "-c"] ENV CC=mpiicx CXX=mpiicpx FC=mpiifx +# https://elpa.mpcdf.mpg.de/software/tarball-archive/ELPA_TARBALL_ARCHIVE.html RUN source /opt/intel/oneapi/setvars.sh && \ - source /opt/intel/oneapi/compiler/2024.0/env/vars.sh && \ cd /tmp && \ ELPA_VER=2022.11.001 && \ wget -q https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/$ELPA_VER/elpa-$ELPA_VER.tar.gz && \ @@ -45,7 +45,6 @@ ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/develop /dev/null RUN source /opt/intel/oneapi/setvars.sh && \ - source /opt/intel/oneapi/compiler/2024.0/env/vars.sh && \ git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \ cd abacus-develop && \ cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON && \