# GROMACS can not detect GPU

**URL:** <https://gromacs.bioexcel.eu/t/gromacs-can-not-detect-gpu/4520>\
**Category:** User discussions\
**Tags:** mdrun\
**Created:** [July 28, 2022, 5:48am UTC](https://gromacs.bioexcel.eu/t/gromacs-can-not-detect-gpu/4520 "2022-07-28T05:48:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdx](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/bdx/32/1568_2.png) [@bdx](https://gromacs.bioexcel.eu/u/bdx)\
**Post date:** [July 28, 2022, 5:48am UTC](https://gromacs.bioexcel.eu/t/gromacs-can-not-detect-gpu/4520/1 "2022-07-28T05:48:32Z")

</div>

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?

 ![Screenshot from 2022-07-27 12-44-40](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/8/8e5143d8b6f9bf2c3a626397160d6cc147e65f9b.png)

---

<div class="post-metadata">

**Author:** ![Harry](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@Harry](https://gromacs.bioexcel.eu/u/Harry)\
**Post date:** [July 28, 2022, 12:41pm UTC](https://gromacs.bioexcel.eu/t/gromacs-can-not-detect-gpu/4520/2 "2022-07-28T12:41:53Z")

</div>

BS"D

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

---

<div class="post-metadata">

**Author:** ![bdx](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/bdx/32/1568_2.png) [@bdx](https://gromacs.bioexcel.eu/u/bdx)\
**Post date:** [July 29, 2022, 1:27am UTC](https://gromacs.bioexcel.eu/t/gromacs-can-not-detect-gpu/4520/3 "2022-07-29T01:27:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Harry](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@Harry](https://gromacs.bioexcel.eu/u/Harry)\
**Post date:** [July 31, 2022, 7:03am UTC](https://gromacs.bioexcel.eu/t/gromacs-can-not-detect-gpu/4520/4 "2022-07-31T07:03:40Z")

</div>

BS"D

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.  
Harry
