开发者

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

开发者 https://www.devze.com 2023-01-24 17:10 出处:网络
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:

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 ?


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


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/


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消