i m getting an error compiling gromacs2018.8 on my system with the following:
cmake … -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DCMAKE_INSTALL_PREFIX=/usr/local/gromacs2022 -DCMAKE_BUILD_TYPE=Debug -DGMX_GPU=CUDA -DGMXAPI=ON -
my cuda version is 12.0 and the gpu model: RTX-4060 .
The error complains about " Unsupported gpu architecture 'compute_30"
i tried adding DGMX_CUDA_TARGET_COMPUTE=86 as an option to build but to no avail.
i wonder what is the workaround? is that possible to compile this version with a cuda v12.0 ?
i tried to compile without DGMX_CUDA option , but again i got the below msg:
GROMACS 2018 is quite old and does not support CUDA 12. The supported GROMACS versions now are 2024.0 and 2023.4, both should work with CUDA 12 just fine.
If, for whatever reason, you cannot use newer GROMACS, then you should clear the build directory, and run cmake with -DGMX_CUDA_TARGET_SM=90 (in addition to whatever other flags you have). RTX-4060 has sm_90 architecture, not sm_86. And when compiling for a fixed device, it’s better to specify the real architecture (GMX_CUDA_TARGET_SM), not a virtual one (GMX_CUDA_TARGET_COMPUTE).
If you want to compile without GPU, you should either clear the build directory of explicitly say -DGMX_GPU=OFF. Your previous choice of GMX_GPU=CUDA is remembered otherwise.
None of the solutions I suggested require downgrading CUDA. GROMACS 2023/2024 will work fine with CUDA 12. And if you set the CMake flags right, older versions will likely work too, although they will lack the performance tuning for the RTX 40xx series and other improvements added in newer GROMACS versions, such as GPU-resident mode.
But, if you cannot use newer GROMACS and cannot use any of the flags I suggested, then downgrading CUDA could work. The latest version of CUDA supported by GROMACS 2018 is CUDA 10.
i need to use tabulated potential and hence can not go for the recent version. i applied the necessary flags as you suggested and it all went smoothly. thank you.