cuda-gdb Error:

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:

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

Wrong code:

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

Right code:

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

Wrong code:

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