Compiling GROMACS [1] with GPU can be trivial. Previously, we have provided a few articles on the same. In this article, we will solve an error frequently occurring during GROMACS installation.
The error we experience most while compiling GROMACS with CUDA is ‘Could NOT find CUDA: Found unsuitable version “10.1”‘. It occurs when you still haven’t wholly uninstalled CUDA’s old version (here, 10.1).
Before proceeding further, if you are installing GROMACS with CUDA, ensure to remove the previous CUDA toolkit and NVIDIA drivers. For details, read this article.
Now let’s get back to solving the error, you will have to remove the symlink of the previous CUDA version and then link the new one as shown below.
Removing old CUDA symlink
- Go to /usr/local/ (or where your CUDA is installed, generally, it is /usr/local/).
- Open a terminal and change to /usr/local
$ cd /usr/local
- Remove the ‘cuda’ directory as follows:
$ sudo rm cuda
Create a symlink to the new CUDA version
- Paste the following command in the terminal:
$ sudo ln -s /usr/local/cuda-11.7 /usr/local/cuda
This should solve the error. But if you still get the same error then add the CUDA root dir (-D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda
) path in your cmake command as shown below:
$ sudo cmake .. -DGMX_BUILD_OWN_FFTW=OFF -DREGRESSIONTEST_DOWNLOAD=OFF -DMAKE_C_COMPILER=gcc -DGMX_GPU=CUDA -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -DGMX_MPI=OFF -DREGRESSIONTEST_PATH=/your/pwd/path/here/Downloads/regressiontests-2021
References
- Abraham, M. J., Murtola, T., Schulz, R., Páll, S., Smith, J. C., Hess, B., & Lindahl, E. (2015). GROMACS: High performance molecular simulations through multi-level parallelism from laptops to supercomputers. SoftwareX, 1, 19-25.
Further Reading
Method-2: Installing GROMACS on Ubuntu 20.04 with CUDA GPU Support
How to take snapshots of structure at specific times in GROMACS?