GROMACS can not detect GPU

GROMACS version:2022.2
GROMACS modification: No
I use the following command to run MD simulation on GPU:
gmx mdrun -v -deffnm md -nb gpu
but the terminal shows: Fatal error: Cannot run short-ranged nonbonded interactions on a GPU because no GPU is detected.
I have also checked the log file, CUDA runtime=N/A
How to solve this problem?


Can you run nvidia-smi -L on the machine on which you are executing the code, and post the result?

GPU 0 : NVIDIA GeForce GTX 1660 Ti (UUID:GPU-551327c3-288e-513b-10b6-e4317545059f)


In 2022.2 I discovered that one needs to include two types of CUDA flags when running cmake:

-DCUDAToolkit_ROOT=/whatever_path/cuda-11.1 -DCUDA_TOOLKIT_ROOT_DIR=/whatever_path/cuda-11.1

In previous versions including the second was enough, but that seems to have changed. I presume this is some kind of bug. Perhaps the first is enough, but I didn’t experiment.