Hi,
I’ve ran into problem that “Versbose PTXAR Output” option in cuda configuration property pages, when set to Yes, doesn’t actually print anything in visual studio output. Also, if you for instance pass incorrect flags to nvcc, it would print “nvcc fatal:…” on the command line, but visual studio output window doesn’t contain that message, which makes it hard to figure out what you have done wrong.
I tried this with pi_cuda example shipped with ArrayFire. On enabling “Verbose PTXAR output”, I got the following log. (This is using VS 2008), seems to me it is working fine!
1>------ Build started: Project: pi_cuda, Configuration: Release x64 ------
1>Compiling with CUDA Build Rule…
1>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe” -ccbin “d:\MSVS2008\VC\bin” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include" -I"./" -I"…/…/common/inc" -I"…/…/…/shared/inc" -I"…..\include" -Xcompiler "/EHsc /W3 /nologo /Od /Zi /MT " -maxrregcount=32 --ptxas-options=-v -gencode=arch=compute_10,code="sm_10,compute_10" -gencode=arch=compute_20,code="sm_20,compute_20" --compile -o “x64\Release\pi_cuda.cu.obj” “d:\Downloads\arrayfire\examples\pi\pi_cuda.cu”
1>pi_cuda.cu
1>tmpxft_000017dc_00000000-6_pi_cuda.compute_10.cudafe1.gpu
1>tmpxft_000017dc_00000000-10_pi_cuda.compute_10.cudafe2.gpu
1>pi_cuda.cu
1>tmpxft_000017dc_00000000-3_pi_cuda.compute_20.cudafe1.gpu
1>tmpxft_000017dc_00000000-14_pi_cuda.compute_20.cudafe2.gpu
1>pi_cuda.cu
1>pi_cuda.cu
1>ptxas info : Compiling entry function ‘Z11test_insideiPfS_S’ for ‘sm_10’
1>ptxas info : Used 3 registers, 32+16 bytes smem, 4 bytes cmem[1]
1>ptxas info : Compiling entry function ‘Z11test_insideiPfS_S’ for ‘sm_20’
1>ptxas info : Function properties for Z11test_insideiPfS_S
1> 0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads 1>ptxas info : Used 8 registers, 64 bytes cmem[0], 8 bytes cmem[16]
1>tmpxft_000017dc_00000000-6_pi_cuda.compute_10.cudafe1.cpp
1>tmpxft_000017dc_00000000-23_pi_cuda.compute_10.ii
1>Linking…
1>LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance
1>Embedding manifest…
1>Build log was saved at “file://d:\Downloads\arrayfire\examples\pi\x64\Release\BuildLog.htm”
1>pi_cuda - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
I just found that when the build process completes, it generates a text file in arrayfire/examples/pi/x64/ directory. This is building ArrayFire pi_cuda_vs2010 example with VS2010. This contains PTXAS info. Here is the build log from pi_cuda_vs2010.txt
Build started 2/4/2012 7:42:23 PM.
1>Project “D:\Downloads\arrayfire\examples\pi\pi_cuda_vs2010.vcxproj” on node 2 (build target(s)).
1>InitializeBuildStatus:
Creating “x64\pi_cuda.unsuccessfulbuild” because “AlwaysCreate” was specified.
AddCudaCompileDeps:
d:\MSVS2010\VC\bin\x86_amd64\cl.exe /E /nologo /showIncludes /TP /I…/…/include /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin" /I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include" /I. /FIcuda_runtime.h /c D:\Downloads\arrayfire\examples\pi\pi_cuda.cu
AddCudaCompilePropsDeps:
Found “CudaToolkitCustomDir”.
Found “AdditionalDeps”.
Found “CompileOut”.
Found “Include”.
Found “Keep”.
Found “KeepDir”.
Found “NvccCompilation”.
Found “NvccPath”.
Found “RequiredIncludes”.
Found “TargetMachinePlatform”.
Found “CInterleavedPTX”.
Found “CodeGeneration”.
Found “GPUDebugInfo”.
Found “MaxRegCount”.
Found “PtxAsOptionV”.
Found “Defines”.
Found “Emulation”.
Found “HostDebugInfo”.
Found “FastMath”.
Found “Optimization”.
Found “Runtime”.
Found “RuntimeChecks”.
Found “TypeInfo”.
Found “Warning”.
Found “AdditionalOptions”.
Found “CommandLineTemplate”.
CudaBuild:
Compiling CUDA source file pi_cuda.cu…
cmd.exe /C “C:\Users\temp\AppData\Local\Temp\cd5f3487fcdc4ccaae1d6df8af225833.cmd”
“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe” -gencode=arch=compute_10,code="sm_10,compute_10" -gencode=arch=compute_20,code="sm_20,compute_20" --use-local-env --cl-version 2010 -ccbin “d:\MSVS2010\VC\bin\x86_amd64” -I"…/…/include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include" --keep-dir “x64\Release” -maxrregcount=0 --ptxas-options=-v --machine 64 --compile -Xcompiler "/EHsc /nologo /Od /Zi /MT " -o “x64\pi_cuda.cu.obj” “D:\Downloads\arrayfire\examples\pi\pi_cuda.cu”