Starting with R24.2, I’ve noticed that cuda-gdb cannot debug CUDA applications unless you turn on set cuda software_preemption on. This is true even if you’re not running an X server, which used to be the typical condition requiring it.
The X server is disabled with commands like this:
systemctl disable lightdm
systemctl stop lightdm
In R24.2, the response is:
/usr/local/cuda/bin/cuda-gdb $Ccuda/vectorAdd
NVIDIA (R) CUDA Debugger
8.0 release
Portions Copyright (C) 2007-2016 NVIDIA Corporation
GNU gdb (GDB) 7.6.2
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-elf-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /coyote/coy1/todd/test/cuda/vectorAdd...done.
(cuda-gdb) r
Starting program: /coy1/todd/test/cuda/vectorAdd
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
fatal: All CUDA devices are used for display and cannot be used while debugging. (error code = CUDBG_ERROR_ALL_DEVICES_WATCHDOGGED(0x18)
(cuda-gdb)
I see this with any CUDA application that I try.
You can make some progress by turning software_preemption. But, as I understand it, that comes with pretty heavy overhead. And it disables features, like attach.