10.07.2015 Views

nvidia cuda getting started guide for microsoft windows - HPC

nvidia cuda getting started guide for microsoft windows - HPC

nvidia cuda getting started guide for microsoft windows - HPC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

INTRODUCTIONNVIDIA ® CUDA TM is a general purpose parallel computing architecture introduced byNVIDIA. It includes the CUDA Instruction Set Architecture (ISA) and the parallelcompute engine in the GPU. To program to the CUDA architecture, developers can useC, one of the most widely used high-level programming languages, which can then berun at great per<strong>for</strong>mance on a CUDA-enabled processor.The CUDA architecture and its associated software were developed with several designgoals in mind: Provide a small set of extensions to standard programming languages, like C, thatenable a straight<strong>for</strong>ward implementation of parallel algorithms. With CUDA C,programmers can focus on the task of parallelization of the algorithms rather thanspending time on their implementation. Support heterogeneous computation where applications use both the CPU and GPU.Serial portions of applications are run on the CPU, and parallel portions areoffloaded to the GPU. As such, CUDA can be incrementally applied to existingapplications. The CPU and GPU are treated as separate devices that have their ownmemory spaces. This configuration also allows simultaneous computation on boththe CPU and GPU without contention <strong>for</strong> memory resources.CUDA-enabled GPUs have hundreds of cores that can collectively run thousands ofcomputing threads. Each core has shared resources, including registers and memory.The on-chip shared memory allows parallel tasks running on these cores to share datawithout sending it over the system memory bus.This <strong>guide</strong> will show you how to install and check the correct operation of the CUDAdevelopment tools.NVIDIA CUDA Getting Started Guide <strong>for</strong> Microsoft Windows DU-05349-001_v04 | 1


INSTALLING CUDA DEVELOPMENT TOOLSThe installation of CUDA development tools on a system running the appropriateversion of Windows consists of four simple steps: Verify the system has a CUDA-enabled GPU Download the CUDA software Install the driver <strong>for</strong> Windows XP, Windows Vista or Windows 7 (if necessary) Install the CUDA softwareTest your installation by compiling and running one of the sample programs in theCUDA software to validate that the hardware and software are running correctly andcommunicating with each other.VERIFY YOU HAVE A CUDA-ENABLED SYSTEMMany NVIDIA products today contain CUDA-enabled GPUs. These include: NVIDIA GeForce ® 8, 9, 200, 400, 500, and 600 series GPUs NVIDIA Tesla computing solutions Many of the NVIDIA Quadro ® productsAn up-to-date list of CUDA-enabled GPUs can be found on the NVIDIA CUDA Website at http://www.<strong>nvidia</strong>.com/object/<strong>cuda</strong>_gpus.html.The Release Notes <strong>for</strong> the CUDA Toolkit also contain a list of supported products.NVIDIA CUDA Getting Started Guide <strong>for</strong> Microsoft Windows DU-05349-001_v04 | 3


7Customs officers may be also attracted to investigation of the cases of illegal tradeand in<strong>for</strong>m the public of the actions being taken to ensure observance andfulfillment of MEAs. By fulfilling these tasks the customs officers combatdeterioration of the environment in their countries and in the world.The speakers then briefed the participants of the Workshop on the activity carriedout in frames of every particular MEA. The Workshop discussed the provisions offive international conventions and of the CWC. The “Green Customs Initiative” isan agreed method of capacity building. It serves as support <strong>for</strong> controlling transboundarymovement of some particular goods, substances and wild flora and faunaspecies by means of presenting succinctly international ecological conventionsaimed at conservation and protection of the environment from adverse impact ofthe human activity. The reporters spoke of the partners to the conventions, partnerorganizations’activity directed to improve the customs officers’ knowledge ofMEAs relating to the trans-boundary trade.When the countries undertake particular on-the-record commitments under MEAs,which are often connected with regulations on international trade, they have tomanage and, in some particular cases, imply legal restraints or prohibit trade withsome particular types of goods. Introduction of the restrictions or prohibition oftrade under MEA provisions often results in illegal trade with the substances andproducts, flora and fauna species controlled or prohibited by MEAs. Such illegalactivity can indeed prevent fulfillment of countries’ international obligations.Effective administration and restraint of illegal trade is facilitated by customsservices of the countries. All MEAs, regulating trans-boundary movement of someparticular types the goods, purposedly entrust the customs committees with a dutyto control both import and export, proper arrangement and consistency ofaccompanying documents, fulfillment of MEAs provisions, as well as appropriatenational laws. In case the customs authorities detect violation or non-fulfillment ofMEAs provisions, they have to assume appropriate measures.The necessity of better integration of international, regional and national interestsin compliance with and observance of MEAs provisions as well as fulfillment ofMEAs by national coordinating agencies, international agencies, nature protectionunits, customs committees, prosecutors’ offices, juridical and legislative authoritieswas particularly stressed.The speakers gave a survey of the status of MEAs ratification and fulfillment byCentral Asia countries. They stressed the necessity of Central Asia countries’coordinated activity aimed at unification of the regulations on illegal trade,monitoring, training, and establishing of close cooperation among the partners tothe Initiative in the countries.Finally, the speakers in<strong>for</strong>med the Participants of the Workshop procedures, suchas cross-lighting of the issues of compliance with and fulfillment of MEAs,presentation of MEAs, sharing of in-country and regional experience, visit tocustoms facilities in Uzbekistan, introduction to CWC, small-group discussionsand preparation of recommendations.Tashkent_report


Installing CUDA Development ToolsINSTALL THE CUDA SOFTWAREUse the following procedure to install the CUDA software:1. Install the CUDA Toolkit.Install the CUDA Toolkit by executing the Toolkit installer package and followingthe on-screen prompts. The CUDA Toolkit installation defaults to C:\ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v#.#, where #.# is versionnumber 3.2 or higher. This directory contains the following:Bin\ - the compiler executables and runtime librariesInclude\ - the header files needed to compile CUDA programsLib\ - the library files needed to link CUDA programsDoc\ - the CUDA C Programming Guide, CUDA C Best Practices Guide,documentation <strong>for</strong> the CUDA libraries, and other CUDA Toolkit-relateddocumentationNote: CUDA Toolkit versions 3.1 and earlier installed into C:\CUDA by default,requiring prior CUDA Toolkit versions to be uninstalled be<strong>for</strong>e the installation ofnew versions. Beginning with CUDA Toolkit 3.2, multiple CUDA Toolkit versionscan be installed simultaneously.2. Install the GPU Computing SDK.Install the GPU Computing SDK by executing the installer package and followingthe on-screen prompts. The GPU Computing SDK is installed in C:\Documentsand Settings\All Users\Application Data\NVIDIACorporation\NVIDIA GPU Computing SDK (or under%ProgramData%\NVIDIA Corporation\... on Windows Vista or later) andcontains source code <strong>for</strong> many example problems and templates <strong>for</strong> Microsoft VisualStudio.NVIDIA CUDA Getting Started Guide <strong>for</strong> Microsoft Windows DU-05349-001_v04 | 5


Installing CUDA Development ToolsIf the tests do not pass, make sure you do have a CUDA-enabled NVIDIA GPU on yoursystem and make sure it is properly installed.To see a graphical representation of what CUDA can do, run the sample Particlesexecutable in: For Windows XP:c:\Documents and Settings\All Users\Application Data\NVIDIA GPU Computing SDK\C\bin\win32\Release (or…\win64\Release on 64-bit Windows) For Windows Vista and Windows 7:C:\ProgramData\NVIDIA Corporation\NVIDIA GPU ComputingSDK\C\bin\win32\Release (or …\win64\Release on 64-bit Windows)NVIDIA CUDA Getting Started Guide <strong>for</strong> Microsoft Windows DU-05349-001_v04 | 7


COMPILING CUDA PROGRAMSThe project files in the GPU Computing SDK have been designed to provide simple,one-click builds of the programs that include all source code. To build the 32-bit or 64-bitWindows projects (<strong>for</strong> release or debug mode), use the provided *.sln solution files<strong>for</strong> Microsoft Visual Studio 2005, 2008, or 2010 (and likewise <strong>for</strong> the correspondingversions of Microsoft Visual C++ Express Edition). You can use either the solution fileslocated in each of the examples directories in NVIDIA GPU Computing SDK\C\srcor the global solution files Release*.sln located in NVIDIA GPU ComputingSDK\C\src.COMPILING SAMPLE PROJECTSThe bandwidthTest project is a good sample project to build and run. It is located in the…NVIDIA Corporation\NVIDIA GPU Computing SDK\C\src\bandwidthTestdirectory.The output is placed in NVIDIA GPU Computing SDK\C\bin\win32\Debug. (Asmentioned previously, the \win32 segment of this address will be \win64 on 64-bitversions of Windows.) This location presumes that you used the default installationdirectory structure.Build the program using the appropriate solution file and run the executable. If allworks correctly, the output should be similar to Figure 1.NVIDIA CUDA Getting Started Guide <strong>for</strong> Microsoft Windows DU-05349-001_v04 | 8


Compiling CUDA ProgramsSAMPLE PROJECTSThe sample projects come in two configurations: debug and release (where releasecontains no debugging in<strong>for</strong>mation).A few of the example projects require some additional setup. The simpleD3D9example requires the system to have a Direct3D SDK installed and the Visual C++directory paths (located in ToolsOptions...) properly configured. Consult the Direct3Ddocumentation <strong>for</strong> additional details.Most samples link to a utility library called cutil , the source code <strong>for</strong> which is inNVIDIA GPU Computing SDK\C\common\src. The release versions of thesesamples link to cutil32.lib (or cutil64.lib) and dynamically loadcutil32.dll (or cutil64.dll). The debug versions of these samples link tocutil32D.lib and dynamically load cutil32D.dll (or their 64-bit equivalents on64-bit versions of Windows).To build the Win32 release and/or debug configurations of the cutil library, usethe solution files located in NVIDIA GPU Computing SDK\C\common. The outputof the compilation process should be placed in NVIDIA GPU ComputingSDK\C\common\lib:cutil32.lib and cutil32D.lib (or cutil64.lib and cutil64D.lib) are therelease and debug import libraries.cutil32.dll and cutil32D.dll (or cutil64.dll and cutil64D.dll) are therelease and debug dynamic-link libraries, which also are copied to NVIDIA GPUComputing SDK\C\bin\win32\release and NVIDIA GPU ComputingSDK\C\bin\win32\debug respectively. (Substitute \win64 <strong>for</strong> \win32 on 64-bitWindows.)Note: The cutil library is primarily intended as a tool <strong>for</strong> streamlining the GPUComputing SDK samples; its use outside of the SDK samples is not recommended, asthe API <strong>for</strong> the library may change at any time.These sample projects also make use of the $CUDA_PATH environment variable to locatethe CUDA Toolkit and a .rules file to locate and configure the nvcc compiler. Theenvironment variable is set automatically and the .rules file is installed automaticallyas part of the CUDA Toolkit installation process. The .rules file is installed into$VisualStudioInstallDir\VC\VCProjectDefaults. You can reference this.rules file from your Visual Studio project files when building your own CUDAapplications.NVIDIA CUDA Getting Started Guide <strong>for</strong> Microsoft Windows DU-05349-001_v04 | 9


ADDITIONAL CONSIDERATIONSNow that you have CUDA-enabled hardware and the software installed, you canexamine and enjoy the numerous included programs. To begin using CUDA toaccelerate the per<strong>for</strong>mance of your own applications, consult the CUDA C ProgrammingGuide, located in the CUDA Toolkit documentation directory.For technical support on programming questions, consult and participate in the bulletinboard and mailing list at http://<strong>for</strong>ums.<strong>nvidia</strong>.com/index.php?show<strong>for</strong>um=71.NVIDIA CUDA Getting Started Guide <strong>for</strong> Microsoft Windows DU-05349-001_v04 | 11


NoticeALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHERDOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NOWARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, ANDEXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FORA PARTICULAR PURPOSE.In<strong>for</strong>mation furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes noresponsibility <strong>for</strong> the consequences of use of such in<strong>for</strong>mation or <strong>for</strong> any infringement of patents or otherrights of third parties that may result from its use. No license is granted by implication of otherwise underany patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to changewithout notice. This publication supersedes and replaces all other in<strong>for</strong>mation previously supplied. NVIDIACorporation products are not authorized as critical components in life support devices or systems withoutexpress written approval of NVIDIA Corporation.TrademarksNVIDIA, the NVIDIA logo, GeForce, Tesla, Quadro, and ForceWare are trademarks or registered trademarks ofNVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks ofthe respective companies with which they are associated.Copyright© 2012 NVIDIA Corporation. All rights reserved.www.<strong>nvidia</strong>.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!