How to Compile CUDA App is Visual Studio 2010?

前端 未结 4 1260
情深已故
情深已故 2021-01-03 06:26

How to Compile CUDA App is Visual Studio 2010 ?

Here are my steps: 1. Create Empty C++ project without precompiled headers 2. Add main.cpp

int main()         


        
相关标签:
4条回答
  • 2021-01-03 07:06

    i referred to sample project MAtrixMul and copied its settings step by step. it can be complied now, but doesnt process any calculations. The problem is described here at SO in details

    You can view my project with all it needs from my post at nvidia forums (2.7 kb)

    Thanks, Ilya

    0 讨论(0)
  • 2021-01-03 07:15

    Visual Studio 2010 is definitely supported -- be sure to use the recently released nSight 1.5 (not the beta). I haven't updated the question I asked, but @portland, you've followed all of the correct steps. You simply have a typo in your kernel.

    You've referenced threadId.x instead of threadIdx.x -- note the x.

    0 讨论(0)
  • 2021-01-03 07:23

    I found this post on the cuda forums at nVidia. One of the moderators says (Nov 09: We don't support VS2010 yet).

    This may not be the case any longer, but that your error message states that the CUDA toolkit version you're using doesn't support the V100 compiler, would suggest that you may need to upgrade your CUDA toolkit.

    If you've got the latest version, check and see if the CUDA toolkit supports VS2010 yet.

    v90 is a way of referring to the compiler that comes with VS2008, so I'd assume that VS2010 is compiler v100.

    Maybe you've got an MSDN subscription and can fall back to VS2008.

    This SO post would also seem to suggest that CUDA doesn't support VS2010 compiler (yet!)

    0 讨论(0)
  • 2021-01-03 07:24

    Yes i did, and it IS working.

    1. Create C++ project

    2. Project(right click)->build customisation Check "Cuda 3.2 compiler"*

    3. Add cudart.lib to properties->linker->input->additional dependencies

    4. Add main.cu -> properties Item type = CUDA C/C++*

    5. Project -> properties ->configuration Properties -> general -> v90 toolset**

    *) will appear after you install Nvidia Parallel Nsight. Be careful, you need special drivers for that, more on NSight homepage)

    **) you need to instal visual c++ 2008 express.

    Anyway, example project still should be available at my nvidia forum post. The problem i'm complaining there about is just out-of-date drivers.

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