1. Cuda toolkit and SDK
· Cuda SDK version 1.1 For Win XPPS: · NVIDIA driver for Microsoft Windows XP with Cuda support (169.21) during development, this does not need to be installed. If you have a video card that supports cuda, this installation will be effective)
During the installation process, you will be reminded whether to add the SDK and toolkit settings to the development environment of vs. Select Yes here, but the Cuda Windows version currently only supports 6.0. vs2003, vs2005 toolkit bat, vs2008 does not seem to support.
2. Set system environment variables
Add the path of the installed Cuda SDK to the system environment variable:
For example, C:/program files/NVIDIA Corporation/NVIDIA Cuda SDK/bin/Win32/
Under
─ ── Debug
├ ── Emudebug
├ ── Emurelease
└ ── Release
Several directories are added to system environment variables so that the corresponding dll library can be found during program running.
3. Build a simple Cuda project in vs2005
A. Create a simple empty Win32 Project
B. Add a new item and change it to example. cu.
C. Right-click exampl. Cu and choose Custom compilation option.
Add "$ (cuda_bin_path)/nvcc.exe"-ccbin "$ (vcinstalldir) bin"-deviceemu-C-d_debug-dwin32-d_console-d_mbcs-xcompiler/ehs, /W3,/nologo,/wp64,/OD,/Zi,/rtc1,/MTD-I "$ (cuda_inc_path)"-I. /-I .. /.. /common/INC-o $ (configurationname)/example. OBJ example. cu
Change the value to $ (configurationname)/example. OBJ in the output.
Modify the dependency to example. cu.
PS: the compilation options here are for the convenience of many friends who have not yet supported Cuda development. The compilation options used here are run on the simulator. If you have the hardware support for running cuda, you can modify the compilation options by yourself;
The following is a program to write example. cu.
D. Right-click the example project and select the final compilation option as the EXE file.
E. Compile and execute the program, and you will see the simulator execution program :)
Certificate ---------------------------------------------------------------------------------------------------------------------------------------------------
A simple environment is complete. What is the meaning of each compilation option, you can go to the http://www.nvidia.com/object/cuda_develop.html to download the relevant books