So I’ve found CUDA debugging to be… infuriating at best. cuda-gdb crashes every time for me, and I’ve never been able to get device printf() to work. This makes it nearly impossible to debug kernel launch failures. Does anybody have solutions to these problems?
I’m running the most recent CUDA 3.2 release with the most recent dev drivers on Fedora 14 with a GTX 470. These problems have happened to me on every machine I’ve tried to write CUDA code on (not just this one).
Any time I try to run my CUDA programs in cuda-gdb, it just crashes with a BACKTRACE message, like so:
[bsomers@tyrol] > cuda-gdb hasteD
NVIDIA (R) CUDA Debugger
3.2 release
Portions Copyright (C) 2008-2010 NVIDIA Corporation
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(cuda-gdb) r scene.lua
Starting program: /home/bsomers/haste/hasteD scene.lua
BFD: /lib64/libc.so.6: invalid relocation type 37
BFD: BFD 2.17.50 assertion fail /home/buildmeister/build/rel/gpgpu/toolkit/r3.2/debugger/cuda-gdb/bfd/elf64-x86-64.c:259
BFD: /lib64/libc.so.6: invalid relocation type 37
BFD: BFD 2.17.50 assertion fail /home/buildmeister/build/rel/gpgpu/toolkit/r3.2/debugger/cuda-gdb/bfd/elf64-x86-64.c:259
[Thread debugging using libthread_db enabled]
[New process 15781]
Loading scene file...
Searching for CUDA devices...
[New Thread 139811079239488 (LWP 15781)]
[0] GeForce GTX 470 (2.0, 448 cores, 1.22 GHz, 1279.19 MB)
Launching 1 control threads...
[New Thread 139811067307776 (LWP 15785)]
[0] Initializing device...
BACKTRACE (4 frames):
cuda-gdb[0x45a5ae]
/lib64/libc.so.6[0x333b834100]
cuda-gdb[0x528976]
cuda-gdb[0x5289bd]
In addition, when I try to compile with printf’s in my device code, I can’t seem to figure out which files I need to include. Where is the device printf defined?
Thanks for your help.