Gromacs in docker image does not work in server

GROMACS version: 2024.4
GROMACS modification: No

I have compiled and build an docker image containing gromacs 2024.4 on my local PC which perfectly fine. However, the server / production version seems to consistently be yielding the following error:

Command ‘source /usr/local/gromacs/bin/GMXRC; gmx pdb2gmx -f input.pdb -o next.pdb -water tip3p -ignh -missing’ died with <Signals.SIGILL: 4>.

Is this due to a cross compatibility issue with the CPU? If so, what is the best way to fix this so that I can run gromacs on multiple devices without having to re-compile?

Yes. GROMACS normally detects the CPU used during the build process and optimizes for it. This improves the performance on the current machine, but, as you discovered, limits the portability.

Find out which CPUs you are using, find out the latest SIMD instruction set supported by them all, and select it explicitly by passing -DGMX_SIMD=... to CMake.

As long as the CPUs are released in the recent years, compiling with -DGMX_SIMD=AVX2_256 should be fine. Setting -DGMX_SIMD=SSE2 would lead to widest compatibility, but the performance would be noticeably worse.

Perfect, thank you for the information. I also saw that using -DGMX_CPU_ACCELERATION=None with -DGMX_SIMD=AVX2_256 may apply.

I was wondering if -DGMX_CPU_ACCELERATION=None should be used as well or if this is not necessary / will hurt performance?

Did an LLM suggest that? We don’t have such an option in our build system.

Thanks for clarifying this.

Indeed an LLM provided me with the suggestion, though I also saw it referenced in a few other places such as here which is why I wanted the additional clarification.

Really appreciate the help and have a great week!

Cool, didn’t know we had it in the past :)