Debugging CUDA Kernel Sobel Filter Project from SDK

I am trying to step into the following call from the SobelFilter.cu from the SDK.

        SobelCopyImage<<<ih, 384>>>(odata, iw, iw, ih );

I get the following error message from Visual Studio:

“There is no source code available for the current location.”

What is going on here?

Is Visual Studio being tripped up because the actual function is in a file that is a #include?
#include “SobelFilter_kernels.cu”

Make sure you run the project in EmuDebug (Emulation Debug) mode and then set a breakpoint inside the kernel (the SobelCopyImage function).

OK I am able to hit a break point set inside SobelCopyImage. I am still unable to step into the function.

Thanks.

I don’t think it’s possible to step into the function but setting a breakpoint inside the function is equivalent.

Visual Studio doesn’t know what to do with this weird <<< >>> call.

If you set a breakpoint inside your kernel function and compile your code in “EmuDebug”-Mode you can easily step into the code.
Works just fine.

When i set the brake point inside the kernel, i can enter it, but I can’t see what’s the result of the execution. The debugger shows me how he goes through the code, but I can’t see any of the results of the execution. I mean if I write a=5; I usually see in the lower left corner that the variable a got the value 5, but here I don’t see anything. Can anybody help me with this problem?

I don’t think autos work in -deviceemu debugging in VS2005, but actually adding watched variables is fine.

Same problem - can’t enter a global , i.e. kernel, function. Even if I put a break in it - once I press F5 the breakpoint goes inactive and VS says this line won’t be hit 'cause there’s no code associated for this line… even if this global is in the same file as it’s host launcher function (one containing the foo<<<>>> (…) call) - it won’t work. :(
Yes, of course I set -deviceemu, and -debug info generation, disabled optimization in both VC++ and NVCC compilers…

I have a stong feeling that this is because of a wrong cuda build rule. I mean - the CUDA property branch in project settings differs greatly depending on which custom build rule is used, and at first (with Wizard’s build rule) - it didn’t break inside any .cu file at all. Now (with CUDA build rule v3.0.14 from SDK_v3.1_x32) it does debug host functions in .cu, but not kernels…
So - wich cuda build rule is correct? And what type of output should be generated for cuda files (.gpu, .cudabin, .cuda, .ptx, .cu.c or which?)

Same problem - can’t enter a global , i.e. kernel, function. Even if I put a break in it - once I press F5 the breakpoint goes inactive and VS says this line won’t be hit 'cause there’s no code associated for this line… even if this global is in the same file as it’s host launcher function (one containing the foo<<<>>> (…) call) - it won’t work. :(
Yes, of course I set -deviceemu, and -debug info generation, disabled optimization in both VC++ and NVCC compilers…

I have a stong feeling that this is because of a wrong cuda build rule. I mean - the CUDA property branch in project settings differs greatly depending on which custom build rule is used, and at first (with Wizard’s build rule) - it didn’t break inside any .cu file at all. Now (with CUDA build rule v3.0.14 from SDK_v3.1_x32) it does debug host functions in .cu, but not kernels…
So - wich cuda build rule is correct? And what type of output should be generated for cuda files (.gpu, .cudabin, .cuda, .ptx, .cu.c or which?)