Adding CUDA support to a VC++ 2008 Project

I’m able to open the supplied SDK projects in VC++ 2008, but I can’t transplant them to my Projects folder. For some reason, I’m not finding where in the CUDA documentation that it says how to add CUDA support to a new or existing VC++ 2008 project that doesn’t already have it. Can someone point me in the right direction?

You just need to change the include paths and lib paths in the project settings which will be given as relative paths in the SDK samples.
For setting CUDA rule file just copy the cuda.Rules to the visual studio path containing all the other the rule files used in visual studio and set it.

Thanks, but there are so many of those paths scattered among the other settings, how do I make sure that I’ve gotten them all?

I think there is not much complication with the settings. Just 2 include paths and 2 lib paths are sufficient.

I have made the changes described here, but the dll files cannot be located by the linker when I rebuild with CUDA 3.1 under Windows 7 or Windows XP.

http://www.programmerfish.com/how-to-run-c…udio-2008-vs08/

I have found the instructions in the CUDA SDK release notes for adapting the template project, that should cover me as far as paths go.

But now I’m unable to locate how to set up for compiling emulator and emulator debug binaries - this is a problem since for the moment I have one dev machine with a CUDA care and one without.

Any ideas? Adding -devemu to the custom build step command line did not work as advertised, and it built a plain debug binary.

You have to add -deviceemu in the custom build step command line. Please find the attached sample build in device emulation mode. For debugging the cuda kernel you have to put a break point inside the kernel and then run.
Sample1.zip (168 KB)

Thanks - I ended up recycling the template project from the 3.0 SDK and moving my source code over to that, so I could select Emulation from VS2008’s Build | Configuration Manager.

Thanks - I ended up recycling the template project from the 3.0 SDK and moving my source code over to that, so I could select Emulation from VS2008’s Build | Configuration Manager.

I think device emulation has been removed in CUDA 3.1. That’s why you were not able to debug in your previous solution.
In CUDA 3.0 it is available but is given as deprecated.

I think device emulation has been removed in CUDA 3.1. That’s why you were not able to debug in your previous solution.
In CUDA 3.0 it is available but is given as deprecated.