Windows Server 2008-visual Studio 2010-cuda7.0 Environment installation and creation project

Source: Internet
Author: User
Tags visual studio 2010

Cuda Software Installation

Go to https://developer.nvidia.com/cuda-downloads download Cuda software, select the download item according to the corresponding system version.

Download after double-click to install, the network has a lot of technical resources to the Cuda installation process and introduction, here is no longer detailed, specifically see the resources listed in the reference. Here is a list of some of the things you need to be aware of during installation.

Cuda Installer Selection

Previous versions need to download drivers, toolkit, SDKs, and then install them in turn. For later versions, you do not need to download and install the software separately. Just download the latest Cuda software to the above URL, because Cuda software now integrates all the components together. As shown, just download the red Line callout software, other software can not download.

Whether the hardware supports Cuda

Before you install and use Cuda, determine whether the current host's video card supports CUDA (or the Nvidia GPU is installed). If the current video card does not support Cuda, the Cuda driver cannot be installed. For situations where the driver cannot be installed, the installer prompts you during the installation process to ask if you want to continue with the installation, as shown in. From the current operating system (Win Server R2 64bit) experiment, the host does not support CUDA graphics card can continue to install later, configure the Visual Studio development environment, to create CUDA engineering, compile pass, syntactically normal execution, However, the program cannot be executed on the device, which indicates that the device is not found. Therefore, for a host that does not support CUDA can configure the development environment, can create engineering, can judge Cuda syntax error, but can not effectively execute the program and see the effect of execution (can not be used). These are experimental results on the win Server R2 64bit operating system, for the win XP version of the operating system, because there is no integrated cuda software, so you need to download the driver, Toolkit, SDK for installation. Based on previous experimental results on XP, the installation process cannot continue if the host does not have a CUDA-enabled video card installed.

Installation mode selection

Instead of selecting the default thin (recommended) installation mode for installation, you should choose Custom (Advanced) installation mode. Because the default installation mode does not install the SDK, it has a certain impact on subsequent programming. By customizing the installation mode, select all components to install all.

Environment variables

When completed, the system environment variables are incremented and modified as shown in.

Configure the Visual Studio environment and create a project Cuda extension configuration

Here is an example of the 2010 version of Visual Studio. The first is to set the syntax highlighting for the CUDA program in VS, so that files with the suffix of Cu and cuh are displayed in C + + format. The steps are: Tools-Options-Text editor-file extension, select VC + + compiler in the drop-down menu on the right, and add the extension CU and Cuh respectively.

Create a CUDA engineering process

The next step is to introduce the process and considerations for the Cuda project.
Similar to the process of creating a C + + project, it is important to note that when you create a Cuda project, you select the NVIDIA project template to create the project from the Cuda runtime interface, as shown in.

After creating a Cuda project as described above, a KERNEL.CU test program is automatically generated, and the function of the test program is to add two arrays together by Cuda. By executing the program, it is possible to determine whether the CUDA programming environment is configured according to the execution results.

The process of creating a Cuda program file is the same as creating a C + + process, right-clicking the project-Adding a new item, just selecting the type as shown in the Cuda-related file, the program file type and the cast file type, respectively Cuda, with the suffix. Cu and. Cuh.

Configuring Cuda Dependent Libraries

If Cuda uses external libraries such as CUFFT, these external libraries need to be included in the project. If you have not previously directed this type of library, you need to configure the directory where the Cuda library resides. The action is right-click Project-Properties-Configuration Properties-linker-General-Additional library directory, add a new path: $ (cuda_path_v7_0) \lib\$ (Platform).

By configuring the directory where additional libraries are located, you can add related library files to your project. The procedure is right-click Engineering-Properties-Configuration Properties-linker-Input-additional dependencies, add a library file: for example, Cufft.lib.

The CUDA project created by default is the Win32 type, and if you need to change the platform (such as x64), right-click Project-Properties-Configuration Properties-Configuration Manager and select the platform on the active solution platform. After modifying the platform, it should be noted that the platform and configuration information is one by one corresponding, the modified configuration information is new, the default. If the configuration information has been modified under the previous platform, then these changes will not be reflected in the modified configuration information (the modified configuration information is completely new), and therefore need to be re-modified under the new platform. In addition, it is important to note that the Library directory of the WIN32 and x64 two platforms is different.

Reference documents

The CUDA 4.0 environment is properly configured under Windows and a new project is created in Visual Studio 2008
Configuring Cuda and VS2008 "Win7 for example" under Windows

Windows Server 2008-visual Studio 2010-cuda7.0 Environment installation and creation project

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.