Compiling 25.4 using CUDA13 on 5090

GROMACS version: 25.4
GROMACS modification: no

CUDA 13 g++ 13.3

Any suggestions please? I am stuck so any help or advice would be very much appreciated.

On a an Nvidia RTX 5090-equipped PC I get the confusing message pasted below when using cmake as follows:

cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/usr/local/gromacsCUDA -DGMX_GPU=CUDA -DCUDAToolkit_ROOT_DIR=/usr/local/cuda -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_CUDA_ARCHITECTURES=120

>>>>

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find CUDAToolkit (missing: CUDAToolkit_BIN_DIR) (found suitable
version “13.0.2”, minimum required is “12.1”)
Call Stack (most recent call first):
/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.28/Modules/FindCUDAToolkit.cmake:1009 (find_package_handle_standard_args)
cmake/gmxManageCuda.cmake:45 (find_package)
CMakeLists.txt:726 (include)

The output file is appended

outputfile.txt (6.1 KB)

I solved this subsequently by updating cmake to 4.2.0, and by creating and calling the following runcmake.sh

#!/bin/bash
cmake ..
-DCMAKE_C_COMPILER=/usr/bin/gcc
-DCMAKE_CXX_COMPILER=/usr/bin/g++
-DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-13/bin/nvcc
-DCUDAToolkit_ROOT=/usr/local/cuda-13
-DGMX_GPU=CUDA
-DCMAKE_CUDA_ARCHITECTURES=120
-DCMAKE_INSTALL_PREFIX=/usr/local/gromacsCUDA
-DGMX_BUILD_OWN_FFTW=ON

I am not sure whether it was the setting of the compilers or the update to cmake that was the crucial step but this combination [Gromacs 25.4, CUDA 13, cmake 4.2, the variables (and compiler versions) as set above, and an nvidia RTX5090] was successful.

1 Like