GROMACS version:
GROMACS modification: Yes/No
Here post your question
I have used this command line:
CUDACXX=/usr/local/cuda/ cmake .. -DCMAKE_CUDA_ARCHITECTURES=native -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_MPI=on -DGMX_GPU=CUDA -DOCL_ROOT=/usr/local/cuda/targets/x86_64-linux/lib/ -DGMX_FFT_LIBRARY=fftw3 -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU_FFT_LIBRARY=cuFFT
and I get:
CMake Error at CMakeLists.txt:796 (message):
The CUDA build only supports cuFFT GPU FFT library
– Configuring incomplete, errors occurred!
Then, I introduce the full path for cuFFT libraries:
CUDACXX=/usr/local/cuda-12.9/bin/nvcc cmake .. -DCMAKE_CUDA_ARCHITECTURES=native -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_MPI=on -DGMX_GPU=CUDA -DOCL_ROOT=/usr/local/cuda/targets/x86_64-linux/lib/ -DGMX_FFT_LIBRARY=fftw3 -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU_FFT_LIBRARY=/usr/local/cuda/targets/x86_64-linux/lib/
and it does not work neither, I get:
CMake Error at cmake/gmxOptionUtilities.cmake:78 (message):
Invalid value for GMX_GPU_FFT_LIBRARY:
/usr/local/cuda/targets/x86_64-linux/lib/cuFFT. Pick one of: cuFFT, clFFT,
VkFFT, MKL, oneMath, rocFFT, BBFFT, none
Call Stack (most recent call first):
CMakeLists.txt:349 (gmx_option_multichoice)
– Configuring incomplete, errors occurred!
How can I solve this issue?
Thanks in advance
Hi,
- What version of GROMACS are you using?
- Have you tried fully clearing your build directory and re-running CMake again?
- If clearing the directory does not help, please share the full CMake output, not just the error.
This won’t work; your first approach of setting -DGMX_GPU_FFT_LIBRARY=cuFFT
is the correct one. However, if you repeatedly try builds with different settings in the same build directory, things can get mixed up because CMake tries to reuse as much as possible from the last time, and for the developers it’s nearly impossible to test every possible order of changing things. Which is why the advice above to clear the build directory.
Hi,
Thank you for your response.
The answer are:
- gromacs-2025.2
- Before this answer, no
- Clearing the directory worked… But, when I “make” the code I receive:
[ 92%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/selection/sm_simple.cpp.o
[ 92%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/selection/symrec.cpp.o
[ 92%] Linking CXX shared library ../../lib/libgromacs_mpi.so
/home/alejo/Downloads/gromacs-2025.2/src/gromacs/selection/selvalue.cpp: In function ‘_gmx_selvalue_reserve’:
/home/alejo/Downloads/gromacs-2025.2/src/gromacs/selection/selvalue.cpp:100:47: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
100 | val->u.p = new gmx_ana_pos_t[n];
| ^
/usr/include/c++/13/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^
/tmp/ccfwur6x.s: Assembler messages:
/tmp/ccfwur6x.s:5264: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:23978: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:827674: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:1466499: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:2255113: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3120776: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3145052: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3147133: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3147682: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3154581: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3155130: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3155679: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3161017: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3161566: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3173078: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3173627: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3174176: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3195389: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3195938: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3197825: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3198374: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3249615: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3250164: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3332078: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3332627: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3333176: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3333725: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3334274: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3334823: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3335372: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3335921: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3336470: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3348461: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3349010: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3349559: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3404418: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3426105: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3494922: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3495471: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3496020: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3496569: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3497118: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3497667: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3498216: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3498765: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3499314: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3499863: Error: symbol `fatbinData' is already defined
/tmp/ccfwur6x.s:3501119: Error: symbol `fatbinData' is already defined
make[3]: *** [/tmp/ccR3vE4F.mk:2: /tmp/cchJ0kpJ.ltrans0.ltrans.o] Error 1
make[3]: *** Waiting for unfinished jobs....
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:14478: lib/libgromacs_mpi.so.10.0.0] Error 1
make[1]: *** [CMakeFiles/Makefile2:4522: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
(base) alejo@alejo:~/Downloads/gromacs-2025.2/build$
How can I solve it?
Best regards,
David
Hi,
That’s a new issue. It seems something in your toolchain, likely MPI, is enabling LTO (link-time-optimization). LTO is usually a good thing (although the effects in GROMACS are minimal and we usually don’t recommend using it), but does not work all that well with CUDA.
Can you try re-running CMake with -DCMAKE_C_FLAGS=-fno-lto -DCMAKE_CXX_FLAGS=-fno-lto -DCMAKE_SHARED_LINKER_FLAGS=-fno-lto
?
Hi,
I added your suggestion:
CUDACXX=/usr/local/cuda-12.9/bin/nvcc cmake .. \
-DGMX_BUILD_OWN_FFTW=ON \
-DREGRESSIONTEST_DOWNLOAD=ON \
-DGMX_MPI=ON \
-DGMX_GPU=CUDA \
-DCMAKE_CUDA_ARCHITECTURES="native" \
-DCMAKE_C_COMPILER=gcc-11 \
-DCMAKE_CXX_COMPILER=g++-11 \
-DCMAKE_C_FLAGS="-fno-lto" \
-DCMAKE_CXX_FLAGS="-fno-lto" \
-DCMAKE_SHARED_LINKER_FLAGS=-fno-lto \
-B build_gpu \
-DGGML_CUDA=1 \
-DCUDAToolkit_ROOT=/usr/local/cuda-12.9/bin/ \
-DGMX_FORCE_GPU_AWARE_MPI
Then, I followed the instructions: “make” and “make check.” The last step of the testing process, “make check,” ends with errors. I have shared the output of the cmake process (attached), may be to find something else.
Best regards,
David
log.log (15.9 KB)
If make check
ends with an error, please attach the output from it (full, not just the list of failed tests at the end). The CMake log looks ok.
Also, -DGGML_CUDA=1
is not used by GROMACS in any way, and -DGMX_FORCE_GPU_AWARE_MPI
is not used at CMake time (and, since your MPI library supports CUDA-aware detection, you probably should not set this flag at runtime either, unless you’re absolutely sure that the MPI library is lying about itself).
Hi,
Thank you for your comments and help, I will post a new issue with detailed logs.