CUDA

CUDA Performance Characteristics

Here is a diagram of thread computing ind CUDA. It might be helpful as an illustration.

CUDA_Thread_Computing

Compute Unified Device Architecture (CUDA) compilation flags:
nvcc (To compile program)
-deviceemu (To compile with device emulation)

Installation

This guide assumes the default installation paths are used.

1. Install CUDA driver, SDK and toolkit in that order.
2. Add "C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\common\lib" to the CUDA_BIN_PATH environment variable and add "C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc" to the CUDA_INC_PATH environment variable.
3. Add "C:\Program Files\Microsoft Visual Studio 8\VC\bin" to the path environment variable. This is the path for Visual Studio 2005. Only VS2003 is also supported.

Problems and Solutions
  • cl.exe must be version 7.1 or 8: The version of Visual Studio installed is neither the 2003 nor the 2005 editions which are the only supported versions.
  • cl.exe cannot be found: The Visual Studio bin folder has not been added to the path environment variable
  • Missing environment variables (CUDA_BIN_PATH, CUDA_INC_PATH, CUDE_LIB_PATH): These should have been set by the CUDA toolset installer. Otherwise, they can be set manually with paths to the respective folders in c:\cuda\.
  • [Output] file cannot be found (If output name is not specified, a.exe is the default): The code is compiled in protected space such as Program Files in Windows Vista, where write permission requires administrative rights.
  • Environment variables not recognized on 64bit OS: Change 'Program Files' to 'Program Files (x86)'
Installation Links
To enable syntax highlighting for .cu files:

"User keywords can be highlighted in Visual Studio by (creating and) editing a file named "usertype.dat" in the directory %vs_install_dir%\Common7\IDE. There are example keyword files in the CUDA SDK package (%NVSDKCUDA_ROOT%\doc\syntax_highlighting) that you can copy to VS dir and modify to suit your needs. The user keywords can be configured to have the colour of the VS keywords (default) or a common colour of their own." (link)

To enable Intellisense for .cu files:

"We can use the tool Visual Assist X to implement it:
First, find the Visual Assist X install directory:
\Program Files\Visual Assist X\Autotext, then make a copy of Cpp.tpl, rename it to Cu.tpl, apply same operation to the "Latest" directory. Second, open the regedit table, and search it with the key word "Visual Assist X" until you find in the VANet8 in HKEY_USERS\S-1-5-21-1757981266-220523388-725345543-1003\Software\Whole Tomato\Visual Assist X\VANet8
Here you can see many attribute setting about Visual Assist X, click the item ExtHeader and add the .cu in the list, same to the item ExtSource. save and quit." (link)

page_revision: 8, last_edited: 1222160605|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License