Compilation Problems with CUDA 4.0 & Visual C++ Express 2010

I’m at my wits end trying to compile 64-bit versions of the sample projects that come with the CUDA SDK with Visual C++ Express 2010. For example, when trying to compile the bandwidthTest project, I receive the following error:

3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 4.0.targets(352,9): error MSB3721: The command ““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 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64” -I”./" -I"…/…/common/inc" -I"…/…/…/shared/inc" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include" -G0 --keep-dir “x64\Debug” -maxrregcount=0 --machine 64 --compile -D_NEXUS_DEBUG -g -Xcompiler “/EHsc /nologo /Od /Zi /MTd " -o “x64/Debug/” “C:\Users\barry05\AppData\Local\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\bandwidthTest\”” exited with code -1.

I’ve done some searching online and it seems I’m certainly not alone in encountering such problems. Incidentally, 32-bit compilation works fine.

I’ve downloaded and installed Visual C++ Express 2010, CUDA Toolkit 4.0.17 (64-bit), CUDA SDK 4.0.19 (64-bit) and Windows SDK 7.1 (64-bit) in that order. I’ve uninstalled/re-installed everything several times now and still no luck. I must confess that I am relatively new to Visual C++ as well as CUDA, so it’s quite possible I’m missing something very simple/stupid.

I am experiencing another problem with Visual C++ 2010 which may or may not be related. When I attempt Visual Studio registration with the Windows SDK Configuration Tool, I receive the following error:

Neither Visual Studio 2005 nor Visual C++ Express is installed on this system. You must install one of these products and rerun this application.

Thanks in advance for any assistance.

Its been a very long time since I’ve compiled anything on windows. But when I did, VS Express 2005 only supported 32-bit compiles - you needed the full VS to compile 64-bit. You might check if this is still the case. If you are a student, take advantage of Dreamspark:

Not by default, no, but it can be configured to target 64-bit platforms:

I’ve found the solution (elsewhere on this forum)! I don’t believe it - I’ve been trying to get this to work for about 2 weeks now and all it took was a simple edit of the props file (CUDA 4.0.props). Change the following…

<CudaClVersion Condition="'$(PlatformToolset)' == 'v90'">2008</CudaClVersion>

<CudaClVersion Condition="'$(PlatformToolset)' == 'v100'">2010</CudaClVersion>

…to the following…


    <CudaClVersion Condition="'$(PlatformToolset)' == 'v90'">2008</CudaClVersion>

    <CudaClVersion Condition="'$(PlatformToolset)' == 'v100'">2010</CudaClVersion>



…and you’re good to go!