# cuda-gdb Error:

**URL:** <https://forums.developer.nvidia.com/t/cuda-gdb-error/71842>\
**Category:** CUDA-GDB\
**Created:** [March 22, 2019, 3:07am UTC](https://forums.developer.nvidia.com/t/cuda-gdb-error/71842 "2019-03-22T03:07:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangzhenkang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@zhangzhenkang](https://forums.developer.nvidia.com/u/zhangzhenkang)\
**Post date:** [March 22, 2019, 3:07am UTC](https://forums.developer.nvidia.com/t/cuda-gdb-error/71842/1 "2019-03-22T03:07:35Z")

</div>

Hello, everyone:  
I got an error, when i using the command **‘cuda-gdb’** in my terminal, i got the **python error** , just for there are serveral versions in my compute, after fixed the problem ,running the program is OK ,but Debug not work, and i got the error :

**Error: Failed to suspend device for CUDA device0, error=CUDBG\_ERROR\_INVALID\_MEMORY\_SEGMENT(0x7).**

**I can using Remote Debug to debug the program in another compute with GPU, and no error happened.**

here are the code i am using:  
**Right code:**

```auto
int w = 3* 1*1024*1024;
int n = 1;
add<<< w/n, n>>>(1,2,dev_addr);

```

**Wrong code:**

```auto
int w = 3* 1*1024*1024 + 1;
int n = 1;
add<<< w/n, n>>>(1,2,dev_addr)

```

**Right code:**

```auto
int w = 4* 1*1024*1024;
int n = 256;
add<<< w/n, n>>>(1,2,dev_addr)

```

**Wrong code:**

```auto
int w = 4* 1*1024*1024 + 256;
int n = 256;
add<<< w/n, n>>>(1,2,dev_addr)

```

**Here are the environment of mine:**  
**OS system:** ubuntu16.04  
**CUDA Toolkit:** 10.0  
**Python Version:** 2.7.16  
**Nsight Version:** 10.0

I also using **cuda9.2** cuda-gdb in my system, **the error happened too**

**I don’t know what happened to cuda-gdb, or is there anyting wrong about my setting? or Python? thanks a alot**
