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.
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.
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 v2023.2
or any other tag previously posted on NGC.
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
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
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.
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
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}