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.