GROMACS / Installation and build

Installing GROMACS and Building the GPU Version

Most people who install GROMACS get stuck on build errors, then cannot tell whether the GPU is actually doing any work. This page gives one common route: build the CUDA version from source under WSL2 on Windows or directly on Linux, then run a water box to confirm the GPU is used. Build and test errors are collected in the troubleshooting section at the end, so you can look them up by message.

Short answer

GROMACS is molecular dynamics software. To use a GPU, it has to be compiled with CUDA, under Linux or WSL2 on Windows. Set up the driver and CUDA toolkit, configure with CMake, build and install, then run make check. Finally, run a water box with gmx mdrun with GPU options set explicitly, and find the GPU mapping lines in md.log to confirm the GPU did the work.

About this page

How-to guide
What this page solves
You have a Windows or Linux computer with an NVIDIA GPU and want to install GROMACS for molecular dynamics with the GPU doing the work. Following older tutorials word for word gives cmake or nvcc errors, and after installing you cannot tell whether the GPU is used. This page solves this by building the CUDA version from source and showing how to confirm the GPU is active.
Who it is for
Graduate students and researchers who are building scientific software under Linux or WSL2 for the first time and have an NVIDIA GPU. You know what molecular dynamics is, but have not installed the GPU version of GROMACS.
What you will have
After reading, you will have a built GROMACS 2026.4 CUDA version that loads in your shell, a basis for judging make check results, and a few lines in md.log that show the GPU took part in the calculation.
Covers
  • Building the CUDA version of GROMACS 2026 from source on Ubuntu 24.04, including WSL2
  • Driver, CUDA and CMake checks before the build, and how to judge make check results
  • Confirming with a water box that the GPU takes part in the calculation, and reading the related lines in md.log
  • Route choices for users without an NVIDIA GPU, who want a CPU build, or who prefer conda, Docker or native Windows
  • Common build and test errors and how to handle them (see the troubleshooting section)
Does not cover
  • Preparing GROMACS input, choosing force fields and analysing results (see the GROMACS protein-ligand complex simulation guide)
  • Building for AMD GPUs with HIP or SYCL
  • Submitting and scheduling jobs on a cluster
  • Building on macOS

Main steps

Step 1

Why this stepThe GPU build is compiled with CUDA. The CUDA toolkit is NVIDIA's development kit, and its nvcc is the compiler for CUDA code; the NVIDIA driver lets programs access the GPU. Both must be installed before cmake can find the components it needs.

WSL2 is the Linux subsystem built into Windows. Windows users build inside Ubuntu 24.04 in WSL2. Native Linux users skip steps 1 and 2; the rest is the same.

If nvidia-smi cannot find the GPU, or the GPU is unavailable after installing CUDA, see the troubleshooting entry "No GPU is detected at run time".

Known WSL2 limits: nvidia-smi provides only part of its usual functions; on machines with several GPUs you cannot select cards by index; and CPU and GPU cannot access the same memory concurrently. These limits do not affect running GROMACS on a single GPU.

Windows sidepowershell
# Windows PowerShell (administrator)
wsl --install -d Ubuntu-24.04
wsl --update

# Optional: %UserProfile%\.wslconfig; run wsl --shutdown after editing, then reopen WSL
# [wsl2]
# memory=16GB
# processors=8
Installing the CUDA toolkit inside WSLbash
# Run inside Ubuntu on WSL; first confirm the Windows driver is passed through
nvidia-smi

wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
# Install only the toolkit metapackage; cuda, cuda-12-9 and cuda-drivers pull in a Linux driver
sudo apt-get install -y cuda-toolkit-12-9

echo 'export PATH=/usr/local/cuda-12.9/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
nvcc --version

# Keep sources and build directories on the Linux file system, not under /mnt/c
mkdir -p ~/src && cd ~/src
  1. 01

    Install or update the NVIDIA driver on Windows

    This is the only display driver you should install. Do not install a Linux display driver inside WSL. The Windows driver is mapped into WSL2 as libcuda.so, and nvidia-smi is in /usr/lib/wsl/lib. The CUDA Version shown in the top-right of nvidia-smi inside WSL should be at least the toolkit version you plan to install.

  2. 02

    Install WSL2 and Ubuntu 24.04

    CUDA supports WSL 2 only, not WSL 1. The apt packages in Ubuntu 24.04 include CMake 3.28.3 and GCC 13.2, which meet the requirements of GROMACS 2026, so no upgrade is needed.

  3. 03

    Install only the cuda-toolkit-12-9 meta-package

    Add NVIDIA's wsl-ubuntu repository inside WSL and install only the toolkit meta-package. CUDA 12.9 can compile for GPUs with compute capability 5.0 to 12.0, including the RTX 50 series and the GTX 10 series.

  4. 04

    Keep the source in the Linux file system

    Put the source under ~/src and do all builds inside the Linux file system. Microsoft recommends keeping files under /home when you work from the Linux command line.

Step 2

Why this stepCMake is the build tool GROMACS uses. In the configure step (cmake ..), it checks the compiler, CUDA and FFTW and generates the build rules, so most configure errors come from versions and paths. FFTW is a fast Fourier transform library. This page uses -DGMX_BUILD_OWN_FFTW=ON so GROMACS downloads and builds its own copy, which saves a separate library install.

CMAKE_CUDA_ARCHITECTURES takes the GPU compute capability without the decimal point. For example, RTX 40 series is 89 and RTX 30 series is 86; the code comments list common GPUs. If you are unsure, leave this option out. CMake then builds for all architectures that nvcc supports, which takes longer and gives a larger binary.

The export line before cmake sets the CUDA path, and it must match the CUDA version you installed earlier. For configure errors, see the troubleshooting entries for the configure step.

Configure the CUDA buildbash
# Prerequisites: nvcc works (nvcc --version) and nvidia-smi lists the GPU
export PATH=/usr/local/cuda-12.9/bin:$PATH

cd gromacs-2026.4
mkdir build-cuda && cd build-cuda

# CMAKE_CUDA_ARCHITECTURES is the compute capability without the dot:
# RTX 20/T4=75, A100=80, RTX 30/A40=86, RTX 40/L40=89, H100=90, RTX 50=120
# If omitted, every architecture from 50 to 120 that nvcc accepts is built: slower build, larger binary
cmake .. \
  -DGMX_GPU=CUDA \
  -DCUDAToolkit_ROOT=/usr/local/cuda-12.9 \
  -DCMAKE_CUDA_ARCHITECTURES=89 \
  -DGMX_BUILD_OWN_FFTW=ON \
  -DREGRESSIONTEST_DOWNLOAD=ON \
  -DCMAKE_INSTALL_PREFIX=$HOME/opt/gromacs-2026.4-cuda
  1. 01

    Check the version requirements

    GROMACS 2026 requires CMake 3.28 or newer, GCC 11 or newer, and CUDA 12.1 or newer. The Ubuntu 24.04 packages already meet these. Ubuntu 22.04 ships CMake 3.22 through apt, so upgrade it with pip install cmake.

  2. 02

    Download and unpack the source

    Download gromacs-2026.4.tar.gz and unpack it. Create a build-cuda directory inside the source directory. All configuration and building happens there.

  3. 03

    Run cmake

    Set the GPU backend to CUDA, and set the CUDA path, the GPU architecture and the install location. CMake downloads FFTW and the regression test suite automatically.

Step 3

Why this stepBuilding turns the source into the gmx executable, and installing copies it to CMAKE_INSTALL_PREFIX. Loading the environment makes gmx available in your shell. Building takes the longest. The number after make -j is the number of parallel jobs; here nproc uses all CPU cores.

Build, install and load the environmentbash
make -j $(nproc)
make install
source $HOME/opt/gromacs-2026.4-cuda/bin/GMXRC
gmx --version | grep -E "GPU support|CUDA targets|CUDA driver|CUDA runtime|SIMD"
  1. 01

    Build

    Run make -j $(nproc). The time depends on the number of CPU cores and the memory of the machine. If the build is killed partway through, see the troubleshooting entry on memory.

  2. 02

    Install

    Run make install. The programs and libraries are copied into the install directory.

  3. 03

    Load the environment

    Run source on GMXRC. After that, the gmx command is available in the current shell.

Step 4

Why this stepmake check runs the tests bundled with GROMACS. It compares the program's results on a set of standard systems with reference values, which shows whether the build calculates correctly.

The official installation guide says that a single failing test may be a compiler problem, or the tolerance may be slightly tight. Read the names of the failed tests and the output files the script points to, then decide what to do.

Run make check and show failuresbash
make check 2>&1 | tee check.log

# Show only the failed tests
grep -A40 "tests FAILED" check.log
  1. 01

    Run and save the output

    In the build-cuda directory, run make check and save the output to check.log. The tests take a while.

  2. 02

    Read the failures

    Use grep to show only the failed tests, and note their names.

  3. 03

    Sort the failures by type

    Only a timeout where CPU mode passes lets you use the water-box check to confirm the GPU works. A numerical comparison failure must not be ignored. The handling for each type is in the troubleshooting section.

Step 5

Why this stepA CUDA build does not guarantee that the GPU is doing the work. The mdrun option -nb sets where short-range non-bonded interactions are computed, -pme sets where the long-range electrostatics (PME) are computed, and -update sets where coordinates are updated. Each takes cpu or gpu. The default, auto, falls back to the CPU when no GPU is found, without an error. This step sets gpu explicitly and uses a small system to check from the log.

The water box is a pure-water system of about 12,000 atoms. It is only for this self-check and does not represent a production simulation.

Water box GPU self-test (about 12,000 atoms, 50 ps)bash
mkdir -p ~/gmx-gpu-test && cd ~/gmx-gpu-test

# 5 nm cubic water box, about 4000 SPC/E waters
gmx solvate -cs spc216.gro -box 5 5 5 -o water.gro
cat > topol.top <<'EOF'
#include "oplsaa.ff/forcefield.itp"
#include "oplsaa.ff/spce.itp"

[ system ]
SPC/E water box

[ molecules ]
EOF
echo "SOL $(grep -c OW water.gro)" >> topol.top

cat > em.mdp <<'EOF'
integrator    = steep
emtol         = 1000
nsteps        = 5000
cutoff-scheme = Verlet
coulombtype   = PME
rcoulomb      = 1.0
rvdw          = 1.0
EOF

cat > md.mdp <<'EOF'
integrator     = md
dt             = 0.002
nsteps         = 25000
cutoff-scheme  = Verlet
coulombtype    = PME
rcoulomb       = 1.0
rvdw           = 1.0
tcoupl         = V-rescale
tc-grps        = System
tau-t          = 0.1
ref-t          = 300
gen-vel        = yes
gen-temp       = 300
constraints    = h-bonds
nstcalcenergy  = 100
nstenergy      = 1000
nstlog         = 5000
EOF

gmx grompp -f em.mdp -c water.gro -p topol.top -o em.tpr
gmx mdrun -s em.tpr -c em.gro -g em.log
gmx grompp -f md.mdp -c em.gro -p topol.top -o md.tpr

# Request gpu explicitly: if no GPU is usable, mdrun stops with an error instead of silently falling back to the CPU
gmx mdrun -s md.tpr -g md.log -nb gpu -pme gpu -update gpu -ntmpi 1

grep -A2 "Mapping of GPU IDs" md.log
grep -E "PP task|PME tasks" md.log
grep "Performance:" md.log
Lines expected in md.log (single-GPU example)text
  GPU info:
    Number of GPUs detected: 1
    #0: NVIDIA NVIDIA GeForce RTX 4090, compute cap.: 8.9, ECC:  no, stat: compatible

1 GPU selected for this run.
Mapping of GPU IDs to the 2 GPU tasks in the 1 rank on this node:
  PP:0,PME:0
PP tasks will do non-perturbed short-ranged interactions on the GPU
PP task will update and constrain coordinates on the GPU
PME tasks will do all aspects on the GPU
  1. 01

    Check the build information

    In gmx --version, GPU support should read CUDA, CUDA targets should include your GPU architecture, and the CUDA driver version should be at least the CUDA runtime version. A build with PLUMED support shows its status on the Plumed support line.

  2. 02

    Generate the water box and run it

    Use gmx solvate to build the water box, write the parameter files for energy minimisation and MD, and then run with -nb gpu -pme gpu -update gpu set explicitly. If no GPU is available, the program exits with an error.

  3. 03

    Read md.log

    Use grep to find the GPU mapping lines, the task assignment lines and the performance line, and compare them with the reference log below.

  • stat: compatible: the GPU was recognized and its architecture is compiled in. "not in set of targeted devices" means you need to rebuild for that architecture.
  • The Mapping of GPU IDs line lists both PP and PME: both task types run on the GPU. With PP only, PME is computed on the CPU.
  • PP task will update and constrain coordinates on the GPU: GPU-resident mode is active. CPU here means the system or settings do not qualify, for example virtual sites, mass or constraint free-energy perturbation, replica exchange, or constraints = all-bonds under domain decomposition.
  • A NOTE containing "does not include kernels compiled natively": GPU kernels are JIT-compiled from PTX and may run slower; rebuild with the architecture value given in the log.
  • ns/day on the Performance line: compare with a run using -nb cpu -pme cpu -update cpu; on the same system the GPU run should be much faster, and similar numbers mean the GPU did not take part.

Choose by your situation

Routes

The main route suits Windows personal computers with an NVIDIA GPU (through WSL2) and Linux workstations. The table below lists the versions, GPU support and limits of other routes; version data was checked on 2026-10-10. For GPU acceleration, only the first two routes provide the current version with a CUDA version you choose.

RouteAvailable versionNVIDIA GPUWhen it fitsMain limitations
WSL2 + source buildAny version, currently 2026.4Yes (CUDA)Windows 10/11 PC with an NVIDIA GPUnvidia-smi is limited under WSL2; devices cannot be filtered by index on multi-GPU systems; sources must live on the Linux file system
Linux source buildAny version, currently 2026.4Yes (CUDA/SYCL/HIP)Workstations, servers, clustersNeeds CMake ≥ 3.28 and GCC ≥ 11; CentOS 7 (GCC 4.8.5) and Rocky/RHEL 8 (GCC 8.5) need a newer compiler first
conda-forge2026.3 (2026.4 is out upstream)CUDA builds on linux-64 onlyNo root access, want something running quicklyNo Windows builds; the CUDA build depends on cuda-toolkit 12.9, so the driver must support 12.9; x86 SIMD tops out at AVX2_256; regression tests are not run during packaging
Ubuntu apt2023.3 on 24.04, 2021.4 on 22.04NoTeaching or small CPU-only systemsTwo to three years behind; no CUDA runtime among the dependencies
NVIDIA NGC containerLatest tag 2023.2 (updated 2023-08)YesGPU servers that already run Docker/SingularityNo longer updated; GMX_ENABLE_DIRECT_GPU_COMM in the example command is a 2022/2023 setting
Native Windows (MSVC)Build it yourselfYes (CUDA, tested upstream)Must run natively on WindowsNo official Windows binaries; GMX_BUILD_OWN_FFTW does not work, so use MKL, fftpack or your own FFTW build; no PLUMED; CMake < 4.3 fails to detect OpenMP_CUDA for CUDA builds
Sources: GROMACS 2026.4 installation guide and Known issues; conda-forge gromacs-feedstock recipe; packages.ubuntu.com; NGC GROMACS container page; NVIDIA CUDA on WSL User Guide.

conda

The conda route avoids compiling, but it has the four limits listed below. Read the cards before installing.

conda-forge CUDA buildbash
# linux-64 only (including WSL2). The CUDA build needs a driver that supports CUDA 12.9
conda create -n gmx -c conda-forge "gromacs=2026.3=nompi_cuda*"
conda activate gmx
gmx --version | grep -E "GPU support|SIMD"

# CPU/OpenCL build
# conda create -n gmx-cpu -c conda-forge "gromacs=2026.3=nompi_h*"
Networks in China: TUNA mirrors for conda-forge and pipbash
# ~/.condarc (conda-forge setup from the TUNA help page; run conda clean -i afterwards)
# channels:
#   - conda-forge
#   - nodefaults
# show_channel_urls: true
# custom_channels:
#   conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
conda clean -i
conda create -n gmx -c conda-forge "gromacs=2026.3=nompi_cuda*"

# With mamba, use mirrored_channels instead
# channels:
#   - conda-forge
# mirrored_channels:
#   conda-forge:
#     - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

# For source builds, upgrade CMake with pip (3.28 or newer is required)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple "cmake>=3.28"

One patch release behind upstream

On the check date conda-forge had 2026.3 while upstream had 2026.4. The bioconda gromacs package stopped at 2021.3, so do not install from bioconda.

CUDA builds exist for linux-64 only

aarch64, ppc64le and macOS have no CUDA builds, and there are no Windows builds at all. The CUDA build installs cuda-toolkit 12.9 into the environment and checks the driver through the __cuda virtual package.

SIMD tops out at AVX2_256

On x86 the recipe builds only SSE2, AVX_256 and AVX2_256 variants and picks one at start-up based on the CPU. On CPUs with AVX-512, CPU-only runs may be slower than a self-compiled build.

Regression tests are not run during packaging

REGRESSIONTEST_DOWNLOAD is commented out in the recipe, and the package test only runs gmx -version. If you need trustworthy results, download regressiontests-2026.3 yourself and run gmxtest.pl.

CPU

GMX_BUILD_OWN_FFTW=ON downloads FFTW 3.3.10 and builds it in single precision with the SIMD options GROMACS recommends. The GROMACS team advises against distribution FFTW packages because they default to double precision and are not compiled with options tuned for GROMACS.

Check two lines in the cmake output: whether the SIMD instruction set matches the CPU (for example AVX2_256 or AVX_512), and, for CUDA builds, "Compiling GROMACS for CUDA architectures: …". When you compile on a login node and run on compute nodes, set -DGMX_SIMD for the compute nodes; a binary built for AVX-512 exits with an illegal instruction on a machine that only supports AVX2. For GPU runs the GROMACS team recommends AVX2_256.

CPU build (single precision, thread-MPI)bash
# Ubuntu 24.04 (including Ubuntu 24.04 under WSL2); on 22.04 apt ships cmake 3.22, upgrade first with pip install cmake
sudo apt update
sudo apt install -y build-essential cmake wget perl

wget https://ftp.gromacs.org/gromacs/gromacs-2026.4.tar.gz
tar xfz gromacs-2026.4.tar.gz
cd gromacs-2026.4
mkdir build && cd build

cmake .. \
  -DGMX_BUILD_OWN_FFTW=ON \
  -DREGRESSIONTEST_DOWNLOAD=ON \
  -DCMAKE_INSTALL_PREFIX=$HOME/opt/gromacs-2026.4

make -j $(nproc)
make check
make install
echo 'source $HOME/opt/gromacs-2026.4/bin/GMXRC' >> ~/.bashrc
source $HOME/opt/gromacs-2026.4/bin/GMXRC
gmx --version

Run options

When running several simulations on one GPU without -update gpu and without MPS or MIG, NVIDIA's tests showed no throughput gain. One A100 ran the 24,000-atom RNAse system at 1,083 ns/day and the 96,000-atom ADH system at 378 ns/day (GROMACS 2021.2), which can serve as a reference when estimating the speed of a comparable GPU.

ScenarioRecommended commandBasis
One GPU, one simulationgmx mdrun -s md.tpr -nb gpu -pme gpu -update gpu -ntmpi 1 -ntomp <physical cores>With a GPU the default is already one rank per GPU; writing it out makes failures visible
Strong CPU, weaker GPUgmx mdrun -s md.tpr -ntmpi 4 -nb gpu -pme cpuOfficial example: long-range PME stays on the CPU and bonded work is assigned to the GPU automatically
Several GPUs in one nodegmx mdrun -s md.tpr -ntmpi 4 -nb gpu -pme gpu -npme 1 -update gpuWith PME on a GPU, -npme must be 1; use 1–3 ranks per GPU, and 1 rank per GPU is best with GPU-resident mode and direct GPU communication
Several small systems on one GPUEach simulation with -update gpu, CUDA MPS enabled, and CPU cores separated with -pin on -pinoffsetNVIDIA measured on an A100 a 1.8× total throughput gain for a 24,000-atom system and 1.3× for 96,000 atoms; without -update gpu performance was about half
Node shared with other usersgmx mdrun -s md.tpr -gpu_id 1 -pin on -pinoffset 0 -nt 8-gpu_id restricts which GPUs are used; -pin keeps threads from competing for cores
Sources: GROMACS user guide, Getting good performance from mdrun; NVIDIA technical blog, Maximizing GROMACS Throughput with Multiple Simulations per GPU Using MPS and MIG (GROMACS 2021.2, DGX A100).

PLUMED

Since 2025 the GROMACS source includes the PLUMED 2.10 interface, which the GROMACS documentation describes as compatible with any PLUMED version. It is enabled by default on non-Windows systems (GMX_USE_PLUMED=AUTO); building only requires dlopen from the system, and PLUMED need not be installed beforehand. At run time point the PLUMED_KERNEL environment variable to the kernel library and add -plumed plumed.dat.

The native interface does not support the ENERGY collective variable, replica exchange or lambda dynamics; PLUMED exits with an error when more than 1 thread-MPI rank is used, so add -ntmpi 1 on a single node and build an MPI version for multiple ranks. In 2026.0–2026.3, MPI-parallel mdrun -plumed aborts at start-up; 2026.4 fixes this.

ENERGY, multiple walkers or OPES multithermal still require the patch. Patches are provided for specific GROMACS versions: PLUMED 2.10.1 (released July 2026) ships patches for gromacs-2022.5, 2023.5, 2024.3 and 2025.0; a gromacs-2026.0 patch currently exists only in PLUMED's development branches. To patch, run plumed patch -p in the GROMACS source root before running cmake; the PLUMED documentation recommends also setting -DGMX_THREAD_MPI=OFF -DGMX_MPI=ON.

The GROMACS documentation names the kernel library libPlumedKernel.so, while PLUMED installs it as libplumedKernel.so by default. Linux file names are case-sensitive, so copying the documentation path verbatim fails to find the file.

Using the native interfacebash
# 1. Build PLUMED (no ordering requirement relative to GROMACS)
wget https://github.com/plumed/plumed2/releases/download/v2.10.1/plumed-2.10.1.tgz
tar xzf plumed-2.10.1.tgz && cd plumed-2.10.1
./configure --prefix=$HOME/opt/plumed-2.10.1
make -j $(nproc) && make install

# 2. Force the interface on when building GROMACS 2025/2026 (AUTO only prints a STATUS message and disables the interface when dlopen is missing; ON stops with an error)
cmake .. -DGMX_GPU=CUDA -DGMX_USE_PLUMED=ON -DGMX_BUILD_OWN_FFTW=ON
gmx --version | grep -i plumed

# 3. Point to the kernel library at run time. The real file name is libplumedKernel.so (lowercase p)
export PLUMED_KERNEL=$HOME/opt/plumed-2.10.1/lib/libplumedKernel.so
gmx mdrun -s md.tpr -plumed plumed.dat -ntmpi 1

Agent

Example instruction: "Prepare a GROMACS 2026 GPU environment on one GPU, run a 5 nm water box for 50 ps each with -update gpu and -update cpu, report the ns/day of both, and include the GPU mapping lines from md.log and the gmx --version output."

In an isolated cloud computer, the agent uses the preinstalled GROMACS 2026.3 GPU build, or compiles another version with the commands on this page when needed; rents a GPU for the task; generates topol.top, em.mdp, md.mdp and the tpr files; runs both simulations; extracts ns/day and the GPU mapping lines from the logs; and finally reviews the results adversarially to check that the GPU really took part. The project keeps scripts, parameter files, logs and results, and the task keeps running after you shut down your own computer.

You still need to check: that the GROMACS version stated in your paper's methods matches the version actually used; that md.log shows update and PME running where you expect; and the force field, water model and mdp settings of your production system, which are your decisions. A water box self-test does not replace equilibration checks on the production system.

Concepts and judgment

Principle

The defaults for -nb, -pme and -update in mdrun are all auto. auto uses the GPU when one is detected and switches to the CPU when none is found. The program gives no error and only runs slower. This is why the self-check sets gpu explicitly.

Updating coordinates on the GPU (PP task will update and constrain coordinates on the GPU) requires certain conditions. Free-energy perturbation with virtual sites, masses or constraints, replica exchange, or constraints = all-bonds with domain decomposition all return this step to the CPU.

In GPU-resident mode (-update gpu), the GROMACS team recommends setting nstcalcenergy and the temperature and pressure coupling intervals to at least 50–100 steps, because the overhead of frequent virial and energy computation does not show up in the cycle counters of the log. Use constraints = h-bonds as well: it is one of the prerequisites for GPU-resident mode and matches how most force fields were parametrized.

Reference and appendix

Version differences

Most tutorials online use versions 2018–2021. The table lists requirements and syntax that have changed in 2026.x.

ItemGROMACS 2026.xOld tutorial syntaxWhat happens if you copy it
CMake≥ 3.28 (since 2025)cmake3, 3.13–3.17Configuration fails immediately; apt on Ubuntu 22.04 gives 3.22.1 (too old), 24.04 gives 3.28.3 (enough)
C++ compilerGCC ≥ 11, Clang ≥ 14, MSVC 2019; the classic Intel compiler icc is no longer supportedGCC 5–7The system GCC on CentOS 7 and Rocky 8 cannot build it
Enable CUDA-DGMX_GPU=CUDA-DGMX_GPU=ONError: Invalid value for GMX_GPU: ON. Pick one of: OFF, CUDA, OpenCL, SYCL, HIP
CUDA path-DCUDAToolkit_ROOT=/usr/local/cuda-12.9-DCUDA_TOOLKIT_ROOT_DIR=…The GROMACS 2026 CMake scripts no longer read this variable; configuration only ends with Manually-specified variables were not used by the project: CUDA_TOOLKIT_ROOT_DIR (tested on this page with CMake 4.4). With several CUDA versions installed another nvcc may be found, so check the actual version in the cmake output
GPU architecture-DCMAKE_CUDA_ARCHITECTURES=89-DGMX_CUDA_TARGET_SM=…Still accepted with a deprecation warning; 2026 switched to the standard CMake variable
CUDA version≥ 12.1, compute capability ≥ 5.0CUDA 9–11CUDA 11.x fails at configuration
CUDA 13Supported since 2025.3; CUDA 13 cannot build for GPUs below compute capability 7.5Not mentionedGTX 10 series, P100 and V100 cannot use the GPU after a CUDA 13 build; 2025.0–2025.2 with CUDA 13 fails at link time
AMD GPUsHIP backend with full offload since 2026, or SYCL + AdaptiveCppOpenCLOpenCL is deprecated and does not support RDNA AMD GPUs or NVIDIA GPUs from Volta onwards
GPU update and constraints-update auto runs on the GPU by default (since 2023)Add -update gpu by hand or set GMX_FORCE_UPDATE_DEFAULT_GPUThe old variables GMX_GPU_DD_COMMS and GMX_GPU_PME_PP_COMMS have been removed and have no effect
MPIMPI 3.0 required (since 2026)MPI 2.xSingle-node runs only need the built-in thread-MPI; no MPI build is required
PLUMEDInterface bundled since 2025, loaded at run timeAlways plumed patch firstRoutine use no longer needs a patch; see the PLUMED section
Sources: GROMACS 2026.4 installation guide; 2025 and 2026 release notes (Portability, Miscellaneous); 2026.4 source CMakeLists.txt and cmake/gmxManageCuda.cmake; NVIDIA CUDA Features Archive.

Offline

When the server has no internet accessbash
# If the server cannot reach fftw.org or ftp.gromacs.org, download these two files elsewhere and copy them over
#   http://www.fftw.org/fftw-3.3.10.tar.gz
#   https://ftp.gromacs.org/regressiontests/regressiontests-2026.4.tar.gz
tar xfz regressiontests-2026.4.tar.gz -C $HOME/src

cmake .. \
  -DGMX_GPU=CUDA \
  -DGMX_BUILD_OWN_FFTW=ON \
  -DGMX_BUILD_OWN_FFTW_URL=$HOME/src/fftw-3.3.10.tar.gz \
  -DREGRESSIONTEST_PATH=$HOME/src/regressiontests-2026.4 \
  -DCMAKE_INSTALL_PREFIX=$HOME/opt/gromacs-2026.4-cuda

Experience

The following comes from Sobereva's blog (Computational Chemistry Commune) and the GROMACS forum; most points can be checked against first-hand documentation.

Do not build an MPI version for single-node runs

Common practice: on a single machine the default thread-MPI plus OpenMP needs one fewer installation step than an MPI build and is also more efficient; build with -DGMX_MPI=ON, which produces gmx_mpi, only for multi-node runs. The official installation guide likewise says multi-core runs on one workstation need no MPI setup.

Install a separate double-precision build

Common practice: energy minimization and Hessian diagonalization for normal mode analysis need double precision, so build a second copy with -DGMX_DOUBLE=ON. The program is named gmx_d and can sit in the same directory as the single-precision build. The double-precision build has no GPU support, runs at about half the speed, and writes trajectory and energy files twice as large.

Same RTX 4090, 2× speed difference between hosts

GROMACS forum measurements (version 2023, -nb gpu -bonded gpu -update gpu -ntomp 12): a ~30,000-atom system ran at about 900 and 1500 ns/day on two RTX 4090 hosts, and a ~100,000-atom system at 170 and 360 ns/day. A developer advised comparing with identical inputs and commands (for example -nsteps 100000 -ntmpi 1 -pin on -nb gpu -pme gpu -update gpu -bonded gpu) and then inspecting GPU kernel times with Nsight Systems. Treat these numbers as a rough range for that GPU generation when estimating your own machine's speed.

Sobereva's prebuilt native Windows binaries stop at 2020.6

Sobereva provides Windows 64-bit builds he compiled himself at sobereva.com/458: 2018.8 CPU, 2019.6 and 2020.3 CUDA (AVX), and 2020.6 CUDA (AVX2, NVIDIA driver ≥ 471.11). To use them, unzip and add the bin directory to Path; on machines without Visual Studio 2019, install VC_redist.x64 first; the CUDA builds need no CUDA toolkit, only a recent enough driver. They are command-line programs, and double-clicking gmx.exe just closes the window. These versions lack gmx dssp (2023+), the new gmx hbond (2024+) and the bundled amber19sb.ff (2026+), so they suit preparing input files and practice on Windows; for production runs with the current version, build under WSL2 as described above.

Which widely cited Chinese install guides are outdated

Jerkwin's "GROMACS program compilation" page is marked "outdated and no longer updated" at the top; its example is 2016.4 and uses -DGMX_GPU=on, -DFFTWF_INCLUDE_DIR and similar options. His Chinese GROMACS manual still contains chapters on implicit solvent (removed in 2019) and the group cutoff scheme (removed in 2020). Sobereva's "How to install GROMACS" was last updated in May 2026 and its gcc and cmake requirements are current, so it is a usable reference; its CUDA part still uses -DCUDA_TOOLKIT_ROOT_DIR, which GROMACS 2026 no longer reads, so use -DCUDAToolkit_ROOT instead (see the version table above). The same article notes that a new gcc can also fail on an old GROMACS: gcc 11.2.1 on Rocky Linux 9 cannot build 2018.8.

Measured

Tested on this page (CPU reference, not GPU speed): the script above with the conda-forge GROMACS 2026.3 CPU build on an Apple M2 (8 cores, other jobs running on the machine at the same time). gmx solvate produced 4,055 water molecules and 12,165 atoms; energy minimization reached Fmax < 1000 in 12 steps; mdrun with -nb gpu stopped with Nonbonded interactions on the GPU were requested with -nb gpu, but the GROMACS binary has been built without GPU support.; with -nb cpu -pme cpu -update cpu -ntmpi 1 the 50 ps run reached 14.4 ns/day under heavy load and 27.8 ns/day at lower load (1-minute load average about 13, -nsteps 10000 -resethway), and md.log showed Using SIMD4xM 4x4 nonbonded short-range kernels with no Mapping of GPU IDs or PP task lines. A GPU build should be much faster on the same system; similar numbers mean the GPU is not doing the work.

Troubleshooting by error message or symptom

Entries follow the steps: configure errors first, then build, make check, and finally run-time problems. Each entry is titled with the exact message or symptom, and the cause and fix are kept together.

Invalid value for GMX_GPU: ON. Pick one of: OFF, CUDA, OpenCL, SYCL, HIP

Cause: This is the syntax from before 2021. GROMACS 2026 expects the backend name.

Fix: Use -DGMX_GPU=CUDA.

CMake 3.28 or higher is required

Cause: The system CMake is too old. The Ubuntu 22.04 apt package is 3.22.1, and CentOS 7 is older.

Fix: Install a newer CMake with pip install cmake, or use the official binary package from Kitware.

Could not find `nvcc` executable in path specified by variable CUDAToolkit_ROOT=/usr/local/cuda-12.9

Cause: There is no bin/nvcc under the directory CUDAToolkit_ROOT points to, so this CUDA version is not installed at that path. This message was reproduced on this page on a machine without CUDA.

Fix: Run ls /usr/local/ to find the CUDA directory that is actually installed, then correct CUDAToolkit_ROOT.

Manually-specified variables were not used by the project: CUDA_TOOLKIT_ROOT_DIR

Cause: The GROMACS 2026 CMake scripts no longer read CUDA_TOOLKIT_ROOT_DIR, so this older syntax has no effect.

Fix: Use -DCUDAToolkit_ROOT=… instead. If several CUDA versions are installed, check which nvcc version cmake reports.

#error -- unsupported GNU version! gcc versions later than … are not supported!

Cause: The system GCC is newer than the host compiler supported by the installed CUDA. nvcc uses CMAKE_CXX_COMPILER as the host compiler by default.

Fix: Install an older GCC that CUDA supports and pass it to cmake, or upgrade CUDA. Do not edit CUDA's host_config.h to get around this.

# Install gcc-12 and g++-12 first
cmake .. -DGMX_GPU=CUDA -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12
nvcc fatal : Unsupported gpu architecture 'compute_xx'

Cause: CMAKE_CUDA_ARCHITECTURES, or the older GMX_CUDA_TARGET_SM, contains an architecture the installed CUDA does not support, for example 61 in CUDA 13.

Fix: Use the actual compute capability of your GPU. For GPUs with compute capability below 7.5, build with CUDA 12.x.

Unknown CUDA architecture: native / ptxas error : Value of threads per SM … is out of range

Cause: The CMake version is too old, or an old source tree is being used.

Fix: Update the source, delete the build directory and configure again, and set the architecture explicitly, for example -DCMAKE_CUDA_ARCHITECTURES=86-real.

Cannot find FFTW 3 (with correct precision - libfftw3f for mixed-precision GROMACS …)

Cause: Only the double-precision FFTW is installed, or CMAKE_PREFIX_PATH does not point to FFTW.

Fix: Use -DGMX_BUILD_OWN_FFTW=ON so GROMACS builds FFTW itself. For an offline build, add -DGMX_BUILD_OWN_FFTW_URL=<absolute path>.

cmake hangs for a long time while downloading FFTW

Cause: Access to fftw.org often stalls from mainland China.

Fix: Download fftw-3.3.10.tar.gz with a browser first, then pass it with -DGMX_BUILD_OWN_FFTW_URL=<absolute path>. CMake checks the MD5 automatically.

Cannot build FFTW3 automatically (GMX_BUILD_OWN_FFTW=ON) in Visual Studio / with ninja

Cause: Automatic FFTW builds are not supported in a native Windows build or with the Ninja generator.

Fix: Use -DGMX_FFT_LIBRARY=mkl, or build FFTW yourself first.

In a native Windows CUDA build, CMake cannot detect OpenMP_CUDA

Cause: The CMake version is below 4.3.

Fix: Add -G Ninja, or set the OpenMP_CUDA parameters by hand.

WARNING: The gmx binary does not include support for the CUDA architecture of the GPU ID #0; in md.log the GPU line reads "not in set of targeted devices"

Cause: The CMAKE_CUDA_ARCHITECTURES used at build time does not include the architecture of this GPU.

Fix: Rebuild with the value suggested in the log, for example -DCMAKE_CUDA_ARCHITECTURES=89.

Cannot run short-ranged nonbonded interactions on a GPU because no GPU is detected.

Cause: The binary has GPU support, but no usable GPU is found at run time. Common causes are an unavailable driver, or a Linux driver installed inside WSL. The cuda, cuda-12-x and cuda-drivers meta-packages install a Linux driver, which overrides the libcuda mapping in WSL.

Fix: First run nvidia-smi in WSL or Linux to check. In WSL, remove cuda-drivers-type packages and keep only cuda-toolkit-12-9.

Nonbonded interactions on the GPU were requested with -nb gpu, but the GROMACS binary has been built without GPU support.

Cause: The binary has no GPU support. The GPU support line in gmx --version reads disabled (reproduced on this page with the conda-forge 2026.3 CPU build).

Fix: Install the CUDA build, or rebuild following the CUDA steps in the main route.

md.log contains a NOTE that includes "does not include kernels compiled natively"

Cause: The GPU kernels were not compiled natively for your GPU. They are compiled to PTX and then JIT-compiled at run time, so performance may drop.

Fix: Rebuild with the architecture value suggested in the log.

md.log shows "Using plain-C-4x4 4x4 nonbonded short-range kernels", or the start-up output shows "Compiled SIMD is None, but AVX2_256 might be faster (see log)."

Cause: The program is not using SIMD instructions, so it can be several times slower. "Using the slow plain C kernels" in older tutorials is output from an older version.

Fix: Add -DGMX_SIMD=AVX2_256 when you run cmake again, or give the highest instruction set your CPU supports. If an old gcc does not support AVX-512 and fails, fall back to AVX2_256.

The program exits at start-up because of an illegal instruction

Cause: A program built with AVX-512 runs on a machine that supports only AVX2, for example when it was built on a login node and runs on a compute node.

Fix: Rebuild for the CPU instruction set of the compute node. For GPU runs, the official recommendation is AVX2_256 first.

make is killed partway through with "Killed signal terminated program cc1plus"

Cause: The build ran out of memory. WSL2 gives only 50% of the Windows memory by default, and small virtual machines hit this too.

Fix: Reduce the number after make -j, or add memory. In WSL2, you can raise memory in %UserProfile%\.wslconfig, then run wsl --shutdown to restart.

The build is very slow and prints "Clock skew detected"

Cause: The source or build directory is under /mnt/c, which is the Windows file system.

Fix: Move the source and build directories under ~, which is inside the Linux file system.

make -j hangs or fails inside a virtual machine

Cause: Parallel builds in virtual machines such as VMware sometimes stall.

Fix: Remove -j, or run make -j 4 and build again.

Many GPU tests in make check report Timeout

Cause: By default the tests use all detected cores and GPUs. If another task occupies the CPU or GPU, the tests time out. In one 2021.1 case, 23 tests timed out with GPU detection on, and only 1 timed out after setting GMX_DISABLE_GPU_DETECTION=1.

Fix: Try these in turn: rule out the GPU; on a multi-GPU machine let the tests see one card only; on a slow machine or in WSL, raise the timeout factor. Only when the failures are timeouts and CPU mode passes should you use the water-box check to confirm the GPU works.

# Show only the failed tests
make check 2>&1 | tee check.log
grep -A40 "tests FAILED" check.log

# 1. Rule out the GPU: if the CPU run passes and the GPU run times out, the GPU is usually busy
GMX_DISABLE_GPU_DETECTION=1 make check

# 2. On multi-GPU machines, expose a single GPU to the tests
CUDA_VISIBLE_DEVICES=0 make check

# 3. Timeouts on slow machines or under WSL: raise the timeout factor and reconfigure
cmake .. -DGMX_TEST_TIMEOUT_FACTOR=3 && make check

# 4. Rerun a single test with full output
ctest -R MdrunTests --output-on-failure
make check reports a numerical comparison failure, with a reference value that does not match the computed value

Cause: The test result differs from the reference by more than the tolerance. The cause may be a compiler bug, or the tolerance may be slightly tight.

Fix: Rebuild with a newer compiler. If it still fails, post on the GROMACS forum with a description of the hardware and the full output of gmx mdrun -version.

mdrun -plumed exits at start-up with MPI_ERR_COMM during MPI runs

Cause: A defect in GROMACS 2026.0–2026.3.

Fix: Upgrade to 2026.4.

References

FAQ

Can I install GROMACS on Windows without WSL?

You can build natively with MSVC, and CUDA has been tested on Windows upstream, but there are no official Windows binaries. Native builds cannot use GMX_BUILD_OWN_FFTW and do not support PLUMED; with CMake below 4.3, CUDA builds also need -G Ninja or manually set OpenMP_CUDA flags. If you need a GPU and later extensions, the WSL2 route causes fewer problems.

Can a conda-installed GROMACS use the GPU?

conda-forge provides CUDA builds on linux-64 (including WSL2); select one with "gromacs=2026.3=nompi_cuda*". The driver must support CUDA 12.9. There are no CUDA builds for Windows or macOS, and the bioconda version stopped at 2021.3.

Can older GPUs such as the GTX 1080 or 1660 run the GPU build?

The GTX 1080 has compute capability 6.1 and works, but must be built with CUDA 12.1–12.9; CUDA 13 can no longer generate code for compute capability below 7.5. The GTX 1660 has compute capability 7.5, so both CUDA 12 and 13 work. GROMACS 2026 requires compute capability 5.0 or higher.

What should I do about installation errors on CentOS 7?

CentOS 7 ships GCC 4.8.5 and CMake 2.8, while GROMACS 2025 and later need GCC 11 and CMake 3.28; the GCC 8.5 on Rocky/RHEL 8 is also too old. Install a newer GCC (for example gcc-toolset) and CMake from pip before building, or switch to Ubuntu 24.04 or a container.

How do I confirm GROMACS is using the GPU?

Run gmx mdrun -nb gpu -pme gpu -update gpu and check md.log for "Mapping of GPU IDs … PP:0,PME:0" and "PP task will update and constrain coordinates on the GPU". With the default auto settings, a missing GPU produces no error, only a slower run.

A few make check tests failed. Can I still use the build?

If they are only timeouts and GMX_DISABLE_GPU_DETECTION=1 make check passes, the GPU or CPU was most likely busy during testing; rerun when the machine is idle or with a single GPU. For numerical comparison failures follow the official advice: rebuild with a newer compiler, and if they persist, ask on the forum with the output of gmx mdrun -version.

Hand the GROMACS environment and GPU to Scientify

Scientify's science agent runs in an isolated cloud computer. Its molecular simulation environment comes with GROMACS 2026.3 GPU build preinstalled and self-tested with a water box run on a GPU before delivery. GPUs are rented per task, billed per second and released when done; simulations keep running after you shut down your own computer, and parameter files and logs stay in the project. New users get $5 of free credit.