I’m trying to use Visual Studio 2010 with CUDA 4.0RC2. My application compiles fine but when I try to use --keep options both in additional command line parameter or build properties it produces compile error:
1>Release/gpu.cudafe1.stub.c(1): fatal error C1083: Cannot open include file: 'Release/gpu.cudafe1.stub.c': No such file or directory
The file gpu.cudafe1.stub.c does exists in Release directory. The command line is:
I played with this command in cmd.exe and found out that the error goes away if -I. option is added. After that my program compiles if --keep is set in build properties but still fails when --keep is set in additional command line parameters:
LINK : warning LNK4044: unrecognized option '/-keep'; ignored
1>MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
The same happens if I try to add any other options. I think that nvcc driver shouldn’t pass his options to the linker.
The reason I’m trying to use the nvcc -keep option is so I can debug the Cuda kernel in Visual Studio. Currently VS is reporting it is unable to find the device compiled stub and is only able to show the disassembled code which makes debugging the kernel a real pain!!!