No variables during debugging

Hi there, I’ve a problem that drives me mad.

My CUDA app is not working well, so I’ve tried to compile it with -g and -deviceemu parameters.

Next I’ve tried to debug it using gdb, but when I try to print the value of one kernel local variable the gdb “say” that

No symbol "myVar" in current context.

I’ve also tried to pass the parameter -O0 to nvcc but without success. The variable still “undefined”.

Someone is able to tell me what’s up? Where I’m wrong?

Thanks for answers

System details

openSUSE 11.1 (x86_64) - Quadro FX 770m - CUDA 2.3

-g is for host debug! use -G instead (or together with -g)

I know, in fact I use also the -deviceemu parameter. Anyway I have just tried your solution and this is the result:

nvcc […] -deviceemu -g -G main.cu -> same problem

nvcc […] -deviceemu -G main.cu -> I am not able to set a breakpoint in the kernel code and also I cannot step into the execution of the kernel

Note that I don’t use cuda-gdb, but standard gdb, because the program runs on my pc and I’ve read that cuda-gdb completely blocks the execution of the video card during the debugging process.

bump

No one is able to tell me what’s up?

Post a minimal code sample that demonstrates your problem

EDIT: And makefile or equivalent

Sorry @ all
I don’t know how to reproduce my problem. It only appears in the code that I’m working on. It’s still a work in progress and I’m not allowed to publish the source code.
I can only say that it works with many local registers (ptxas says 22 during the last compile), one fixed-size three-dimensional shared memory per block and one size-variable grid of blocks.
I know that probably this is useless to catch the problem, but I can’t say anything else.

Thanks anyway