4

I am trying to compile this Hello World program in Windows 7 with Visual Studio 2010 installed, but I get the following error message when I run nvcc hellocuda.cu:

nvcc fatal   : nvcc cannot find a supported cl version. Only MSVC 8.0 and MSVC 9.0 are supported

How can I compile this CUDA program ?

worbel
  • 6,509
  • 13
  • 53
  • 63
  • Don't use Visual Studio unless you install Nvidia plugins. Visual C++ is basically a gimped version of C++, so... – Rafe Kettler Nov 13 '10 at 05:43
  • 1
    I'm not directly using visual studio... nvcc is.. I have Nsight installed if thats what you mean? – worbel Nov 13 '10 at 05:45

4 Answers4

6

NVCC checks VC++ compiler version from Visual Studio environment variables. NVCC says it supports only MSVC 8.0 and 9.0 compilers. In your case, you have MSVC 10.0 compiler. There seems to be a workaround to this issue, check out post #7 in this thread:
http://forums.nvidia.com/index.php?showtopic=179531 and also
http://forums.nvidia.com/index.php?showtopic=88585

swatkat
  • 4,785
  • 1
  • 23
  • 17
2

If you keep having problems getting it working with MSVC10, bear in mind that you can download the Express version of MSVC9 (i.e. the 2008 version) for free -- so you can always download it and compile with that instead. But I would try swatkat's workaround first :)

Here's the link:

http://www.microsoft.com/express/Downloads/

Stuart Golodetz
  • 20,238
  • 4
  • 51
  • 80
  • Its better to download the Windows SDK and set Visual Studio to use that compiler (ought to be possible, no?) – rubenvb Nov 13 '10 at 13:27
2

Visual Studio 2008 Express was needed. (Thanks sgolodetz)

So with Visual Studio 2010 Professional (maybe 2010 Express works too?), NVIDIA Parallel Nsight, CUDA Toolkit, Developer Drivers, and GPU Computing SDK code samples (toolkit, drivers, and sdk can be downloaded here) I was able to run the example Hello World in CUDA program.

How to create/upgrade a CUDA project in VS2008 and VS2010 to work with Nsight 1.5 and CUDA 3.2 was very helpful in starting a new VS 2010 CUDA project with the proper settings.

Side note: I was never able to get the command line nvcc to work correctly, but I rather use VS 2010 IDE instead.

Update: How do I start a new CUDA app in visual studio 2008?'s answer was also useful

Community
  • 1
  • 1
worbel
  • 6,509
  • 13
  • 53
  • 63
0

With CUDA 4.0 you can use the VC10 toolchain. See this answer for a step-by-step.

Community
  • 1
  • 1
Tom
  • 20,852
  • 4
  • 42
  • 54