# Segmentation fault error in mdrun

**URL:** <https://gromacs.bioexcel.eu/t/segmentation-fault-error-in-mdrun/11660>\
**Category:** User discussions\
**Tags:** mdrun-crash\
**Created:** [March 1, 2025, 11:05pm UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-error-in-mdrun/11660 "2025-03-01T23:05:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![roozi](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@roozi](https://gromacs.bioexcel.eu/u/roozi)\
**Post date:** [March 1, 2025, 11:05pm UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-error-in-mdrun/11660/1 "2025-03-01T23:05:16Z")

</div>

GROMACS version:2024.3  
GROMACS modification: No

Hi.  
When I run an awh simulation of a protein solution on gromacs 2024.3 I get segmentation fault (core dumped) upon starting the simulation. I do not think it is due to may simulation parameters and/or system size as i used to simulate the same system using the same .mdp and .gro files in the past on the same computer with gromacs 2024 without getting any error (the only difference is that in the past, the computer base OS was windows11 but currently it is windows10, however i use ubuntu on wsl2 in both cases).  
I also tried different versions of gromacs (2024.3 , 2024, 2023.3 , 2022.3) but kept getting the same error.  
I am running gromacs on WSL2 ubuntu 22.04 (also tried ubuntu 24.02 but got the same error) on a windows10 OS.  
Cuda toolkit version is 11.7 and g++ and gcc are both v11.4.

the PC has 32 CPU cores and a _NVIDIA GeForce RTX 3090_ with 24 GB gpu ram and 128 GB memory (RAM).  
I appreciate if anyone could offer some help to resolve this frustrating problem.  
best regards.

---

<div class="post-metadata">

**Author:** ![roozi](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@roozi](https://gromacs.bioexcel.eu/u/roozi)\
**Post date:** [March 2, 2025, 1:03pm UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-error-in-mdrun/11660/2 "2025-03-02T13:03:46Z")

</div>

I tried to resolve the issue by upgrading cuda 11.7 to cuda v.12.2 and reinstalling gromacs 24.3 using upgraded cuda , but got the same error. Also tried reducing the simulation box to make sure the error is not caused by large system size. as expected i got the same segmention error (core dumped) error mrssage which confirms it is not really the imulation box size that is causing the problem. i am really baffled.

**below is the output of nvidia-smi for further information:**

> Sun Mar 2 16:17:12 2025  
> ±----------------------------------------------------------------------------+  
> | NVIDIA-SMI 470.256.02 Driver Version: 560.94 CUDA Version: 12.6 |  
> |-------------------------------±---------------------±---------------------+  
> | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |  
> | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |  
> | | | MIG M. |  
> |===============================+======================+======================|  
> | 0 NVIDIA GeForce … On | 00000000:01:00.0 On | Off |  
> | 0% 40C P8 17W / 450W | 1007MiB / 24564MiB | 1% Default |  
> | | | N/A |  
> ±------------------------------±---------------------±---------------------+

> ±----------------------------------------------------------------------------+  
> | Processes: |  
> | GPU GI CI PID Type Process name GPU Memory |  
> | ID ID Usage |  
> |=============================================================================|  
> | 0 N/A N/A 21 G /Xwayland N/A |  
> ±----------------------------------------------------------------------------+

**and the output of nvcc --version:**

> nvcc: NVIDIA (R) Cuda compiler driver  
> Copyright (c) 2005-2023 NVIDIA Corporation  
> Built on Tue\_Jun\_13\_19:16:58\_PDT\_2023  
> Cuda compilation tools, release 12.2, V12.2.91  
> Build cuda\_12.2.r12.2/compiler.32965470\_0

**Also here is the link to my .tpr file in case necessary to reproduce the error. _(gomacs2024.3 , cuda12.2 , wsl2 ubuntu 24.04.2 on windows10- gpu RTX-3090-Ti)_**

> **[LimeWire: Share Files - Secure File Upload Platform](https://limewire.com/?referrer=48k1433kko&lmwr-ftv=1)**
>
> Upload and send files of any size quickly and securely. No account required to share your files, photos and videos.

---

<div class="post-metadata">

**Author:** ![roozi](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@roozi](https://gromacs.bioexcel.eu/u/roozi)\
**Post date:** [March 3, 2025, 2:45am UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-error-in-mdrun/11660/3 "2025-03-03T02:45:05Z")

</div>

As i further investigate the error, I came upon a strange observation:  
The error persists no matter what , when i do not explicitly set the -nt flag in mdrun command, like below:

> _gmx mdrun -deffnm awh -pf pullf.xvg -px pullx.xvg -cpi awh.cpt -awh awhinit.xvg -bonded gpu -nb gpu -pme gpu -update gpu_

but when i set the -nt flag explicitly to 16, the system runs smoothly just giving the following notice:

> _gmx mdrun -deffnm awh -pf pullf.xvg -px pullx.xvg -cpi awh.cpt -awh awhinit.xvg **-nt 16** -bonded gpu -nb gpu -pme gpu -update gpu_

> _\> NOTE: The number of threads is not equal to the number of (logical) cpus_  
> _\> and the -pin option is set to auto: will not pin threads to cpus._  
> _\> This can lead to significant performance degradation._  
> _\> Consider using -pin on (and -pinoffset in case you run multiple jobs)_

accordingly i tried to incease -nt to 32 (max num of cores available on my machine) to get the optimum performance, but much to my surprise i keep getting **segmentation fault(core dumped) error , for any -nt greater than 16!**

here is the output of lscpu command which clearly shows 32 threads is available:

> Architecture: x86\_64  
> CPU op-mode(s): 32-bit, 64-bit  
> Address sizes: 46 bits physical, 48 bits virtual  
> Byte Order: Little Endian  
> CPU(s): 32  
> On-line CPU(s) list: 0-31  
> Vendor ID: GenuineIntel  
> Model name: Intel(R) Core™ i9-14900K  
> CPU family: 6  
> Model: 183  
> Thread(s) per core: 2  
> Core(s) per socket: 16  
> Socket(s): 1  
> Stepping: 1  
> BogoMIPS: 6374.39  
> Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant\_tsc rep\_good nopl xtopology tsc\_reliable nonstop\_tsc cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4\_1 sse4\_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf\_lm abm 3dnowprefetch invpcid\_single ssbd ibrs ibpb stibp ibrs\_enhanced fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha\_ni xsaveopt xsavec xgetbv1 xsaves umip gfni vaes vpclmulqdq rdpid fsrm md\_clear flush\_l1d arch\_capabilities  
> Hypervisor vendor: Microsoft  
> Virtualization type: full  
> L1d cache: 768 KiB (16 instances)  
> L1i cache: 512 KiB (16 instances)  
> L2 cache: 32 MiB (16 instances)  
> L3 cache: 36 MiB (1 instance)  
> Vulnerability Gather data sampling: Not affected  
> Vulnerability Itlb multihit: Not affected  
> Vulnerability L1tf: Not affected  
> Vulnerability Mds: Not affected  
> Vulnerability Meltdown: Not affected  
> Vulnerability Mmio stale data: Unknown: No mitigations  
> Vulnerability Reg file data sampling: Vulnerable: No microcode  
> Vulnerability Retbleed: Mitigation; Enhanced IBRS  
> Vulnerability Spec rstack overflow: Not affected  
> Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp  
> Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and \_\_user pointer sanitization  
> Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI\_DIS\_S  
> Vulnerability Srbds: Not affected  
> Vulnerability Tsx async abort: Not affected

just curious what could be the cause and how I can increase number of threads to 32 for maximum performance. any advice is greatly apreciated.

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [March 4, 2025, 9:38am UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-error-in-mdrun/11660/4 "2025-03-04T09:38:20Z")

</div>

I can’t access your tpr file through the link, maybe the link expired?

Could you compile a debug build and run that with “gdb” in front your gmx command line and report the stack trace gdb reports? You might need to install gdb.

---

<div class="post-metadata">

**Author:** ![roozi](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@roozi](https://gromacs.bioexcel.eu/u/roozi)\
**Post date:** [March 5, 2025, 11:09am UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-error-in-mdrun/11660/5 "2025-03-05T11:09:57Z")

</div>

Hi.  
Here is the link for the tpr file in my google drive:

> **[awh.tpr](https://drive.google.com/file/d/1eTNAYjSmlER41BKY8kM9jDN9ywD9tqi6/view?usp=sharing)**
>
> Google Drive file.

.tpr file is compiled using gromacs v2024.3 and cuda 11.7, on wsl2-Ubuntu 22.04.3 LTS  
As for debugging report by gdb, when i put in :

> gdb gmx mdrun -deffnm awh -pf pullf.xvg -px pullx.xvg -cpi awh.cpt -update gpu -nb gpu -bonded gpu -pme gpu -awh awhinit.xvg

i get teh following error msg:

> gdb: unrecognized option ‘-deffnm’

Frankly, I have not worked with gdb so do not know how to proceed  
using it.  
kind regards
