Skip to content

Latest commit

 

History

History

baremetal

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

CP2K Bare Metal Build Instructions

Overview

This document provides instructions on how to do a bare metal install of CP2K in a Linux environment.

Single-Node Server Requirements

CPUs GPUs Operating Systems ROCm™ Driver
X86_64 CPU(s) AMD Instinct MI200 GPU(s)
AMD Instinct MI100 GPU(s)
Ubuntu 20.04
Ubuntu 22.04
RHEL8
RHEL9
SLES 15 sp4
ROCm v6.x compatibility
ROCm v5.x compatibility

For ROCm installation procedures and validation checks, see:

System Dependencies

Application Minimum Recommended
Git Latest Latest
ROCm 5.3.0 latest
OpenMPI 4.0.3 5.0.3
UCX 1.8.0 1.16.0

Installing CP2K using CP2K toolchain

  1. Validate the Cluster/System has all of the above applications, with system path, library, and include environments set correctly. If you are unsure, the Dockerfile has examples of all useful configurations listed after the ENV commands.
  2. Clone the CP2K GIT repo into your workspace.
git clone --recursive https://github.com/cp2k/cp2k.git
  1. Install CP2K dependencies with CP2Ks toolchains script.
    More Details for how the toolchain works visit cp2k/tool/Toolchain the CP2K repo. A variable GPU_VER has been provided to set the GPU architecture to be built: Mi50, Mi100, Mi250. This specifies the GPU architecture for which DBCSR will be built. Mi250 is used for all MI200 series accelerators.
cd cp2k/tools/toolchain
./install_cp2k_toolchain.sh \
            -j8 \
            --install-all \
            --mpi-mode=openmpi \
            --math-mode=openblas \
            --gpu-ver=${GPU_VER} \
            --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
  1. Copy tool chain build files to cp2k/arch
cp cp2k/tools/toolchain/install/arch/* cp2k/arch/.
  1. Tuning for build. (Optional) CP2K will build without inclusion of these tuning flags, but it is recommended for performance to include these depending on what kind of Benchmark/Workload to be run.
  • RPA Benchmarks/Workloads:
    This executable has been built without the DBCSR GPU backend as it improves the performance of Random Phase Approximation (RPA) benchmarks.
echo "DFLAGS      = -D__LIBXSMM  -D__parallel -D__FFTW3  -D__LIBINT -D__LIBXC -D__SCALAPACK -D__COSMA -D__OFFLOAD_GEMM   -D__SPLA   -D__HIP_PLATFORM_AMD__ -D__OFFLOAD_HIP" >> cp2k/arch/local_hip.psmp
  • DFT Benchmarks/Workloads:
    This executable has been built without the PW GPU backend as it improves the performance of Linear Scaling Density Functional Theory
echo "DFLAGS      = -D__LIBXSMM  -D__parallel -D__FFTW3  -D__LIBINT -D__LIBXC -D__SCALAPACK -D__COSMA -D__OFFLOAD_GEMM   -D__SPLA   -D__HIP_PLATFORM_AMD__ -D__OFFLOAD_HIP -D__DBCSR_ACC -D__NO_OFFLOAD_PW" >> cp2k/arch/local_hip.psmp
  1. Build CP2K
make realclean ARCH=local_hip VERSION=psmp
make -j (nproc) ARCH=local_hip VERSION=psmp
  1. Add Binary to PATH The binary gets build in cp2k/exe/local_hip
ln -s /path/to/cp2k/exe/local_hip /path/to/cp2k/bin 
export PATH=$PATH:/path/to/cp2k/bin
  1. Build other binary. (Optional) You may want both the RPA and DFT tuned binary. You will want to update the binary name to be descriptive of the build. In the container they are cp2k.psmp.no_dbcsr_gpu and cp2k.psmp.no_pw_gpu to give a descriptive name to the two binaries. The best way to achieve that is to repeat steps 4-6 using the other tuned options.

  2. Add affinity scripts that help tune at runtime. Two affinity scripts have been provided that will help tune the CPU/GPU usage at runtime. Adding these scripts to the location with the binary(s) or any directory in the system's PATH will allow a user to take advantage of these scripts that have been provided and how to use them which is provided Running CP2K Benchmark.

Licensing Information

Your use of this application is subject to the terms of the applicable component-level license identified below. To the extent any subcomponent in this container requires an offer for corresponding source code, AMD hereby makes such an offer for corresponding source code form, which will be made available upon request. By accessing and using this application, you are agreeing to fully comply with the terms of this license. If you do not agree to the terms of this license, do not access or use this application.

The application is provided in a container image format that includes the following separate and independent components:

Package License URL
Ubuntu Creative Commons CC-BY-SA Version 3.0 UK License Ubuntu Legal
CMAKE OSI-approved BSD-3 clause CMake License
OpenMPI BSD 3-Clause OpenMPI License
OpenMPI Dependencies Licenses
OpenUCX BSD 3-Clause OpenUCX License
ROCm Custom/MIT/Apache V2.0/UIUC OSL ROCm Licensing Terms
CP2K GNU GPL Version 2 CP2k
CP2K License
OpenBlas BSD 3-Clause OpenBlas
OpenBlas License
COSMA BSD 3-Clause COSMA License
Libxsmm BSD 3-Classe Libxsmm License
Libxc MPL v2.0 Libxc License
SpLA BSD 3-Clause SpLA License

Additional third-party content in this container may be subject to additional licenses and restrictions. The components are licensed to you directly by the party that owns the content pursuant to the license terms included with such content and is not licensed to you by AMD. ALL LINKED THIRD-PARTY CONTENT IS MADE AVAILABLE BY AMD “AS IS” WITHOUT A WARRANTY OF ANY KIND. USE OF THE CONTAINER IS DONE AT YOUR SOLE DISCRETION AND UNDER NO CIRCUMSTANCES WILL AMD BE LIABLE TO YOU FOR ANY THIRD-PARTY CONTENT. YOU ASSUME ALL RISK AND ARE SOLELY RESPONSIBLE FOR ANY DAMAGES THAT MAY ARISE FROM YOUR USE OF THE CONTAINER.

Disclaimer

The information contained herein is for informational purposes only, and is subject to change without notice. In addition, any stated support is planned and is also subject to change. While every precaution has been taken in the preparation of this document, it may contain technical inaccuracies, omissions and typographical errors, and AMD is under no obligation to update or otherwise correct this information. Advanced Micro Devices, Inc. makes no representations or warranties with respect to the accuracy or completeness of the contents of this document, and assumes no liability of any kind, including the implied warranties of noninfringement, merchantability or fitness for particular purposes, with respect to the operation or use of AMD hardware, software or other products described herein. No license, including implied or arising by estoppel, to any intellectual property rights is granted by this document. Terms and limitations applicable to the purchase or use of AMD’s products are as set forth in a signed agreement between the parties or in AMD's Standard Terms and Conditions of Sale.

Notices and Attribution

© 2022-23 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo, Instinct, Radeon Instinct, ROCm, and combinations thereof are trademarks of Advanced Micro Devices, Inc.

Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein. Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.

All other trademarks and copyrights are property of their respective owners and are only mentioned for informative purposes.