Compiling CUDA Code from the Command Line

I am trying to compile CUDA code from the command line using the syntax:

nvcc -c MyFile.cu -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin"

      

I have CUDA Toolkit version 5.5 installed as well as Visual C ++ 2010 Express. I don't have a full version of Visual Studio.

I am getting the following error:

nvcc : fatal error : nvcc cannot find a supported version of Microsoft Visual Studio. Only the versions 2008, 2010, and 2012 are supported

      

I've seen a use case for people getting VC2010 Express compilation with CUDA Toolkit 5.0, for example in this thread

https://devtalk.nvidia.com/default/topic/535527/?comment=3762165

So I can't figure out what the critical difference would be, simply because it is CUDA 5.5 and not 5.0. Does it matter that this is VC Express and not VC Professional? Why does this matter when it comes to compilation? Do Pro and Express really use very different compilers?

+2


a source to share


1 answer


I can't leave comments yet and I don't know if this is the correct answer as I don't have the 2010 express. So in the interest of helping, I'll try to answer.

I can provide you with the start of my compilation line, which is slightly different from yours:

set CUDAFE_FLAGS=--sdk_dir "C:\Program Files (x86)\Windows Kits\8.0\"
"C:\_work\API\CUDA\bin\nvcc.exe" --use-local-env --cl-version 2012 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64"        --keep-dir x64\Prod -maxrregcount=0  --machine 64 

      

From this I expect you to change the path to yours as well as the cl version and



"C:\_work\API\CUDA\bin\nvcc.exe" --use-local-env --cl-version 2010 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.exe" --machine 32

      

Please note that I tried to change it to 32-bit. I am assuming this is what you are using.

Greetings

+4


a source







All Articles