# GPU based gromacs installation with nvcc error; compute 35

**URL:** <https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743>\
**Category:** User discussions\
**Created:** [February 7, 2023, 7:20am UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743 "2023-02-07T07:20:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![purvak](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@purvak](https://gromacs.bioexcel.eu/u/purvak)\
**Post date:** [February 7, 2023, 7:20am UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/1 "2023-02-07T07:20:46Z")

</div>

GROMACS version: 2021.5  
GROMACS modification: No

I am trying to install gromacs 2021.5 using GPU CUDA version 12. However, I am getting the following error:  
nvcc fatal : Unsupported gpu architecture ‘compute\_35’  
CMake Error at libgromacs\_generated\_gpuhaloexchange\_impl.cu.o.Release.cmake:220 (message):  
Error generating  
/home/sdsos/gromacs-2021.5/build/src/gromacs/CMakeFiles/libgromacs.dir/domdec/./libgromacs\_generated\_gpuhaloexchange\_impl.cu.o

I have tried all possible solutions but still getting the same error. Please suggest.

---

<div class="post-metadata">

**Author:** ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)\
**Post date:** [February 7, 2023, 10:35am UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/2 "2023-02-07T10:35:23Z")

</div>

Hi,

GROMACS 2021 requests compilation for CUDA compute capabilities 3.5 and later (as configured in `gmxManageNvccConfig.cmake`), but CUDA 12 does not support 3.5 any more. To solve that issue, you could use an earlier CUDA version if you have (CUDA 11.0 would do the trick, e.g.) or you could also directly specify the compute cabability of your GPU via the CMake variables `-DGMX_CUDA_TARGET_COMPUTE` and `-DGMX_CUDA_TARGET_SM`. What GPU model are you compiling for?

Hope that helps!  
Carsten

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [February 7, 2023, 12:02pm UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/3 "2023-02-07T12:02:38Z")

</div>

Hi,

In addition to Carsten’s great answer, another option is to use GROMACS 2022 or newer, which has “smarter” detection of compiler flags and should handle the lack of CC 3.5 support in CUDA 12 gracefully.

---

<div class="post-metadata">

**Author:** ![purvak](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@purvak](https://gromacs.bioexcel.eu/u/purvak)\
**Post date:** [February 9, 2023, 6:47am UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/4 "2023-02-09T06:47:37Z")

</div>

Okay Sir. I will give it a try. Thank you.

---

<div class="post-metadata">

**Author:** ![purvak](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@purvak](https://gromacs.bioexcel.eu/u/purvak)\
**Post date:** [February 9, 2023, 6:48am UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/5 "2023-02-09T06:48:57Z")

</div>

I would have used 2022 but my previous simulations were from 2021. Anyways, thank you for the suggestion!

---

<div class="post-metadata">

**Author:** ![purvak](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@purvak](https://gromacs.bioexcel.eu/u/purvak)\
**Post date:** [February 18, 2023, 9:48am UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/6 "2023-02-18T09:48:12Z")

</div>

Hey,  
I am not able to install the older versions. My GPU version is;  
NVIDIA RTX A5000 (UUID: GPU-e803b49f-c89f-066e-a19b-d2b86d7ee6cc)

Can you please tell me what values would come in these variables; -DGMX\_CUDA\_TARGET\_COMPUTE= ? and -DGMX\_CUDA\_TARGET\_SM = ?

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [February 18, 2023, 1:43pm UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/7 "2023-02-18T13:43:31Z")

</div>

For RTX A5000, please use `-DGMX_CUDA_TARGET_SM=86`.

A very convenient list of NVIDIA devices’ compute capabilities can be found at [Matching CUDA arch and CUDA gencode for various NVIDIA architectures - Arnon Shimoni](https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/).

---

<div class="post-metadata">

**Author:** ![purvak](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@purvak](https://gromacs.bioexcel.eu/u/purvak)\
**Post date:** [February 19, 2023, 10:30am UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/8 "2023-02-19T10:30:43Z")

</div>

Okay. I will try. Thank you so much

---

<div class="post-metadata">

**Author:** ![purvak](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@purvak](https://gromacs.bioexcel.eu/u/purvak)\
**Post date:** [February 20, 2023, 12:39pm UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/9 "2023-02-20T12:39:26Z")

</div>

Hey, it worked! Thank you so much.

---

<div class="post-metadata">

**Author:** ![Amar](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@Amar](https://gromacs.bioexcel.eu/u/Amar)\
**Post date:** [May 19, 2023, 6:47pm UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/10 "2023-05-19T18:47:35Z")

</div>

hey, I install gromocs through follwong command but GPU not supporting

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

tar xfz gromacs-2021.4.tar.gz  
cd gromacs-2021.4  
mkdir build  
cd build  
cmake … -DGMX\_CUDA\_TARGET\_SM=86 -DCUDA\_TOOLKIT\_ROOT\_DIR=/usr/local/cuda -DGMX\_GPU=ON  
make  
make check  
sudo make install  
source /usr/local/gromacs/bin/GMXRC  
gmx mdrun -deffnm md\_0\_10 -nb gpu

MY system configration is  
processor Intel® Core™ i5-10400F × 12  
memory 16GM  
Graphics NVIDIA Corporation GK208B [GeForce GT 710]  
disk capicity 2TB

---

<div class="post-metadata">

**Author:** ![Amar](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@Amar](https://gromacs.bioexcel.eu/u/Amar)\
**Post date:** [May 19, 2023, 6:51pm UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/11 "2023-05-19T18:51:38Z")

</div>

hey, I install gromocs through follwong command but GPU not supporting

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

tar xfz gromacs-2021.4.tar.gz  
cd gromacs-2021.4  
mkdir build  
cd build  
cmake … -DGMX\_CUDA\_TARGET\_SM=86 -DCUDA\_TOOLKIT\_ROOT\_DIR=/usr/local/cuda -DGMX\_GPU=ON  
make  
make check  
sudo make install  
source /usr/local/gromacs/bin/GMXRC  
gmx mdrun -deffnm md\_0\_10 -nb gpu

MY system configration is  
processor Intel® Core™ i5-10400F × 12  
memory 16GM  
Graphics NVIDIA Corporation GK208B [GeForce GT 710]  
disk capicity 2TB

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [May 19, 2023, 7:21pm UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/12 "2023-05-19T19:21:01Z")

</div>

Usually this means you have some kind of mismatch between your CUDA library and driver versions. What is the output of `gmx mdrun --version`?

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [May 19, 2023, 10:18pm UTC](https://gromacs.bioexcel.eu/t/gpu-based-gromacs-installation-with-nvcc-error-compute-35/5743/13 "2023-05-19T22:18:51Z")

</div>

> [@Amar](#):
>
> cmake … -DGMX\_CUDA\_TARGET\_SM=86 -DCUDA\_TOOLKIT\_ROOT\_DIR=/usr/local/cuda -DGMX\_GPU=ON  
> make  
> make check  
> sudo make install  
> source /usr/local/gromacs/bin/GMXRC  
> gmx mdrun -deffnm md\_0\_10 -nb gpu
> 
> MY system configration is  
> processor Intel® Core™ i5-10400F × 12  
> memory 16GM  
> Graphics NVIDIA Corporation GK208B [GeForce GT 710]

Hi!

You are compiling with `-DGMX_CUDA_TARGET_SM=86`, but [your device is 3.5](https://www.techpowerup.com/gpu-specs/nvidia-gk208b.g815). Please, use the correct flags when building GROMACS (or omit `DGMX_CUDA_TARGET_SM` altogether) and the compatible CUDA version (11.x, not 12.x).
