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

后端 未结 4 826
既然无缘
既然无缘 2021-02-10 13:58

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:<

相关标签:
4条回答
  • 2021-02-10 14:26

    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

    0 讨论(0)
  • 2021-02-10 14:29

    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/

    0 讨论(0)
  • 2021-02-10 14:34

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

    0 讨论(0)
  • 2021-02-10 14:42

    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

    0 讨论(0)
提交回复
热议问题