# I get an "illegal memory access was encountered" error when using GMX\_ENABLE\_DIRECT\_GPU\_COMM=1

**URL:** <https://gromacs.bioexcel.eu/t/i-get-an-illegal-memory-access-was-encountered-error-when-using-gmx-enable-direct-gpu-comm-1/7438>\
**Category:** User discussions\
**Created:** [October 19, 2023, 6:44pm UTC](https://gromacs.bioexcel.eu/t/i-get-an-illegal-memory-access-was-encountered-error-when-using-gmx-enable-direct-gpu-comm-1/7438 "2023-10-19T18:44:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfredo](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@alfredo](https://gromacs.bioexcel.eu/u/alfredo)\
**Post date:** [October 19, 2023, 6:44pm UTC](https://gromacs.bioexcel.eu/t/i-get-an-illegal-memory-access-was-encountered-error-when-using-gmx-enable-direct-gpu-comm-1/7438/1 "2023-10-19T18:44:04Z")

</div>

GROMACS version: 2023.2  
GROMACS modification: No  
Command line:  
Hi,  
I compiled that version of gromacs with gcc10.2 (mpi off). cuda version is 11.60. I am trying to run in a single node with 2 x AMD CPU’s, 32 cores total, and 2 RTX8000’s. When I run the following command without using the environment variable GMX\_ENABLE\_DIRECT\_GPU\_COMM=1, it runs fine.  
gmx mdrun -s topol.tpr -pin on -ntomp 8 -ntmpi 4 -pme gpu -npme 1 -gpu\_id 01 -nb gpu -bonded gpu -update gpu  
But when I add the above environment command I get the following messages:

Reading file topol.tpr, VERSION 2023.2 (single precision)  
On host n0015 2 GPUs selected for this run.  
Mapping of GPU IDs to the 4 GPU tasks in the 4 ranks on this node:  
PP:0,PP:0,PP:1,PME:1  
PP tasks will do (non-perturbed) short-ranged and most bonded interactions on the GPU  
PP task will update and constrain coordinates on the GPU  
PME tasks will do all aspects on the GPU  
GPU direct communication will be used between MPI ranks.  
Using 4 MPI threads  
Using 8 OpenMP threads per tMPI thread

starting mdrun ‘Title in water’  
50000 steps, 100.0 ps.

* * *

Program: gmx mdrun, version 2023.2

* * *

Program: gmx mdrun, version 2023.2  
Source file: src/gromacs/gpu\_utils/device\_stream.cu (line 100)  
Function: DeviceStream::synchronize() const::\<lambda()\>  
MPI rank: 0 (out of 4)

Assertion failed:  
Condition: stat == cudaSuccess  
Source file: src/gromacs/gpu\_utils/device\_stream.cu (line 100)  
cudaStreamSynchronize failed. CUDA error #700 (cudaErrorIllegalAddress): an  
illegal memory access was encountered.

The error message seems too terse to pinpoint the source of the problem. Does anyone has an idea what the problem could be?  
Thanks  
Alfredo

---

<div class="post-metadata">

**Author:** ![asita](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@asita](https://gromacs.bioexcel.eu/u/asita)\
**Post date:** [February 21, 2025, 11:31am UTC](https://gromacs.bioexcel.eu/t/i-get-an-illegal-memory-access-was-encountered-error-when-using-gmx-enable-direct-gpu-comm-1/7438/2 "2025-02-21T11:31:39Z")

</div>

Hi, I am facing the same error. Did you end up finding a solution?
