CUDA Windows Development

Source: Internet
Author: User
Tags win32 cuda toolkit

1.CUDA Toolkit and SDK CUDA Toolkit version 1.1 for Win XP CUDA SDK version 1.1 for Win XP

Ps: NVIDIA Driver for Microsoft Windows XP with CUDA Support (169.21) at the time of development, this can not be installed, if there is support for the CUDA video card, the installation of this is only valid)

During the installation, you will be reminded whether to add the SDK and Toolkit settings to the VS development environment, choose Yes, but Cuda Windows version, currently supports only 6.0. VS2003, VS2005 's toolkit bat,vs2008 seems not to support it.

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 the
├─debug
├─emudebug
├─emurelease
└─release

Several directories are added to the system environment variable to find the corresponding DLL library when the program is run.

3.vs2005 Build a Cuda simple project

A. Creating a simple empty Win32 project

B. Add a new item and modify it yourself to EXAMPLE.CU

C. Right-click EXAMPL.CU Select Custom Compilation options

The command line adds "$ (cuda_bin_path)/nvcc.exe"-ccbin "$ (VCInstallDir) BIN"-deviceemu-c-d_debug-dwin32-d_console-d_mbcs- Xcompiler/ehsc,/w3,/nologo,/wp64,/od,/zi,/rtc1,/mtd-i "$ (cuda_inc_path)"-i./-I.. /.. /common/inc-o $ (configurationname)/example.obj example.cu

The output is modified to $ (configurationname)/example.obj

Dependency modification to Example.cu

PS: The compilation option here is for the convenience of many friends who have not yet supported the Cuda development of graphics cards. The compilation options used here are run on the emulator. If there is a real can run Cuda hardware support, you can modify the compilation options;

Here is the program to write your own example.cu.

D. Right click on the example item and choose the final compile option as EXE file.

E. Compile, execute, and you will see the emulator executing the program:

--------------------------------------------------------------------------------------------------------------- ------------------------------------

The simple environment is built. What each compilation option means, you can go to the http://www.nvidia.com/object/cuda_develop.html to download the relevant books

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.