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

17,428

Solution 1

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

Also, you might want to take a look at this topic on Nvidia Forum

Solution 2

Include this line

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

in

C:\CUDA\bin64\nvcc.profile

Solution 3

With CUDA v6.0, having an older version of Visual Studio (I'm using 2010) is still required, but the other solutions did not 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 needed this argument to prevent nvcc from finding the newer (sadly incompatible) version of cl.exe

Solution 4

I was trying to get CUDA 6.5 working with VS 2010 express. After uninstalling VS 2010 express, installing Windows SDK 7.1 and reinstalling VS 2010 express, setting Windows SDK 7.1 as tool set, 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 tried the appropriate flags in the command line first.

This link was very helpful

Share:
17,428
Jack Lloyd
Author by

Jack Lloyd

Crypto, security, chainsaws

Updated on June 16, 2022

Comments

  • Jack Lloyd
    Jack Lloyd almost 2 years

    I'm running Windows 7 Pro x64 on a Core i5 with a NVIDIA 3100m, which is CUDA compatible.

    I've tried installing both the 32-bit and 64-bit CUDA toolkits from NVIDIA, unfortunately from with either of them I cannot compile anything; nvcc says "cannot find a supported cl version. Only MSVC 8.0 and MSVC 9.0 are supported".

    I have the x86 and x86-64 compilers installed via the Windows 7 SDK (compiler version 15.00.30729.01 for both arches). Both compilers are operating correctly; I've built and tested C and C++ code using them. I've tried running nvcc from command shells set up for both 32 bit and 64 bit compilation, and using the -ccbin command line option to nvcc to point it at the Visual C++ install directory.

    What is the right way of handling this setup? Is there some way I make nvcc be more verbose about what is going on? The -v flag isn't terrible helpful. Ideally some way to make it show what it is finding versus what it's expecting to find. Will this work better if I install Visual C++ Express instead? Or is only a commercial version of VC++ supported for use with CUDA?