GROMACS version: 2025.03
GROMACS modification: No
Here post your question
Issue: When running mdrun simulations, my computer often crash (the screen could not wake up and I had to hold the power button to shutdown), occasionally occurring after the run has finished.
Command used: I used nohup gmx mdrun -deffnm system_500ns -v &, and -it seems that the simulation occupied too much resources under this command. My workstation has 16 physical cores and 32 logical cores (threads), and a RTX 5090 graphic card.
Question: Should I confine the number of cores used for CGMD simulation, for example, by using nohup gmx mdrun -deffnm system_500ns -v -ntomp 16 -gpu_id 0 -nb gpu -pin on &?
Or nohup taskset -c 8-23 gmx mdrun -deffnm system_500ns -v -ntmpi 1 -ntomp 16 -gpu_id 0 -nb gpu -pin on & ?
You forgot to mention the available RAM and assuming it should be large enough to match your CPU and GPU specs (>=32GB). You can go with the second option of specifying the number of MPI processes with ntmpi but confining the number of threads would certainly help alleviate your resource usage issue. While the later command is better, former can also be used if confining the number of threads is enough. Good luck,
That’s a good idea. GROMACS tries to use all resources of your machine. It should not lead to any crashes normally, but (a) it might make UI / desktop unresponsive, (b) it might cause instability due to high power draw. Limiting the number of CPU cores won’t necessary solve the issue (GPU can be another contention point; and the freezes happening after the run is also very suspicious), but is a good and easy thing to try.
The first command should be fine, but adding -ntmpi 1 for explicitness would be good. I’d probably even do -ntmpi 1 -ntomp 4 for testing; if the problem persists with even 4 cores used, then the issue is definitely elsewhere.
The taskset -c 8-23 gmx mdrun -ntmpi 1 -ntomp 16 -pin on ... will not quite work. With -pin on, GROMACS will ignore the CPU affinity from taskset. You should use gmx mdrun -ntmpi 1 -ntomp 16 -pin on -pinoffset 8 ... to achieve the same effect. However, it likely does not matter which cores you are using.
Note for note: With GROMACS 2026, you will be able to do taskset ... gmx mdrun -pin inherit ... to make GROMACS respect taskset’s options.
If that does not help:
Have you tried any other long-running CPU/GPU intensive processes? Benchmarks, high-end gaming, etc? The crashes happening after the simulation has ended suggests that it could be general hardware stability issue, not related to GROMACS.
Enable SSH on your machine (if it’s Linux) and trying to connect to it remotely after it freezes: perhaps, it’s just the graphics part that got borked, and you will at least be able to check it’s state.
Try disabling the GPU (-nb cpu). Not good for performance, but can narrow things down.
As rube23 suggested, checking memory usage could be good. GROMACS uses very little memory and it is rarely a problem, but no harm in verifying that.
Thanks a lot. Now I am trying -ntmpi 1 -ntomp 16 without taskset. The last simulation did not cause crash, but further testing is needed. I think SSH will help to check whether it is just graphical user interface that crashed.