Cuda windows Development

Source: Internet
Author: User

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) 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

  • 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.