Getting Started With Cuda (With MSVC++ 2008)

I spent an age trying to set up with CUDA. When I finally figured out how, I decided that I never wanted to have to go through that again and wanted to write a tutorial for me and others just in case I need to do it again in the future.

Now goto Project –> Properties –> Configuration Properties –> Linker –> General and paste this line in the Additional Library Directories field: $(CUDA_LIB_PATH);../../common/lib

Alas! You’re done! Now you can try Rebuilding the sample code that comes with CUDA SDK. Simply open the project folder and then open the .sln file in it to open it in VS08 and then Right click on the project and click Rebuild and run it for yourself!

If everything has been properly setup, The Rebuild should be Successful.

Common Mistakes to avoid - I thinkPlease note that when the site explaining how to set up the IDE is asking you to link the SDK library and include files etc, you should go here on your computer:C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C

and ALSO here just to be safe:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA.

I couldnt get it to work just linking one of either, I dont know what to mix and match so i just linked all lib / bin/ and inc folders from both areas and works.

(dont forget to browse into the necessary folders ie 'include' and 'ib', dont just copy and paste the text I put just there thats the start of the file path.)

Also note that any cuda programming you do should have the file extension '.cu' and not '.c' or '.cpp' just in case you didn't know. Seems like nobody ever mentions the more obvious stuff. Note that the single quote marks are not to be part of the file name.