Installation Error on WSL2 with CUDA Toolkit

GROMACS version: 2025.2
GROMACS modification: No
Here post your question

Hello,
I tried to install GROMACS 2025.2 on wsl2-Ubuntu 22.04.5 with CUDA. My device has an NVidia RTX 2060. Here’s the cmake command I used:
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=CUDA -DCMAKE_CUDA_ARCHITECTURES=75 -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/gcc -DCMX_CUDA_TARGET_SM=“75”

While running make I then receive the following error:

[ 92%] Linking CXX shared library ../../lib/libgromacs.so
/usr/bin/ld: CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda.cu.o: in function `gmx::gpu_launch_kernel_pruneonly(gmx::NbnxmGpu*, gmx::InteractionLocality, int)':                                                                                                                                                         tmpxft_0001cfc1_00000000-6_nbnxm_cuda.compute_120.cudafe1.cpp:(.text+0x605): undefined reference to `void gmx::nbnxn_kernel_prune_cuda<true>(gmx::NBAtomDataGpu, gmx::NBParamGpu, gmx::GpuPairlist, int)'                                                                                                                 /usr/bin/ld: CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda.cu.o: relocation R_X86_64_PC32 against undefined hidden symbol `_ZN3gmx23nbnxn_kernel_prune_cudaILb1EEEvNS_13NBAtomDataGpuENS_10NBParamGpuENS_11GpuPairlistEi' can not be used when making a shared object                                                   /usr/bin/ld: final link failed: bad value                                                                                                                    collect2: error: ld returned 1 exit status                                                                                                                   make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:14521: lib/libgromacs.so.10.0.0] Error 1                                                      make[1]: *** [CMakeFiles/Makefile2:5606: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2                                                                  make: *** [Makefile:166: all] Error 2

My GCC version is 11.4.0 and my Cuda Toolkit version is 13.0.48. I would appreciate any help people here can offer.

Hi.

CUDA 13 will be supported since GROMACS 2025.3 (planned for September).

For now, you can fix the problem by adding -DCMAKE_CUDA_FLAGS=-static-global-template-stub=false to your CMake command. Or downgrade CUDA to 12.9, that one works without any extra steps.