Illegal access errors only when compiling with -g -G parameters


I’m new to cuda-gdb tool. I’m working on a remote server with 3 CUDA devices, 2 K80 and 1 GTX1060.

I tried to use cuda-gdb on a reliable code but when compiling with the -g -G flags the code returns the following GPU asserts:

GPUassert: an illegal memory access was encountered ****.cu 103
GPUassert: an illegal memory access was encountered ****.cu 104

Lines 103 and 104 contain the following instructions:

gpuErrchk( cudaMallocHost(&h_channel, sizeof(float) * f_size) );
gpuErrchk( cudaMemcpy(h_channel, d_channel, sizeof(float) * f_size, cudaMemcpyDeviceToHost) );

It worth noting that without the -g -G flags the code perfectly works.

Any idea?

Thank you in advance

Hi, CudaCrunch

This is cuda programming issue, suggest you post the question under

If possible, plesae provide the minor code that can reproduce the issue. Thanks!

Hi veraj,

Thank you for your answer. I’m not sure this is a cuda programming issue because the code perfectly works if not using cuda-gdb. I suspect the issue is related to how cuda-gdb handles multiple GPUs and X11.