Nsight not hitting breakpoint in cmake project

I’m trying to build a simple sample project in cmake that supports debugging with Nsight Visual Studio edition 4.6.

My CMake is as follows:

cmake_minimum_required(VERSION 2.8)
find_package(CUDA REQUIRED)
set(CUDA_NVCC_FLAGS “-gencode arch=compute_35,code=sm_35;-maxrregcount=0;-G;-g;-lineinfo”)
SET(CUDA_VERBOSE_BUILD ON)
cuda_add_executable(test test.cpp kmeans.hpp kmeans.cpp kmeans.cuh kmeans.cu)

Which generates the following compile command:
“C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.0/bin/nvcc.exe” E:/code/cudaKmeans/kmeans.cu -c -o E:/code/cudaKmeans/build/CMakeFiles/main.dir//Debug/main_generated_kmeans.cu.obj
-ccbin “C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin” -m64 -Xcompiler ,"/DWIN32","/D_WINDOWS","/W3","/GR","/EHsc","/D_DEBUG","/MDd","/Zi","/Ob0","/Od","/RTC1" -gencode arch=compute_35,code=sm_35 -maxrregcount=0 -G -g -lineinfo -DNVCC
“-IC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.0/include”

Everything compiles correctly and I can debug CPU code in visual studio. But I cannot hit a breakpoint via nsight.
What am I missing?
[EDIT] The same CMakeFile project works on Linux if I make an eclipse project.

I have the same problem, I’m wondering if you had any success in debugging your project with nsight inside visual studio.

@dtmoodie and @bootsma

Is it possible to provide us a sample CMakeFile project to reproduce this problem?
It would be helpful to investigate this issue further with having a reproduction locally. Thanks!

GPU breakpoints are working for me with CMake 3.3/VS2013/nSight 4.7, not sure why your project doesn’t work.

Here’s my CMakeLists.txt

cmake_minimum_required(VERSION 3.3)
project(testproject)

set(CUDA_VERBOSE_BUILD ON)
set(CUDA_NVCC_FLAGS_DEBUG "-g -G")

find_package(CUDA REQUIRED)
cuda_add_executable(output kernel.cu)

Hello,

I’ve since reformatted my computer for other reasons, and now my debugging is working as expected.