I am working on CUDA (7.0) project using Visual Studio 2013. The project is 64bit. I am using driver API and need to load module from ptx or cubin file.But I can't find the file. In VS I go Properties->CUDA C/C++ ->Common->NVCC Compilation Type ,change it to -cubin or ptx .the compiler finishes ok but I can't find that file.I only can see kernel.cu.obj and kernel.cu.cache files in output debug directory.What can be wrong here?
UPDATE:
If I go to Properties->CUDA C/C++ ->Common->Keep Preprocessed Files and set YES.Then I see .ptx,and other intermediate stuff.But as far as I understand this option is not mandatory to get .ptx?Also demo CUDA SDK projects like "matrixMulDrv" spitr ptx with that option off.I can't figure out where is the difference.
Here is matrixMulDrv project compile command:
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.0\0_Simple\matrixMulDrv>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\bin\nvcc.exe" -gencode=arch=compute_20,code=\"compute_20,compute_20\" --use-local-env --cl-version 2013 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64" -I./ -I../../common/inc -I./ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0/include" -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 -ptx -cudart static -Xcompiler "/wd 4819" -o data/matrixMul_kernel64.ptx "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.0\0_Simple\matrixMulDrv\matrixMul_kernel.cu"
And here is my project CUDA kernel compile command:
E:\Documents\visual studio 2012\Projects\ProjectName\ProjectName>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\bin\nvcc.exe" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env --cl-version 2013 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64" -I"E:\Documents\visual studio 2012\Projects\XXXXXX\XXXXX\XXXXX\include" -I"E:\Documents\visual studio 2012\Projects\XXXXX\XXXXX\XXXXX\include" -I"E:\Documents\visual studio 2012\Projects\XXXXXXXX\XXXXXXX\XXXXXX\include" -I"E:\Documents\visual studio 2012\Projects\XXXXXXX\XXXXXX\XXXXXXX\include" -I"E:\Documents\visual studio 2012\Projects\ProjectName\ProjectName\include" -I"E:\Documents\visual studio 2012\Projects\XXXXXXX\XXXXXX\XXXXXX\include" -I"E:\Documents\visual studio 2012\Projects\XXXXXX\XXXXXX\XXXXXX\include" -I"E:\Documents\visual studio 2012\Projects\XXXXXXX\XXXXXX\XXXXXX\include" -I"E:\Documents\visual studio 2012\Projects\XXXXXX\XXXXXX\XXXXXX\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0/include" -I"C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.0\common\inc" -I"E:\Documents\visual studio 2012\Projects\ProjectName\ProjectName\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g
-DWIN32 -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MTd " -o x64\Debug\skernel.cu.obj "E:\Documents\visual studio 2012\Projects\ProjectName\ProjectName\src\skernel.cu"
It is possible to see that matrixMulDrv project is set to compile .ptx with this line data/matrixMul_kernel64.ptx while in my project I have -o x64\Debug\skernel.cu.obj .But I have the same CUDA compiler settings on both projects.