You need:
Optional:
pkg-config
) for Small Matrix Multiplication accelerationTo build DBCSR's GPU backend:
opencl-headers
), generic loader "ocl-icd" (ocl-icd-opencl-dev
),DEFAULT
(nvidia-smi -c DEFAULT
) if MPI puts multiple ranks onto a single GPU;
MPS daemon with GPU mode EXCLUSIVE_PROCESS
is not an optionclinfo
(can be useful to show available devices)DBCSR is tested against GNU and Intel compilers on Linux systems, and GNU compiler on MacOS systems. See a list of supported compilers here.
Download either a release tarball or clone the latest version from Git using:
git clone --recursive https://github.com/cp2k/dbcsr.git
DBCSR can be compiled in four main variants: * Serial, i.e., no OpenMP and no MPI * OpenMP * MPI * OpenMP+MPI In addition, the variants can support accelerators.
Run inside the dbcsr
directory:
mkdir build
cd build
cmake ..
make
The configuration flags for the CMake command are (default first):
-DUSE_MPI=<ON|OFF>
-DUSE_OPENMP=<ON|OFF>
-DUSE_SMM=<blas|libxsmm>
-DUSE_ACCEL=<opencl|cuda|hip>
-DWITH_CUDA_PROFILING=<OFF|ON>
-DWITH_HIP_PROFILING=<OFF|ON>
-DWITH_C_API=<ON|OFF>
-DWITH_EXAMPLES=<ON|OFF>
-DWITH_GPU=<P100|K20X|K40|K80|V100|Mi50|Mi100|Mi250>
-DCMAKE_BUILD_TYPE=<Release|Debug|Coverage>
-DBUILD_TESTING=<ON|OFF>
-DTEST_MPI_RANKS=<2|auto|N>
-DTEST_OMP_THREADS=<2|N>
When providing a build of LIBXSMM, make sure the lib
directory is added to the PKG_CONFIG_PATH
variable prior
to running cmake
. For example, if LIBXSMM was checked out using Git to your home folder:
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${HOME}/libxsmm/lib"
For build recipes on different platforms, make sure to also read the CMake Build Recipes.
DBCSR and its dependencies can be built with the spack package manager:
spack install dbcsr +openmp +mpi +cuda cuda_arch=70
spack install dbcsr +openmp +mpi +rocm amdgpu_target=gfx906
spack install dbcsr +openmp +mpi +opencl ^cuda
See spack info dbcsr
for all supported variants.
If MPI support is enabled (the default), the C API is automatically built.