I am trying to compile GROMACS with both GPU acceleration and double precision

GROMACS version: 2016.4
GROMACS modification: No

Hello everyone,

I built GROMACS with CUDA support(NVIDIA GeForce GTX 1060) and have used since February 2018. And I am trying to switch to double precision from single precision because I am about to perform normal mode analysis because the manual suggests to compile gromacs with double precision to perform normal mode analysis.

However, when I compile gromacs with double precision, the error message has occurred.
$ cmake … -DGMX_DOUBLE=on
CMake Error at cmake/gmxManageGPU.cmake:46 (message):

  • GPU acceleration is not available in double precision!*
    Call Stack (most recent call first):
  • CMakeLists.txt:214 (include)*
    – Configuring incomplete, errors occurred!
    See also “/…/Programs/gromacs-2016.4/build/CMakeFiles/CMakeOutput.log”.
    See also “/…/gromacs-2016.4/build/CMakeFiles/CMakeError.log”.

When I checked gmxManageGPU.cmake file, I found this error message will be displayed when I run cmake with both
-DGMX_GPU=on and -DGMX_DOUBLE=on.

if(GMX_GPU AND GMX_DOUBLE)

  • message(FATAL_ERROR “GPU acceleration is not available in double precision!”)*
    endif()
    if(GMX_GPU_AUTO AND GMX_DOUBLE)
  • message(WARNING “GPU acceleration is not available in double precision, disabled!”)*
  • set_property(CACHE GMX_GPU PROPERTY VALUE OFF)*
  • set_property(CACHE GMX_GPU_AUTO PROPERTY VALUE OFF)*
    endif()

So, I thought the gromacs(at least, gromacs 2016.4 version) prohibits to build both GPU acceleration and double precision.

Therefore, there are some questions;

  1. Is it possible to compile both of them, and I wonder how to do if it’s available. Is it available if I build gromacs with newer(or, different) version?

  2. If I compile gromacs with double precision except GPU acceleration, how much the results(precision of the hessian matrix) will be changed, in the other word, will the double precision affect the result dramatically for relatively small systems? (In my case, there are ~16000 atoms in total).

I am waiting for your wisdoms.

Sincerely,
Jin Gyu Seol

Hi,

If by both of them you mean single and double precision, yes. Since GPU support cannot be combined with double precision (even in the most recent version), you can compile that case by setting -DGMX_GPU=off with cmake. After running make install the single and double precision binaries are available alongside eachother, with gmx and gmx_d respectively.

Regards,
Petter

1 Like

Hello Petter,

Thank you for your kind answer and that is the exact answer that I was curious.
I tried as your description and it works completely what I wanted. I appreciate your support!

Sincerely,
Jin Gyu Seol

1 Like

Is this still true with version 2022.3? Double precision with GPU not supported?

Still true. Neither GROMACS 2022 nor the upcoming GROMACS 2023 support double-precision with GPU.

1 Like

Hope that double-precision GPU calculations can be supported in the future! Double precision can solve the energy drift problem very well (in my case), which is why I have to use it!

In what use case do you need low energy drift?

In some cases of heat generation, I need to monitor the perfect conservation of energy in the system. A double precision CPU meets my needs!

That’s also main the reason we use it. Another is systems with very large coordinates.