VS2017 NextGen Debug: not hitting bp

Hi,

I’m trying to debug kernels in my dll project (which uses cuda runtime).

I’m able to debug the cuda samples on my GTX 1080ti using NextGen debug (cuda 9.1).

However when trying to debug my own dll kernels the breakpoints in the kernels are never getting stopped at.

What I see in the VS2017 community output window is:
Module loaded. 000001e2a01fec10 Symbolics: false
Module loaded. 000001e2a01fce10 Symbolics: false
Module loaded. 000001e2a01fcf10 Symbolics: false
Module loaded. 000001e2a01fd110 Symbolics: false
Module loaded. 000001e2a01fd210 Symbolics: false
Module loaded. 000001e2a01fee10 Symbolics: false
Module loaded. 000001e2a01fd710 Symbolics: false
Module loaded. 000001e2a01fd910 Symbolics: false
Module loaded. 000001e2a01fda10 Symbolics: false

which means that the kernels are loaded but their symbols are not.

Of course I’m using -g and -G to generate debug info in the cu files. and the DLL pdb file is in the binary output directory.

btw, when running the cuda samples I get the message:
Module loaded. 0000026bf980e900 Symbolics: true

and then the debugger stops at bp in the kernels of the samples.

which makes me think that the problem is with the symbols.

Do anyone has clue how can I solve this issue and get Nsight debugger to stop at breakpoints in kernels?

It feels like the -g is missing. Could you be using an exe compile without the -g?
Use -ccbin to specify the output dir ( [url]https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#options-for-specifying-compilation-phase[/url] ).

If you still don’t have any luck, please send us a small example with your exe.

I’m using -g flag in the cu files that inside the DLL.
I’m using this dll from a console application (exe) that is not linking directly with cuda.

This is the compilation line for the .cu files in the dll:

(Approximate command-line. Settings inherited from host are not visible below.)

(Please see the output window after a build for the full command-line)

Driver API (NVCC Compilation Type is .cubin, .gpu, or .ptx)

set CUDAFE_FLAGS=–sdk_dir "C:\Program Files (x86)\Windows Kits\8.1"
“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin\nvcc.exe” --use-local-env --cl-version 2017 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x64” -x cu -rdc=true -G -lineinfo --keep-dir C:\Z2Master\build\obj\Debug\FPP -maxrregcount=0 --machine 64 --compile -cudart shared -o C:\Z2Master\build\obj\Debug\FPP\dummy_node.cu.obj “C:\Z2Master\FPP_Module\FPP\FPP\nodes\dummy_node.cu”

Runtime API (NVCC Compilation Type is hybrid object or .c file)

set CUDAFE_FLAGS=–sdk_dir "C:\Program Files (x86)\Windows Kits\8.1"
“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin\nvcc.exe” --use-local-env --cl-version 2017 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x64” -x cu -rdc=true -G -lineinfo --keep-dir C:\Z2Master\build\obj\Debug\FPP -maxrregcount=0 --machine 64 --compile -cudart shared -g -DWIN32 -Xcompiler "/EHsc /nologo /Od /FS /Zi " -o C:\Z2Master\build\obj\Debug\FPP\dummy_node.cu.obj “C:\Z2Master\FPP_Module\FPP\FPP\nodes\dummy_node.cu”

No hints on what this issue can be?

it’s strange that with the same project settings I succeed in debugging the cppIntegration sample (even after converting it to a dll and calling it from exe) but I cannot stop at kernels when debugging my own dll lib.

Do you have the Pascal arch & codegen set?
In Visual Studio they are under the Project Setting > CUDA C/C++ > Device > Code Generation
In nvcc, you can specify:
-gencode=arch=compute_60,code="sm_60,compute_60"

See [url]https://docs.nvidia.com/cuda/pascal-compatibility-guide/index.html#building-applications-with-pascal-support[/url]

Yes I have codegen set, and I’m running on GTX 1080ti so I have pascal arch. Still no luck tough

Yes I have codegen set, and I’m running on GTX 1080ti so I have pascal arch. Still no luck tough