# Cmake problem: "The CUDA compiler identification is unknown"

**URL:** https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307
**Category:** User discussions
**Created:** [June 5, 2024, 9:32am UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307 "2024-06-05T09:32:57Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![eisoab](https://avatars.discourse-cdn.com/v4/letter/e/df705f/32.png) [@eisoab](https://gromacs.bioexcel.eu/u/eisoab)
#### Post date: [June 5, 2024, 9:32am UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307/1 "2024-06-05T09:32:57Z")

</div>

GROMACS version: gromacs-2024.2

I’m trying to compile gromacs on a Xeon E-2174G with a nvidia Quadro P2000 an fresh almalinux9.4 installation, but I’m getting stuck on a cuda issue after running cmake like this:

```auto

cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESScmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=CUDA
IONTEST_DOWNLOAD=ON -DGMX_GPU=CUDA

[...]

-- The CUDA compiler identification is unknown
CMake Error at /usr/share/cmake/Modules/CMakeDetermineCUDACompiler.cmake:603 (message):
  Failed to detect a default CUDA architecture.

  Compiler output:

Call Stack (most recent call first):
  cmake/gmxManageCuda.cmake:116 (enable_language)
  CMakeLists.txt:697 (include)

```

some output that may be relevant

```auto
[...]
-- Found CUDA: /usr/local/cuda (found suitable version "12.5", minimum required is "11.0") 
-- Adding work-around for issue compiling CUDA code with glibc 2.23 string.h
-- Check for working NVCC/C++ compiler combination with nvcc '/usr/local/cuda/bin/nvcc'
-- Check for working NVCC/C++ compiler combination - works
[...[

```

using cuda-11.8 doesn’t seem to make a difference.

Any idea how to fix this?

Thanks, Eiso

---

<div class="post-metadata">

### Author: ![EishaKhilji](https://avatars.discourse-cdn.com/v4/letter/e/a87d85/32.png) [@EishaKhilji](https://gromacs.bioexcel.eu/u/EishaKhilji)
#### Post date: [June 8, 2024, 6:50pm UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307/2 "2024-06-08T18:50:23Z")

</div>

Hello, I am facing the same issue, did you get any solution?

I have tried multiple solutions available on user forums but all in vain.

make version: 3.29.3 CUDA toolkit: 12.5 gcc version:9.4.0

---

<div class="post-metadata">

### Author: ![eisoab](https://avatars.discourse-cdn.com/v4/letter/e/df705f/32.png) [@eisoab](https://gromacs.bioexcel.eu/u/eisoab)
#### Post date: [June 12, 2024, 11:39pm UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307/3 "2024-06-12T23:39:58Z")

</div>

Hi,  
In the end it worked, but not sure what did the trick …

either adding `-D CMAKE_CUDA_ARCHITECTURES=native`

cmake … -DGMX\_BUILD\_OWN\_FFTW=ON -DREGRESSIONTEST\_DOWNLOAD=ON -DGMX\_GPU=CUDA **-D CMAKE\_CUDA\_ARCHITECTURES=native**

or this:

`dnf install libcudnn8-devel libcudnn8 cudnn`

or both.

Eiso

---

<div class="post-metadata">

### Author: ![EishaKhilji](https://avatars.discourse-cdn.com/v4/letter/e/a87d85/32.png) [@EishaKhilji](https://gromacs.bioexcel.eu/u/EishaKhilji)
#### Post date: [June 14, 2024, 11:38am UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307/4 "2024-06-14T11:38:05Z")

</div>

By this command :  
sudo cmake … -DGMX\_BUILD\_OWN\_FFTW=ON -DREGRESSIONTEST\_DOWNLOAD=ON -DGMX\_GPU=CUDA -D CMAKE\_CUDA\_ARCHITECTURES=native

I got the following error:  
– The CUDA compiler identification is unknown  
CMake Error at cmake/gmxManageCuda.cmake:116 (enable\_language):  
No CMAKE\_CUDA\_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment  
variable “CUDACXX” or the CMake cache entry CMAKE\_CUDA\_COMPILER to the full  
path to the compiler, or to the compiler name if it is in the PATH.  
Call Stack (most recent call first):  
CMakeLists.txt:697 (include)

---

<div class="post-metadata">

### Author: ![EishaKhilji](https://avatars.discourse-cdn.com/v4/letter/e/a87d85/32.png) [@EishaKhilji](https://gromacs.bioexcel.eu/u/EishaKhilji)
#### Post date: [June 15, 2024, 7:35pm UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307/5 "2024-06-15T19:35:13Z")

</div>

Thanks,  
This command worked for me after upgrading gcc version from 9 to 13:

sudo cmake … -DGMX\_BUILD\_OWN\_FFTW=ON -DREGRESSIONTEST\_DOWNLOAD=ON -DGMX\_GPU=CUDA -DCMAKE\_PREFIX\_PATH=/usr/local/cuda-12.5

---

<div class="post-metadata">

### Author: ![MFaizal](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@MFaizal](https://gromacs.bioexcel.eu/u/MFaizal)
#### Post date: [December 21, 2024, 5:40am UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307/6 "2024-12-21T05:40:51Z")

</div>

Thank you guys for the suggestions.

This command worked for me:

cmake … -DGMX\_BUILD\_OWN\_FFTW=ON -DREGRESSIONTEST\_DOWNLOAD=ON -DGMX\_GPU=CUDA -DCMAKE\_PREFIX\_PATH=/usr/local/cuda-12.6 -DCMAKE\_CUDA\_ARCHITECTURES=native

OS: Ubuntu 24.04 LTS  
GROMACS version: gromacs-2024.4  
Processor: Intel Xeon X5660  
GPU: Nvidia RTX3080  
NVIDIA-SMI: 560.35.05  
CUDA version: 12.6  
cmake version: 3.28.3  
gcc version: 13.3.0

---

<div class="post-metadata">

### Author: ![asim.rs](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@asim.rs](https://gromacs.bioexcel.eu/u/asim.rs)
#### Post date: [January 10, 2025, 1:44pm UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307/7 "2025-01-10T13:44:37Z")

</div>

I have tried to enable gpu by the use of `-D CMAKE_CUDA_ARCHITECTURES=native` but in reply " cmake … -DGMX\_BUILD\_OWN\_FFTW=ON -DREGRESSIONTEST\_DOWNLOAD=ON -DGMX\_GPU=CUDA -D CMAKE\_CUDA\_ARCHITECTURES=native  
CMake Error: The source directory “/home/sanghamitra-dey/Downloads/gromacs-2024.4/build/…” does not exist.  
Specify --help for usage, or press the help button on the CMake GUI." I got this. So can you please help me out? Please.

---

<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: [January 10, 2025, 6:45pm UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307/8 "2025-01-10T18:45:12Z")

</div>

> [@asim.rs](#):
>
> `cmake ...`

Should be `cmake ..`. Some people set up `...` to alias `../..` or `..` for convenience.

---

<div class="post-metadata">

### Author: ![edivaldosrodrigues](https://avatars.discourse-cdn.com/v4/letter/e/2acd7d/32.png) [@edivaldosrodrigues](https://gromacs.bioexcel.eu/u/edivaldosrodrigues)
#### Post date: [March 18, 2025, 9:34pm UTC](https://gromacs.bioexcel.eu/t/cmake-problem-the-cuda-compiler-identification-is-unknown/9307/9 "2025-03-18T21:34:50Z")

</div>

> [@EishaKhilji](#):
>
> -DCMAKE\_PREFIX\_PATH=/usr/local/cuda-12.5

this also worked for me
