Basically, depending on a single compilation flag (–gpu-architecture compute_13), cuda-gdb will miss breakpoints in kernels.
I have a trivial cuda program, test.cu, with a single kernel.
test.cu:
#include <stdlib.h>
#include <stdio.h>
__global__ void kernel()
{
int a = 1;
a = a + 2;
}
int main(void)
{
kernel<<<1, 1>>>();
return 0;
}
I compile it in two different ways (one with compute capability 1.3 turned on, and one without):
nvcc -g -G test.cu -o test
nvcc -g -G --gpu-architecture compute_13 test.cu -o test_err
If I debug ‘test’ with cuda-gdb and place a breakpoint in the kernel, all is well.
If I do the same in ‘test_err’, the debugger will miss the breakpoint.
That is:
> cuda-gdb ./test
cuda-gdb> break test.cu:9
cuda-gdb> run
--- the debugger stops at the breakpoint as intended ---
cuda-gdb> q
Same thing, but with ‘test_err’:
> cuda-gdb ./test_err
cuda-gdb> break test.cu:9
cuda-gdb> run
--- the debugger goes past the breakpoint and consequently finishes execution ---
cuda-gdb> q
==================================
My system is Linux IA64 with a Tesla C1060 card in it.
> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2009 NVIDIA Corporation
Built on Thu_Jul_30_09:24:36_PDT_2009
Cuda compilation tools, release 2.3, V0.2.1221
> cuda-gdb --version
NVIDIA (R) CUDA Debugger
BETA release
Portions Copyright (C) 2008,2009 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".
> cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 190.18 Wed Jul 22 15:36:09 PDT 2009
GCC version: gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)
(Please tell me if you need more information.)
==================
Thankful for any ideas.