A quantum chemistry and solid state physics software package
CP2k
CP2K is a quantum chemistry and solid state physics software package that can perform atomistic simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems. CP2K provides a general framework for different modeling methods such as DFT using the mixed Gaussian and plane waves approaches GPW and GAPW. Supported theory levels include DFTB, LDA, GGA, MP2, RPA, semi-empirical methods (AM1, PM3, PM6, RM1, MNDO, ...), and classical force fields (AMBER, CHARMM, ...). CP2K can do simulations of molecular dynamics, metadynamics, Monte Carlo, Ehrenfest dynamics, vibrational analysis, core level spectroscopy, energy minimization, and transition state optimization using NEB or dimer method.
System Requirements
- NVIDIA Container Toolkit
- Singularity >= 3.1
- One of the following NVIDIA GPU(s)
- Pascal(sm60)
- Volta (sm70)
- Ampere (sm80)
- Hopper (sm90)
x86_64
- CPU with AVX2 instruction support
- One of the following CUDA driver versions
- >= 527.41
arm64
- Pascal(sm60), Volta(sm70), Ampere (sm80/sm86), or Hopper (sm90) NVIDIA GPU(s)
- CPU with Neoverse-N1 instruction support
- One of the following CUDA driver versions
- >=525.60.13
Running CP2k
Download the Benchmark
For this example we will use the QS_DM_LS benchmark that will perform a single-point energy calculation using linear-scaling DFT. More information on this benchmark can be found here.
Select Tag
Several CP2K images are available, depending on your needs. Set the following environment variable which will be used in the example below.
export CP2K_TAG={TAG}
Where {TAG} is v2024.3 or any other tag previously posted on NGC.
Running with the NVIDIA Container Toolkit
Without Infiniband
docker run -it --privileged --rm --gpus all --shm-size 32Gb -v ${PWD}:/host_pwd --workdir /host_pwd nvcr.io/hpc/cp2k:${CP2K_TAG} mpirun -n 2 cp2k.psmp -i H2O-dft-ls.NREP2.inp
With Infiniband
docker run -it --privileged --rm -v ${PWD}:/host_pwd --workdir /host_pwd --gpus all --shm-size 32Gb --device=/dev/infiniband --cap-add=IPC_LOCK --net=host nvcr.io/hpc/cp2k:${CP2K_TAG} mpirun -n 2 cp2k.psmp -i H2O-dft-ls.NREP2.inp
Note: Docker Versions <=20.xx.xx
There is currently a bug in older Docker versions with newer Ubuntu images, using the latest tag of CP2K requires the --privileged flag to run the container, or an update to Docker.
Running with Singularity
singularity run --nv -B ${PWD}:/host_pwd --pwd /host_pwd docker://nvcr.io/hpc/cp2k:${CP2K_TAG} mpirun -n 2 cp2k.psmp -i H2O-dft-ls.NREP2.inp
Note: Singularity 3.1.x - 3.2.x
There is currently a bug in Singularity 3.1.x and 3.2.x causing the LD_LIBRARY_PATH to be incorrectly set within the container environment.
As a workaround The LD_LIBRARY_PATH must be unset before invoking Singularity:
$ LD_LIBRARY_PATH="" singularity run --nv -B ${PWD}:/host_pwd --pwd /host_pwd docker://nvcr.io/hpc/cp2k:${CP2K_TAG}