Saturday, April 30, 2011 4:27 AM
I'm having trouble getting CUDA to compile using Visual C++ 2010 Express. I am using:
- CUDA 4.0 (64 bit)
- Windows SDK 7.1
- Windows 7
I believe I have everything correctly set for compiling 64 bit. I'm trying to compile one of the CUDA examples provided with CUDA 4.0. The error I get is:
nvcc fatal : '-ccbin': expected a number
The command line that it tries to execute is:
C:\Documents and Settings\All Users\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\bandwidthTest>"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" --keep-dir "x64\Release" -maxrregcount=32 --machine 64 --compile -Xcompiler "/EHsc /nologo /Od /Zi /MD " -o "x64/Release/bandwidthTest.cu.obj" "C:\Documents and Settings\All Users\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\bandwidthTest\bandwidthTest.cu"
The key issue lies in that the flag --cl-version has no argument after it, so I guess it interprets the next flag (ccbin) as the argument. Note that I have Platform Toolset set to Windows7.1SDK. If I should change this to, say v90, then the flag does have an argument, i.e., --cl-version 2008
Any idea why this flag is not getting an argument, and what I can do to make it work?
- Moved by Jesse JiangMicrosoft Contingent Staff Tuesday, May 03, 2011 8:11 AM (From:Visual C++ Express Edition)
Saturday, April 30, 2011 11:16 PMThis issue is better taken up with nvidia. The nvcc application is not a VC application and from the command line it belongs to nvidia.
This is a signature
Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
Visit my (not very good) blog at
Tuesday, May 03, 2011 8:11 AM
I think your issue should be raised in the NVIDIA Developer Forums. I believe they will know more information of this issue than us, and I will move this one to off-topic.
Thanks for your understanding,
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Thursday, July 14, 2011 1:25 PM
Open the file C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 4.0.props, and edit following lines;
<CudaClVersion Condition="'$(PlatformToolset)' == 'v90'">2008</CudaClVersion>
<CudaClVersion Condition="'$(PlatformToolset)' == 'v100'">2010</CudaClVersion>