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.
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.