GPU enabled binaries for GROMACS are not available on official website. Since the GPU support is system specific, it requires to build the package for every instance. Since google colab environment is stable and same but requires GPU supported GROMACS to be built on every run, here is temporary solution to get GROMACS v2021 with GPU support.

1. Build GROMACS yourself

You can follow instructions from GROMACS Installation Guide or use the following code piece on google colab notebook:

GROMACS_FILE_NAME="gromacs-2021"
GROMACS_FILE_DIR="/content/drive/MyDrive"
# Install the latest version of cmake
apt-get remove cmake
apt-get autoremove
pip install cmake --upgrade
cmake --version
[ -d $GROMACS_FILE_DIR ] || mkdir -p $GROMACS_FILE_DIR
cd $GROMACS_FILE_DIR
if test -f "$GROMACS_FILE_DIR/$GROMACS_FILE_NAME.tar.gz"; then
  echo "Already Downloaded!"
else
  wget https://ftp.gromacs.org/gromacs/$GROMACS_FILE_NAME.tar.gz
fi
tar xfz $GROMACS_FILE_NAME.tar.gz --directory /content
cd /content/$GROMACS_FILE_NAME/
mkdir build
cd /content/$GROMACS_FILE_NAME/build
pwd
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=off -DGMX_GPU=CUDA
make
make check
sudo make install

The above process might take 60+ minutes to build. However prebuild package is provided here at YOUR OWN RISK.

2. Use prebuilt package with GPU support

  • Step 1: Download the prebuilt deb file and upload it on google drive.
  • Step 2: Install by uploading to google drive and mounting it sudo apt-get install <path-to-deb-file-on-your-google-drive>/gromacs-2021-Linux.deb
  • Step 3: Test using gmx --version

You might be interest in GROMACS XVG graph plotting tool for all the .xvg files at once. GMXvg package is an easy and alternate method for GROMACS XVG Graph Plot.