CUDA Development with CDT on windows

C++ editor in VC is so weak, I like to use CDT to develop C++ apps.

It’s avalible to use CDT to develop cuda apps on windows.

Follow these step:

1.Of course,you need CDT ,Cygwin , Mingw installed on windows;

2.Install cuda toolkit,SDK compatible with you cuda driver(can view in nvidia panel);

3.VC compiler is esencial for nvcc on windows, you can install VS C++ Express edition

(note: the nvcc in CUDA 3.2 can only compatible with VC compiler 8/9,so it cant work with VS2010)

4.Set system environment. now added the path “…\NVIDIA GPU Computing SDK 3.2\shared\inc” and “…\NVIDIA GPU Computing SDK 3.2\C\common\inc” in CUDA_INC_PATH, add CUDA_LIB_PATH “…\Program\NVIDIA GPU Computing SDK 3.2\C\common\lib” and “…\Program\NVIDIA GPU Computing SDK 3.2\shared\lib”;

5.Open CDT, create new C++ project with the type MakeFile and toolchains Cygwin GCC;

6.Set project properties.In C++/C build–>Environment, add variable PATH , LIB, INCLUDE with following value:

PATH: ${CUDA_BIN_PATH};the dir of Cygwin\bin;the dir of MinGW\bin;the dir of \VC\bin;

LIB: ${CUDA_LIB_PATH};the dir of \VC\lib;the dir of Microsoft SDKs\Windows\v6.0A\Lib;

INCLUDE: ${CUDA_INC_PATH};the dir of \VC\include;

7.add *.cu file type into performence–>C/C+±->file type

8.Write a makefile in project. A simple example:

CXX = nvcc

app = cudatest.exe

obj = debug/cudatest.o

src = src/*.c*

traget=debug/$(app)

$(traget): $(obj)

	$(CXX) $(src) -o $(src)

	

all: $(traget)
  1. Ok, program in a *.cu file then build and run it.

  2. Good luck, it’s effective in my CDT, the nvcc can compile the *.cu file.