# Gmx mdrun with GPU

**URL:** <https://gromacs.bioexcel.eu/t/gmx-mdrun-with-gpu/7415>\
**Category:** User discussions\
**Tags:** mdrun\
**Created:** [October 17, 2023, 12:23am UTC](https://gromacs.bioexcel.eu/t/gmx-mdrun-with-gpu/7415 "2023-10-17T00:23:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozge](https://avatars.discourse-cdn.com/v4/letter/o/e47774/32.png) [@ozge](https://gromacs.bioexcel.eu/u/ozge)\
**Post date:** [October 17, 2023, 12:23am UTC](https://gromacs.bioexcel.eu/t/gmx-mdrun-with-gpu/7415/1 "2023-10-17T00:23:44Z")

</div>

GROMACS version: gromacs-2018.6  
GROMACS modification: No  
I have a large membrane system and I want to run the simulation 250 ns. But the gromacs performance was not enough. I used this command:

- gmx mdrun -v -deffnm nvt -ntmpi 2 -ntomp 3 -nb gpu -gpu\_id 23

The performance was 12.873 ns/day and it is too slow. I am using 2 GPU, how can I enhance this performance? I saw some suggests about -pme gpu and - update gpu. I am not sure how much difference it makes. Has anyone encountered this situation before? Thanks for your help.

---

<div class="post-metadata">

**Author:** ![al42and](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/al42and/32/1393_2.png) [@al42and](https://gromacs.bioexcel.eu/u/al42and)\
**Post date:** [October 18, 2023, 12:17pm UTC](https://gromacs.bioexcel.eu/t/gmx-mdrun-with-gpu/7415/2 "2023-10-18T12:17:10Z")

</div>

Hi!

> [@ozge](#):
>
> I saw some suggests about -pme gpu and - update gpu. I am not sure how much difference it makes. Has anyone encountered this situation before?

Both of these options (and `-bonded gpu` too) tend to improve things, often a lot, but it is impossible to tell without any details about your system and your hardware.

Have you followed the tips in the [Getting good performance from mdrun](https://manual.gromacs.org/documentation/current/user-guide/mdrun-performance.html#running-mdrun-with-gpus) section of GROMACS manual? There is also [a short webinar by Berk Hess](https://www.youtube.com/watch?v=RUqdzntAgMc) covering the basics of performance tuning.

The best thing you can do is try! You can use `-maxh` or `-nsteps` options to limit the run time to a few minutes, and then check the performance with different settings. Use performance report at the end of the mdrun log and the materials above to guide your tuning.

It would also be a good idea to use a newer version of GROMACS; there had been quite a few performance improvements in the 5 years since 2018 release.

---

<div class="post-metadata">

**Author:** ![ozge](https://avatars.discourse-cdn.com/v4/letter/o/e47774/32.png) [@ozge](https://gromacs.bioexcel.eu/u/ozge)\
**Post date:** [October 18, 2023, 3:07pm UTC](https://gromacs.bioexcel.eu/t/gmx-mdrun-with-gpu/7415/3 "2023-10-18T15:07:55Z")

</div>

Hi,  
Thank you so much for your advices. Yes, I looked the Gromacs manuel, it helps a lot. Sure, the problem solved with GROMACS 2021.3 version. I also used -pinoffset, -pinstride, and -pin on options. Its performance is much better than the other. Maybe it will be useful for users who encounter similar problems.

---

<div class="post-metadata">

**Author:** ![Sourav7](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@Sourav7](https://gromacs.bioexcel.eu/u/Sourav7)\
**Post date:** [May 31, 2024, 5:53am UTC](https://gromacs.bioexcel.eu/t/gmx-mdrun-with-gpu/7415/4 "2024-05-31T05:53:01Z")

</div>

can you share the full command line you have use
