GROMACS - gpu is not detected

GROMACS version: 2021
GROMACS modification: Yes/No
Why gromacs does not detect my GPU ?


I am a new user of molecular dynamics simulation and bioinformatics. Two days ago I have installed gromacs following the instruction on the website. Here my gmx features :
GROMACS version: 2021
Verified release checksum is 3e06a5865d6ff726fc417dea8d55afd37ac3cbb94c02c54c76d7a881c49c5dd8
Precision: mixed
Memory model: 64 bit
MPI library: thread_mpi
OpenMP support: enabled (GMX_OPENMP_MAX_THREADS = 64)
GPU support: CUDA
SIMD instructions: AVX2_256
FFT library: fftw-3.3.8-sse2-avx-avx2-avx2_128
RDTSCP usage: enabled
TNG support: enabled
Hwloc support: disabled
Tracing support: disabled
C compiler: /usr/bin/cc GNU 9.3.0
C compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -O3 -DNDEBUG
C++ compiler: /usr/bin/c++ GNU 9.3.0
C++ compiler flags: -mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA compiler: /usr/local/cuda/bin/nvcc nvcc: NVIDIA ® Cuda compiler driver;Copyright © 2005-2020 NVIDIA Corporation;Built on Mon_Nov_30_19:08:53_PST_2020;Cuda compilation tools, release 11.2, V11.2.67;Build cuda_11.2.r11.2/compiler.29373293_0
CUDA compiler flags:-std=c++17;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-Wno-deprecated-gpu-targets;-gencode;arch=compute_35,code=compute_35;-gencode;arch=compute_50,code=compute_50;-gencode;arch=compute_52,code=compute_52;-gencode;arch=compute_60,code=compute_60;-gencode;arch=compute_61,code=compute_61;-gencode;arch=compute_70,code=compute_70;-gencode;arch=compute_75,code=compute_75;-gencode;arch=compute_80,code=compute_80;-use_fast_math;-D_FORCE_INLINES;-mavx2 -mfma -Wno-missing-field-initializers -fexcess-precision=fast -funroll-all-loops -fopenmp -O3 -DNDEBUG
CUDA driver: 11.20
CUDA runtime: N/A

But, when I try to run a molecular dynamics simulation using my GPU for the non-bonded, this error message is prompted " Cannot run short-ranged nonbonded interactions on a GPU because no GPU is detected.".

Can someone help me to fix that ?

  1. Is your computer detected GPU?
  2. How did you install GROMACS? Installation guide — GROMACS 2021-beta1-UNCHECKED documentation
    In this part “cmake … -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON” you must add -DGMX_GPU=CUDA, so in your terminal you must write
  3. It’s my advice. Don’t install the newest version of GROMCS. It can have some undetected errors. Choose version which is minimum six months after release. In addition GROMACS 2021 is a beta version, so it is a little bit risky.

That is a sign that your CUDA runtime is either not installed correctly or is not compatible with your driver. Is there any other detection error in the log?

That is useful, but the above binary is already built with CUDA support (see GPU support: CUDA above), so it will not address the issue.

2021 stable was released two weeks ago: GROMACS 2021 official release

1 Like

Thank to JakubH and you for the reply.

I think the best solution for me is to install the real Ubuntu system on my workstation. I am using WSL 2 and I cannot install correctly Cuda and the cuda toolkit because I have to join “Windows Insider Program” but my system refuse to join it. I hope this will help :).

OK, WSL might explain the issues. I have little experience with WSL + CUDA, but in principle it sohuld work. Here is the NVIDIA documentation: CUDA on WSL :: CUDA Toolkit Documentation

Unlikely, but you could check whether you can run a CUDA samples program (as suggested here). If that works, but GROMACS does not, that’s something we should try to fix.

Let us know if you succeed, it would be good to know if GROMACS works smoothly on WSL2 with CUDA.