DeepMD-kit installation
Version: DeepMD-kit v2.2.5
module load anaconda/2020.3
conda create -n deepmd python=3.9
pip install tensorflow==2.9 --upgrade
pip install scikit-build ninja cmake
pip install protobuf==3.20
pip install numpy==1.21.6
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
touch $CONDA_PREFIX/etc/conda/activate.d/activate.sh
mkdir -p $CONDA_PREFIX/etc/conda/deactivate.d
touch $CONDA_PREFIX/etc/conda/deactivate.d/deactivate.sh
Add the following lines to $CONDA_PREFIX/etc/conda/activate.d/activate.sh
:
export TMP_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
# load mpi/gcc/cuda/lammps
module load intel/2018.3
module load gcc/9.2
module load cuda/11.3
module load lammps/2022.6.23
export CC=`which gcc`
export CXX=`which g++`
export FC=`which gfortran`
export DP_VARIANT=cuda
export deepmd_source_dir=/home/user/apps/deepmd
export tensorflow_root=$deepmd_source_dir/build/tensorflow_root
export deepmd_root=$deepmd_source_dir/build/deepmd_root
export LAMMPS_PLUGIN_PATH=$deepmd_root/lib/deepmd_lmp
export LD_LIBRARY_PATH=$tensorflow_root/lib:$deepmd_root/lib:$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
Add the following lines to $CONDA_PREFIX/etc/conda/deactivate.d/deactivate.sh
:
module unload intel/2018.3
#module unload oneapi/2021.1
module unload gcc/9.2
module unload cuda/11.3
module unload lammps/2022.6.23
unset deepmd_source_dir
unset tensorflow_root
unset deepmd_root
unset LAMMPS_PLUGIN_PATH
unset DP_VARIANT
export LD_LIBRARY_PATH=$TMP_LD_LIBRARY_PATH
unset TMP_LD_LIBRARY_PATH
Install DeepMD-kit:
cd $deepmd_source_dir
pip install -e .
mkdir -p $tensorflow_root/lib
cd $tensorflow_root
ln -s $CONDA_PREFIX/lib/python3.9/site-packages/tensorflow/include .
cd lib
ln -s $CONDA_PREFIX/lib/python3.9/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so libtensorflow_cc.so
ln -s $CONDA_PREFIX/lib/python3.9/site-packages/tensorflow/libtensorflow_framework.so.2 .
ln -s libtensorflow_framework.so.2 libtensorflow_framework.so
mkdir -p $deepmd_source_dir/source/build
mkdir -p $deepmd_root
cd $deepmd_source_dir/source/build
cmake -DLAMMPS_SOURCE_ROOT=/home/user/apps/lammps/lammps-23Jun2022 -DUSE_TF_PYTHON_LIBS=TRUE -DUSE_CUDA_TOOLKIT=TRUE -DTENSORFLOW_ROOT=$tensorflow_root -DCMAKE_INSTALL_PREFIX=$deepmd_root ..
make -j20
make install
Enjoy Reading This Article?
Here are some more articles you might like to read next: