Hello World C++ CUDA Program in Visual Studio 2010 (Windows 7)

28,817

Solution 1

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

Solution 2

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

Solution 3

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/

Share:
28,817
worbel
Author by

worbel

(your about me is currently blank)

Updated on September 03, 2020

Comments

  • worbel
    worbel over 3 years

    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 ?