How to create and compile a simple program in cuda by using visual studio 2008

Hi All,

I am very new to cuda programming and I installed cuda driver,sdk,cuda toolkit and visual studio 2008.
I did a lot of search and followed some docs that are online but was unsuccessful in figuring out how to start cuda programming by using visual studio 2008.

Can please please any one can help me if there is any tutorial for this about how to start working cuda with visual studio 2008. If I can solution for how to create a simple “hello world” or “adding two numbers” project and compile it by us both cuda and vs2008 it would be very great.

Can anyone please help me by putting the steps on how I should proceed I am very greatful to them.

Please help me.


I would definitely suggest you download the Cmake application. CUDA programs running in VS require complex custom build steps, and this program prebuilds these steps for you.

You need to download at least version 2.8 in order to have CUDA compatibility.

Once you have installed Cmake, create a text file within the folder with all your CUDA source files and call it CMakeLists.txt.

For a simple example, the syntax of your CMake file should look something as follows:

[codebox]cmake_minimum_required(VERSION 2.8)



#Include the FindCUDA script


#The rule to build the executable program

#This should contain all the source files you wish to use

CUDA_ADD_EXECUTABLE(myExample )[/codebox]

Save the text file, and then go into the cmake gui, and select the corresponding folder for the location of your source file and where you want your binaries to be created.

You may need to configure several things before you can generate the binaries.

From this point you can compile your project and try it out.

The following webpage should help you get started with the actual programming:

Hope this helps