---
title: "GROMACS in Conda Environment"
canonical: "https://kb.uconn.edu/space/SH/27020099609/GROMACS%20in%20Conda%20Environment"
format: markdown
---
### Prerequisites

Ensure you have Miniconda installed and configured. Please refer to the [Miniconda Environment Set Up - Storrs HPC - UConn Knowledge Base](https://kb.uconn.edu/space/SH/26079723879/Miniconda+Environment+Set+Up) for more information.

### Start an Interactive Session on a GPU

```
srun -n 1 -N 1 -p general-gpu --gres=gpu:1 --pty bash
```

### Create a New Conda Environment

```
conda create -n gromacs_env
conda activate gromacs_env
```

### Install GROMACS

```
conda search -c conda-forge gromacs
```

Output:

```
.
.
.
gromacs                       2024.2 nompi_cuda_h40ca9ac_3  conda-forge
gromacs                       2024.2 nompi_cuda_h5cb645a_2  conda-forge
gromacs                       2024.2 nompi_cuda_h5cb645a_4  conda-forge
gromacs                       2024.2 nompi_dblprec_h59f40fa_0  conda-forge
gromacs                       2024.2 nompi_dblprec_h59f40fa_1  conda-forge
gromacs                       2024.2 nompi_dblprec_h59f40fa_2  conda-forge
gromacs                       2024.2 nompi_dblprec_he352f3d_3  conda-forge
gromacs                       2024.2 nompi_dblprec_he352f3d_4  conda-forge
gromacs                       2024.2 nompi_h2670ae1_100  conda-forge
gromacs                       2024.2 nompi_h2670ae1_101  conda-forge
gromacs                       2024.2 nompi_h2670ae1_102  conda-forge
gromacs                       2024.2 nompi_he02fced_103  conda-forge
gromacs                       2024.2 nompi_he02fced_104  conda-forge
```

> ℹ️ The latest version we are interested in that supports CUDA (as of 7/18/2024) is `2024.2 nompi_cuda_h5cb645a_4` This is subject to changes/updates!

```
conda install -c conda-forge gromacs=2024.2=nompi_cuda_h5cb645a_4
```

### Check Version

```
gmx --version
```

Output:

```
                   :-) GROMACS - gmx, 2024.2-conda_forge (-:
Executable:   /home/anl14042admin/miniconda3/envs/gromacs_A100/bin.AVX2_256/gmx
Data prefix:  /home/anl14042admin/miniconda3/envs/gromacs_A100
Working dir:  /home/anl14042admin
Command line:
  gmx --version
GROMACS version:     2024.2-conda_forge
Precision:           mixed
Memory model:        64 bit
MPI library:         thread_mpi
OpenMP support:      enabled (GMX_OPENMP_MAX_THREADS = 128)
GPU support:         CUDA
NBNxM GPU setup:     super-cluster 2x2x2 / cluster 8
SIMD instructions:   AVX2_256
CPU FFT library:     fftw-3.3.10-sse2-avx
GPU FFT library:     cuFFT
Multi-GPU FFT:       none
RDTSCP usage:        disabled
TNG support:         enabled
Hwloc support:       disabled
Tracing support:     disabled
C compiler:          /home/conda/feedstock_root/build_artifacts/gromacs_1720551881628/_build_env/bin/x86_64-conda-linux-gnu-cc GNU 11.4.0
C compiler flags:    -fexcess-precision=fast -funroll-all-loops -mavx2 -mfma -Wno-missing-field-initializers -O3 -DNDEBUG
C++ compiler:        /home/conda/feedstock_root/build_artifacts/gromacs_1720551881628/_build_env/bin/x86_64-conda-linux-gnu-c++ GNU 11.4.0
C++ compiler flags:  -fexcess-precision=fast -funroll-all-loops -mavx2 -mfma -Wno-missing-field-initializers -Wno-cast-function-type-strict SHELL:-fopenmp -O3 -DNDEBUG
BLAS library:        Internal
LAPACK library:      Internal
CUDA compiler:       /usr/local/cuda/bin/nvcc nvcc: NVIDIA (R) Cuda compiler driver;Copyright (c) 2005-2022 NVIDIA Corporation;Built on Wed_Sep_21_10:33:58_PDT_2022;Cuda compilation tools, release 11.8, V11.8.89;Build cuda_11.8.r11.8/compiler.31833905_0
CUDA compiler flags:-std=c++17;--generate-code=arch=compute_35,code=sm_35;--generate-code=arch=compute_37,code=sm_37;--generate-code=arch=compute_50,code=sm_50;--generate-code=arch=compute_52,code=sm_52;--generate-code=arch=compute_60,code=sm_60;--generate-code=arch=compute_61,code=sm_61;--generate-code=arch=compute_70,code=sm_70;--generate-code=arch=compute_75,code=sm_75;--generate-code=arch=compute_80,code=sm_80;--generate-code=arch=compute_86,code=sm_86;--generate-code=arch=compute_89,code=sm_89;--generate-code=arch=compute_90,code=sm_90;-Wno-deprecated-gpu-targets;--generate-code=arch=compute_53,code=sm_53;--generate-code=arch=compute_80,code=sm_80;-use_fast_math;-Xptxas;-warn-double-usage;-Xptxas;-Werror;;-Xcompiler;-fopenmp;-fexcess-precision=fast -funroll-all-loops -mavx2 -mfma -Wno-missing-field-initializers -Wno-cast-function-type-strict SHELL:-fopenmp -O3 -DNDEBUG
CUDA driver:         12.10
CUDA runtime:        11.80

```

### How to Use GROMACS in Future Sessions

After installing GROMACS in this manner, all you need to do in new sessions is to activate the environment you did the installation in. If you followed along, it would be:

```
conda activate gromacs_env
```

To see your conda packages:

```
conda list
```

```
# packages in environment at /home/jth12345/miniconda3/envs/gromacs_env:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
cudatoolkit               11.8.0              h4ba93d1_13    conda-forge
fftw                      3.3.10          nompi_hf1063bd_110    conda-forge
gromacs                   2024.2          nompi_cuda_h5cb645a_4    conda-forge
icu                       75.1                 he02047a_0    conda-forge
libgcc-ng                 14.1.0               h77fa898_0    conda-forge
libgfortran-ng            14.1.0               h69a702a_0    conda-forge
libgfortran5              14.1.0               hc5f4f2c_0    conda-forge
libgomp                   14.1.0               h77fa898_0    conda-forge
libhwloc                  2.11.1          default_hecaa2ac_1000    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libstdcxx-ng              14.1.0               hc0a3c3a_0    conda-forge
libxml2                   2.12.7               he7c6b58_4    conda-forge
libzlib                   1.3.1                h4ab18f5_1    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
```

 

### Keeping GROMACS Up to Date

To keep GROMACS up to date, use:

```
conda search -c conda-forge gromacs
```

You can also visit [Files :: Anaconda.org](https://anaconda.org/conda-forge/gromacs/files) to see exact files and dates released.


Happy Modeling! 🐍 

~

**Storrs HPC**

[hpc@storrs.uconn.edu](mailto:hpc@storrs.uconn.edu)