Why can't nvcc find my Visual C ++ installation?

I am running Windows 7 Pro x64 on a Core i5 with a CUDA compliant NVIDIA 3100m.

I tried to install the 32-bit and 64-bit CUDA tools from NVIDIA, unfortunately with none of them I can compile anything; nvcc says "Cannot find a supported cl version. Only MSVC 8.0 and MSVC 9.0 are supported."

I have x86 and x86-64 compilers installed via Windows 7 SDK (compiler version 15.00.30729.01 for both arcs). Both compilers work correctly; I've created and tested them in C and C ++. I tried to run nvcc from a command shell configured for both 32-bit and 64-bit compilation and using the -ccbin command line option for nvcc to point it in the Visual C ++ installation directory.

What's the correct way to work with this setup? Is there a way to make nvcc more detailed about what's going on? The -v flag is not terrible. The ideal is to somehow get him to show what he finds versus what he expects to find. Will this work better if I install Visual C ++ Express? Or is it just a commercial version of VC ++ supported for use with CUDA?

+2


a source to share


4 answers


It looks like you haven't installed Visual Studio 2005 or 2008, but your compiler version number indicates that it is MSVC 9.0. The easiest way to get everything working is to install Visual Studiso and I believe Express will work.



Alternatively, you can take a look at this thread on the Nvidia Forum

+2


a source


Include this line

compiler-bindir = C: \ Program Files (x86) \ Microsoft Visual Studio 9.0 \ VC \ Bin



at

C: \ CUDA \ bin64 \ nvcc.profile

+7


a source


As of CUDA v6.0, it still requires an old version of Visual Studio (I'm using 2010), but other solutions didn't work for me.

To make this work, add the following to your nvcc.profile (C: / Program Files / NVIDIA GPU Computing Toolkit / CUDA / v6.0 / bin / nvcc.profile):

CUDA_NVCC_FLAGS += --compiler-bindir = "-IE:/PROGRA~2/MICROS~2.0/VC/bin"

      

I also have VS 2013 installed and I need this argument so that nvcc doesn't find a new (sadly incompatible) version of cl.exe

+4


a source


I was trying to get CUDA 6.5 to work with VS 2010 Express. After uninstalling VS 2010 Express, installing Windows SDK 7.1 and reinstalling VS 2010 Express, installing Windows SDK 7.1 as a toolbox, etc. Nothing worked. In the end, what worked for me was to add the following to CUDA_NVCC_FLAGS:

--cl-version 2010

      

You may also need to add:

--machine 32

      

I first tried the appropriate flags on the command line.

This link was very helpful

+1


a source







All Articles