As I did not get any help in the Nvidia forums (see my post at the bottom of the thread), and it seems I am not the only one struggeling with similar problems, I will give it a try here.
I tried to compile the Cuda SDK 4.0 examples as well as following the very nice tutorial by Ade Miller. But compiling the ".cu" file won't work.
This is the (exemplary) command the compiler invokes:
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe"
-gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env
--cl-version 2010 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC bin\x86_amd64"
-I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include" -G0
--keep-dir "x64\Debug" -maxrregcount=0 --machine 64 --compile -D_NEXUS_开发者_如何学CDEBUG
-g -Xcompiler "/EHsc /nologo /Od /Zi /MDd " -o "x64\Debug\Hello.cu.obj"
"D:\Code\CUDA\Test_Cuda_4_0\Test_Cuda_4_0\Hello.cu"
And this is the strange error message I always get.
nvcc fatal : Compiler 'cl' in PATH different than the one specified with -ccbin
EDIT: To be a bit more precise: Visual Studio just tells me the command did not succeed ("exit code -1") -> to see this error message I have to invoke the command by myself in the command line.
1) Why should nvcc
care about the path in the environment variable differing from the one specified with the command line option? If it would care, wouldn't this make the command line option completely useless?
2) How to fix ;) ?
I use Win7 64Bit, VS2010 Prof SP1, and the following nvidia versions: cudatoolkit_4.0.17_win_64 devdriver_4.0_winvista-win7_64_270.81_general gpucomputingsdk_4.0.19_win_64
Many thanks for your help!
try using the conventional method to start writing a CUDA program, as given in Getting Started guide(Copy the sample). To solve the above problem you have to add it as an environment variable. But since the SDK samples are already linked, they don't give problems.
I had a similar problem. previously i copied cl.exe
in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin
for test several parameters with nvcc.exe
and forget delete this file from this directory. i removed this file and everything is OK. purpose of PATH
for my problem in really was for this path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin
and wasn't PATH
in Environment variables.
精彩评论