Why is my compiler not recognized?

I tried compiling with

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

I verified that cl.exe does reside in the path designated with -ccbin. However, I receive this error message,

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

But isn’t version 10.0 the same as 2010? I will mention that this is an Express version of Visual Studio. Does that matter? I know that Nsight doesn’t support the Express version, but does this incompatibility extend to nvcc as well?

I think you are making this more complicated than it needs to be.

This video series walks you through the process for setting up Visual Studio and CUDA:

https://www.youtube.com/watch?v=rbHURDt2dcQ

I suppose I should have mentioned that I’m running CUDA 5.5, Windows 7, 64 bit. This link appears to report the same problem that I am having

http://stackoverflow.com/questions/19140503/clean-error-with-cuda-5-5-in-visual-studio-2010-express/19142535#19142535

and seems to confirm that CUDA 5.5 is not compatible with Visual Studio 2010 Express.

Can anyone confirm whether this incompatibility is only in version 5.5? Are there earlier versions that are definitely compatible with VS2010 Express?

If you are a student, you can download the VS2010 or VS2012 Professional for free here: http://www.dreamspark.com

I believe there are ways to get VS Express to work with CUDA but it is not entirely straight-forward, which is why I advised the former.

OK. Another update.

I have just realized that I do not have a full version of Visual Studio installed. I only have Visual C++ 2010 Express installed.

However, I have seen precedent of people getting VC2010 Express working with CUDA 5.0, e.g., this thread

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

Therefore, I cannot understand why I cannot use the VC2010 Express compiler to compile from the command line, as in

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

Is it just that it’s version 5.5 rather than 5.0? Why would it make a difference whether it’s Pro or Express where compiling is concerned? Do Pro and Express really use different compilers?

Express version is missing 64-bit compilation tools at the very least, do not recall any other differences.

I tried downgrading to CUDA Toolkit 5.0 and now I get a different error.

nvcc : fatal error : Visual Studio configuration file '(null)' could not be found for installation at 'c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/../..'

I also upgraded to VS 2010 Pro, but get the same error, so it is independent of Express or Pro. This is still all from the command line.

Within the VS IDE, I can build successfully, following the Tutorial posted by CudaaduC. However, selecting Rebuild triggers the similar, but not identical error

nvcc : fatal error : Visual Studio configuration file '(null)' could not be found for installation at 'C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/../../..'

This is all very frustrating. Is the CUDA Toolkit supposed to work out of the box, most of the time?

I am using CUDA 5.0 with Visual Studio 2010 Ultimate and two GPUs . It all worked for me ‘out of the box’, so I am not sure what is wrong.

Here is the output from a build:

C:\Users\Windows 7 Ultimate\Documents\Visual Studio 2010\Projects\EXP3\EXP3>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc.exe" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --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\v5.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include"     --keep-dir "x64\Debug" -maxrregcount=0  --machine 64 --compile    -use_fast_math -DWIN32 -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd  " -o "x64\Debug\EXP3.cu.obj" "C:\Users\Windows 7 Ultimate\Documents\Visual Studio 2010\Projects\EXP3\EXP3\EXP3.cu"

Which shows where it is looking, and that was all set during initial setup. Tried re-builing and got no similar error.

Maybe if you compare your build to that you might get a clue as to what is off. Since I have not yet had any issues maybe that can serve as a guide to what may work.

Any updates on this very frustrating problem mjacobson?

I had this problem this morning, I did not find a solution but some workarounds:

  • Visual Studio 10.0 does not work with CUDA 7.5 compiler, no matter what I do. The cuda intaller does not even detect it and I have a full VS 10 (not Express). Also, VS 10.0 it’s not available on MSDNAA anymore.
  • Microsoft Windows SDK for Windows 7 (7.1) is the command line compiler, it worked with some previous version and manual setup of vsvars batch file, not working with 7.5 no matter what I do.
  • Visual Studio 11.0 (2012) works, provided you install CUDA 7.5 AFTER Visual Studio.

Now the reason why nvcc is SO dependent from a specific CPU compiler that isn’t free and isn’t from NVidia… is not clear.
Nvcc is just using the VS linker to link quite simple programs, I suppose there’s no lack of features in VS 10.0 so no practical reason why it does not work. They probably are more concerned in making “new” versions work with “new compilers”. This makes it painful to update an existing project. I suggest to embed a linker in Nvcc so we can get rid of VS and use mingw64.

I have MSVS 2010 on my system (x64, Win7), and this is the only version of MSVS I have installed. I just installed CUDA 7.5. I chose the local installer at the download prompt. The installation went without a hitch, the installer successfully integrated CUDA 7.5 and NSight into my existing MSVS 2010 installation.

So it is not clear what the problems are in your case. Since NVIDIA cannot test the installation process against any possible configuration variant of MSVS, I could imagine two potential issues: (1) MSVS is not installed in default locations (2) country-specific version of MSVS. However from one data point it is not possible to identify either of those as the problem, that would require multiple users hitting the same snag.

For better or worse, CUDA requires tight integration with the host compiler. The practical constraints of that approach (limited engineering resources) make it necessary to limit qualifying this integration only with the most frequently used host compilers for a given platform. On Windows, MSVS is by far the predominant tool chain.

Since there are people like me who still use old versions of MSVS, while others (including CUDA users in this forum) are clamoring for support of the latest version MSVS, NVIDIA uses a sliding window approach where periodically support for old versions of MSVS is discontinued and support for new versions is added. The covered span of compilers stretches across five years on average. CUDA 7.5 will be the last version to support MSVS 2010, as this is marked deprecated in the release notes.

I agree, but I still prefer QT/mingw64.
My host code is built with mingw64 and I have no issue with it. The only reason I still need VS is to build the PTX files, NVCC requires cl.exe (just a linker) and the PTX files are GPU binaries (no way there is any host specific code in it).

I’ll try to build PTX files under Linux, I believe they will run just fine under Windows and if so I don’t need VS anymore…

Thanks for the inspiration!

EDIT: CL is the COMPILER, not the linker. Still investigating…