My latest work is to check and refine a GPU project. Because I was not familiar with CUDA computing and the code, written by Steve, is too complicate to understand, I had many difficulties. However, comparing to the code, the CUDA itself make much more trouble. The first is the installation. I write my experience here for memo.
1. I prepared the developer drivers, CUDA toolkit and CUDA SDK downloaded form the nvidia website http://developer.nvidia.com/cuda-downloads. The first experience is that make sure the three things mentioned above have the same version and I do not recommend setup the latest version because the latest version may have bugs and doesn't support the earlier version.
2. Install the drivers, CUDA toolkit and CUDA SDK as this sequence. After that, run the sdk samples in $SDK_DIR/c/bin/win32(or 64)/ to make sure every device is OK.
3. Add the CUDA toolkit and SDK include files and lib files in Visual Studio. Tools->options->projects and solutions->VC++ directories.
In Visual Studio 2010, we can not do that like in VS2008. The method is creating a new project and set up the path in Property Manager(View->Property Manager) like following picture and we need not do it again while creating another new project.
4. Configuration the generation rules. Creating a new project and add a new item with extension .cu. Then right click the project and choose the “Custom Build Rules" and set up the CUDA generation rules.
5. At last check the system path, then compile, build, run!
No comments:
Post a Comment