Opening Molecular Dynamics to Any Lab with a Browser: Benchmarking Source-Compiled GROMACS on Google Colab

Watching a protein move normally requires a dedicated computing cluster. Cloud notebooks put GPUs within reach of any lab, yet standard software packages leave those accelerators idle. Rebuilding GROMACS for the attached GPU speeds membrane trajectories 26-fold.

Published in Chemistry, Physics, and Mathematics

Opening Molecular Dynamics to Any Lab with a Browser: Benchmarking Source-Compiled GROMACS on Google Colab

Share this post

Choose a social network to share with, or copy the URL to share elsewhere

This is a representation of how your post may appear on social media. The actual post will vary between social networks

Related Content

Springer International Publishing
Springer International Publishing Springer International Publishing

Benchmarking source-compiled GROMACS on Google Colab runtimes for cloud-based molecular dynamics

Molecular dynamics (MD) simulations are widely used in chemistry and biology, but access to high-performance computing (HPC) remains uneven. Google Colab offers browser-based graphics processing unit (GPU), tensor processing unit (TPU) and CPU runtimes, yet the Ubuntu GROMACS package runs only on the CPU. We benchmarked GROMACS 2024.3 compiled from source with CUDA or Message Passing Interface (MPI) support against the packaged GROMACS 2021.4 on the A100, L4, T4, TPU v2 and CPU runtimes, using a 22,741-atom melittin membrane system prepared with CHARMM-GUI and three systems of the Max Planck Institute benchmark set. Throughput, hardware, task placement and wall-time breakdowns were extracted from the GROMACS log files. CUDA builds raised the production throughput of the membrane system from 13.5 to 354.8 ns/day on the A100, from 13.6 to 351.4 ns/day on the L4 and from 9.8 to 155.5 ns/day on the T4 runtime. The A100 and L4 performed alike because their six host CPU cores limited this small system, whereas for a GPU-bound 12.5-million-atom system the A100 was 2.4 times faster. GROMACS cannot use TPUs, so the TPU v2 runtime served as a 96-thread CPU node, on which an MPI build reached 109.7 ns/day. At September 2024 prices, 100 ns of the membrane system cost USD 3.0 to 8.0 on the GPU runtimes, and compiling GROMACS took up to 26 min per session. We describe the build commands, mdrun settings and restart of interrupted simulations from Google Drive, and provide notebooks, input files and analysis scripts.

Static protein structures show where atoms settle at equilibrium, yet drug binding, ion permeation, and allosteric signaling happen while a molecule moves.

Atomistic molecular dynamics follows those motions across tens of thousands to millions of atoms, at a computing cost that has long separated laboratories with local clusters from everyone else.

Cloud notebooks narrowed part of that gap by attaching modern GPUs and cloud storage directly to a browser tab. Having a GPU attached to a session and actually putting force calculations onto it turn out to be different things, because standard Linux software packages are built for broad processor compatibility and leave GPU acceleration turned off.

Running GROMACS on Google Colab makes that trap expensive. Installing the default Ubuntu package with a single command deploys a processor-only build. Launching it on a paid A100 GPU session leaves the accelerator idle while the session still bills at full GPU rates.

Twenty-six times faster from a source build

In our study in Journal of Computer-Aided Molecular Design, we compared that default package against GROMACS compiled from source across Google Colab's GPU, TPU, and CPU runtimes, testing a membrane-embedded peptide alongside standard benchmark systems reaching 12.5 million atoms.

Compiling GROMACS with GPU support inside the notebook took up to 26 minutes and unlocked the attached hardware. Throughput on the membrane system jumped 26-fold to roughly 350 ns/day on the A100 and L4 GPUs and 16-fold to 155 ns/day on the T4, finishing 100 nanoseconds in 6.8 hours on A100 or L4.

When a midrange L4 matches an A100

Reading the wall-time breakdown inside the GROMACS log files explained three results that hardware spec sheets alone would miss. On our membrane system, the midrange L4 matched the flagship A100 at 41% of the cost. Colab pairs both GPUs with just 6 processor cores, so the processor spent most of every step computing bonded forces while the GPU finished early and waited.

Only when we scaled up to 12.5 million atoms did the bottleneck shift onto the GPU, allowing the high-bandwidth A100 to pull 2.4 times ahead of the L4 despite the L4 advertising higher peak single-precision compute.

Two subtler traps surfaced in the same logs. Pairing a single GPU with external MPI software instead of GROMACS's built-in threading cut speed by more than four-fifths because default process binding crowded every thread onto a single core. Meanwhile, GROMACS cannot use Tensor Processing Units at all, yet Colab's TPU runtime comes attached to a 96-thread server processor that reached 110 ns/day as a pure CPU node.

Keeping cloud workflows alive as platforms change

On shared cloud hardware, assigned processors and throughput vary between sessions, cached builds break when Colab attaches an older processor generation, and 24-hour session caps make Colab a practical partner to dedicated clusters rather than a replacement for multi-microsecond campaigns.

Cloud software images shift underneath published scripts too. When Colab recently updated its default CUDA toolkit, the GROMACS version from our benchmark runs stopped linking out of the box. Our maintained notebook in the repository therefore builds a current GROMACS release alongside a fast prebuilt conda option, writing regular checkpoints to Google Drive so interrupted runs resume automatically where they stopped.

Opening biomolecular simulation to any lab with a browser!

When the two of us began running membrane transporter simulations as medical students, browser-based cloud runtimes were what let us test structural ideas without an on-premises cluster. All notebooks, membrane input files, benchmark logs, and restart scripts from this study are openly available on GitHub so any lab or classroom can test its own system before spending compute credits on an idle GPU.

Paper: Journal of Computer-Aided Molecular Design (Springer Nature): https://doi.org/10.1007/s10822-026-00988-y

(free full-text SharedIt access: https://rdcu.be/ptoSzBNEzxha)

Code, Maintained GROMACS v2026.3 Notebook & Benchmark Logs (GitHub): https://github.com/karagol-taner/Molecular-Dynamics-on-AWS-and-Cloud-Computing

Cloud MD & Bioinformatics Software Catalog: https://www.karagolresearch.com/tools

Follow the Topic

Molecular Dynamics
Physical Sciences > Chemistry > Theoretical Chemistry > Molecular Dynamics
Computational Biology
Mathematics and Computing > Mathematics > Applications of Mathematics > Computational Biology
Structure-Based Drug Design
Physical Sciences > Chemistry > Biological Chemistry > Medicinal Chemistry > Structure-Based Drug Design
Biophysics
Physical Sciences > Physics and Astronomy > Biophysics
Cheminformatics
Physical Sciences > Chemistry > Theoretical Chemistry > Cheminformatics