Skip to content

Instantly share code, notes, and snippets.

@link89
Last active December 10, 2025 01:31
Show Gist options
  • Select an option

  • Save link89/173f4cf5a724f224f010576e529d9e1f to your computer and use it in GitHub Desktop.

Select an option

Save link89/173f4cf5a724f224f010576e529d9e1f to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
# create conda environment
module load miniconda
module load cuda/12.4
module load gcc/14.2
export CONDA_OVERRIDE_CUDA=12.6 # this is essential for deepmd-kit
[ -f ./common/conda.done ] || {
conda create -y -p ./common python=3.12.12 \
netcdf4 plumed deepmd-kit \
-c conda-forge --override-channels
touch ./common/conda.done
}
source activate ./common
[ -d 4.6 ] || {
wget https://github.com/brucefan1983/GPUMD/archive/refs/tags/v4.6.tar.gz
tar -xvf GPUMD-4.6.tar.gz
mv GPUMD-4.6 4.6
}
# You may need to edit ./4.6/src/makefile to change gpu arch and deepmd support
pushd ./4.6/src
[ -f compile.done ] || {
export C_INCLUDE_PATH=$CONDA_PREFIX/include:$C_INCLUDE_PATH
export CXX_INCLUDE_PATH=$CONDA_PREFIX/include:$CXX_INCLUDE_PATH
export CPATH=$CONDA_PREFIX/include:$CPATH
export LIBRARY_PATH=$CONDA_PREFIX/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
export PATH=$CUDA_HOME/bin:$PATH
which nvcc
make gpumd -j 4
touch compile.done
}
popd
cat << 'EOF' > ./4.6/activate
#!/bin/bash
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
module load miniconda cuda/12.4 gcc/14.2
source activate $SCRIPT_DIR/../common
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
export PATH=$SCRIPT_DIR/src:$PATH
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment