Cmake problem: "The CUDA compiler identification is unknown"

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:


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

[...]
-- 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

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

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

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)

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

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

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.

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

this also worked for me