Error: All CUDA devices are used for X11 and cannot be used while debugging

Hi all… I am trying to debug a program using cuda-gdb. When i am running the executable through cuda-gdb, Its showing Error: All CUDA devices are used for X11 and cannot be used while debugging.

Can any one please explain whats the error about is ? What is X11? Please briefly explain about error and whats the solution for solving this problem?

You can’t debug CUDA application on a GPU that is running a interactive desktop(X server) session. You can stop the X server and debug in console mode instead. Or you can ssh from a remote system. If you have 2 GPUs then you can also set env variable CUDA_VISIBLE_DEVICES equal to 0 or 1 for the index of the non-X running GPU. Please refer to CUDA 4.0 cuda-gdb user guide.