GROMACS version:2024.3
GROMACS modification: no
My cuda-toolkit is installed in the conda environment
(MD_Gromacs_mpi_plumed)gst@DESKTOP-H4HHN9K:~/groinstall/gromacs-2024.3/build$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Wed_Aug_14_10:10:22_PDT_2024
Cuda compilation tools, release 12.6, V12.6.68
Build cuda_12.6.r12.6/compiler.34714021_0
When I compile Gromacs with GPU acceleration from source code, I get a message “missing: $CUDA_INCLUDE_DIRS” when running the Cmake command. Here is the specific error message:
CMake Error at /home/gst/miniconda3/envs/MD_Gromacs_mpi_plumed/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find CUDA (missing: CUDA_INCLUDE_DIRS) (found suitable version
"12.6", minimum required is "11.0")
Call Stack (most recent call first):
/home/gst/miniconda3/envs/MD_Gromacs_mpi_plumed/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
/home/gst/miniconda3/envs/MD_Gromacs_mpi_plumed/share/cmake-3.30/Modules/FindCUDA.cmake:1294 (find_package_handle_standard_args)
cmake/gmxManageCuda.cmake:45 (find_package)
CMakeLists.txt:697 (include)
Here is the Cmake command:
cmake .. -DGMX_BUILD_OWN_FFTW=OFF \
-DREGRESSIONTEST_DOWNLOAD=ON \
-DGMX_GPU=CUDA \
-DGMX_MPI=ON \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpicxx \
-DGMX_EXTERNAL_BLAS=OFF \
-DGMX_EXTERNAL_LAPACK=OFF \
-DCUDA_TOOLKIT_ROOT_DIR=$CONDA_PREFIX \
-DGMX_SIMD=AVX2_256 \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
My cmake is also installed in conda
(MD_Gromacs_mpi_plumed)gst@DESKTOP-H4HHN9K:~/groinstall/gromacs-2024.3/build$ cmake --version
cmake version 3.30.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
I have added the following variables before running the Cmake command, but Cmake still doesn’t work
export LD_LIBRARY_PATH=:$CONDA_PREFIX/lib
export CUDA_HOME=:$CONDA_PREFIX
export PATH=$PATH:$CONDA_PREFIX/bin
export CUDA_INCLUDE_DIRS=:$CONDA_PREFIX/include
export CUDA_BIN_PATH=$CONDA_PREFIX/bin
But I tried to download and install cuda-toolkit from Nvidia official website
to the default path: /usr/local/cuda12.6
, and then replace -DCUDA_TOOLKIT_ROOT_DIR=$CONDA_PREFIX
to -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda12.6
,Compilation can run normally.
I would like to ask if I have missed adding some variables, or the Cmake file of Gromacs cannot be compiled with the CUDA-toolkit in conda.What should I do if I want to compile with CUDA-toolkit in conda