Wall simulations with GPU

GROMACS version: 2022.3
GROMACS modification: No

Dear all,

I want to run a simulation with two repulsive walls to keep the system finite in z while having non-periodic boundary conditions in that dimension.
Everything works fine except when offloading bonding interactions to the GPU.

I think the reason behind the problem is related to the energy groups that are created automatically. The Gromacs manual says:
Energy groups wall0 and wall1 (for nwall =2) are added automatically to monitor the interaction of energy groups with each wall

However, this seems to be incompatible with running bonded interactions on the GPU, as I get the following error:
Bonded interactions can not be computed on a GPU: Cannot run with multiple energy groups

Is there any way to switch off the energy groups? I am not interested in monitoring the interactions of the walls (which seems to be the purpose of generating the energy groups according to the indications of the manual), I just want the walls to have the confining effect.

Any help is appreciated.

Stephan

Not offloading the bonded interactions to the GPU should not have a major performance impact. But this check is too restrictive. You should be able to run bondeds on the GPU with this one line change:


diff --git a/src/gromacs/listed_forces/listed_forces_gpu_impl.cpp b/src/gromacs/listed_forces/listed_forces_gpu_impl.cpp
index a7ff7c773e..fdcd4eab8d 100644
--- a/src/gromacs/listed_forces/listed_forces_gpu_impl.cpp
+++ b/src/gromacs/listed_forces/listed_forces_gpu_impl.cpp
@@ -122,7 +122,7 @@ bool inputSupportsListedForcesGpu(const t_inputrec& ir, const gmx_mtop_t& mtop,
             "a dynamical integrator (md, sd, etc).");
     errorReasons.appendIf(EI_MIMIC(ir.eI), "MiMiC");
     errorReasons.appendIf(ir.useMts, "Cannot run with multiple time stepping");
-    errorReasons.appendIf((ir.opts.ngener > 1), "Cannot run with multiple energy groups");
+    errorReasons.appendIf((ir.opts.ngener - ir.nwall > 1), "Cannot run with multiple energy groups");
     errorReasons.finishContext();
     if (error != nullptr)

Thank you very much for your answer, I will give it a try.
In case it works, would it be possible to include this fix in the official release?

I uploaded an MR for the 2024 release. But then I realized that an assertion fails. You can comment out this assertion to make it run. I need to find a clean fix for the MR.

The 2024 beta release allows offloading bondeds to GPUs with walls.

I forgot to create an issue for this. Done now:

Hi, I am getting the same error message, but my simulations do not have walls. I mean, they have but physical, not purely repulsive (nwall = 0).

I have frozen atoms though, and when removing the -bonded gpu flag I still get:

Update task on the GPU was required,
but the following condition(s) were not satisfied:
Frozen atoms not supported.

P.S. it’s not the most recent version on Gitlab, so probably before the fix, but I cannot easily merge the latest release with my code.

Yes, update on gpu is not supported with frozen atoms. This has nothing to do with either bonded interactions or walls.