GROMACS is a popular molecular dynamics application used to simulate proteins and lipids.
GROMACS
GROMACS is a molecular dynamics application designed to simulate Newtonian equations of motion for systems with hundreds to millions of particles. GROMACS is designed to simulate biochemical molecules like proteins, lipids, and nucleic acids that have a lot of complicated bonded interactions.
System requirements
Before running the NGC GROMACS container please ensure your system meets the following requirements.
- One of the following container runtimes
- nvidia-docker
- Singularity >= 3.1
- One of the following NVIDIA GPU(s)
- Ampere (sm80)
- Hopper (sm90)
- Blackwell (sm100)
x86_64
- CPU with AVX instruction support
- One of the following CUDA driver versions
- r580 (>=.65)
- >=580.65.06
arm64
- CPU with ARMv8.2-A instruction support
- CUDA driver version >= r580
Examples
The following examples demonstrate using the NGC GROMACS container to run the STMV benchmark. Reference performance, on a range of systems, can be found at https://developer.nvidia.com/hpc-application-performance.
Throughout this example the container version will be referenced as $GROMACS_TAG, replace this with the tag you wish to run.
Download the STMV benchmark:
wget https://zenodo.org/record/3893789/files/GROMACS_heterogeneous_parallelization_benchmark_info_and_systems_JCP.tar.gz
tar xf GROMACS_heterogeneous_parallelization_benchmark_info_and_systems_JCP.tar.gz
cd GROMACS_heterogeneous_parallelization_benchmark_info_and_systems_JCP/stmv
Running
Run GROMACS using 4 GPUs (with IDs 0,1,2,3). Here we use 2 thread-MPI tasks per GPU (-ntmpi 8), which we find gives good performance. We set 16 OpenMP threads per thread-MPI task (assuming at least 128 CPU cores in the system). These can be adjusted to map to any specific hardware system, and experimented with for best performance.
Docker
export GMX_ENABLE_DIRECT_GPU_COMM=1
DOCKER="docker run --gpus all -it --rm -v ${PWD}:/host_pwd --workdir /host_pwd nvcr.io/nvidia/gromacs:${GROMACS_TAG}"
${DOCKER} gmx mdrun -ntmpi 8 -ntomp 16 -nb gpu -pme gpu -npme 1 -update gpu -bonded gpu -nsteps 100000 -resetstep 90000 -noconfout -dlb no -nstlist 300 -pin on -v -gpu_id 0123
Singularity
export GMX_ENABLE_DIRECT_GPU_COMM=1
SINGULARITY="singularity run --nv -B ${PWD}:/host_pwd --pwd /host_pwd docker://nvcr.io/nvidia/gromacs:${GROMACS_TAG}"
${SINGULARITY} gmx mdrun -ntmpi 8 -ntomp 16 -nb gpu -pme gpu -npme 1 -update gpu -bonded gpu -nsteps 100000 -resetstep 90000 -noconfout -dlb no -nstlist 300 -pin on -v -gpu_id 0123
Suggested Reading
Massively Improved Multi-node NVIDI
Maximizing Energy and Power Efficiency in Applications with NVIDIA GPUs