CUDA-specific build settings are set on the Build > CUDA
project property page.
At the top of this property page there is a drop-down list of the build configurations for the selected project. Select [All Configuration] to edit all build configurations at once.
Note: Consult NVCC manual for details on whole and separate compilation
Nsight, Eclipse Edition supports both separate and whole device code compilation. Separate compilation enables device code to refer to functions defined in other source files or precompiled device code libraries. Code built using separate compilation may only target GPUs with compute capability 2.0 or higher. PTX can not be generated when separate compilation is used.
Device linker mode is a project-wide setting. Use radio buttons under build configuration selection combobox to toggle device linker mode for your project. By default, Nsight uses whole program compilation for new projects.
A GPU’s compute capability indicates the features available on that device. Higher compute capability devices provide all the features of the lower ones in addition to new features. Consult CUDA C Programming Guide for a list of features available in different compute capabilities.
GPU code can be compiled into PTX or SASS form. SASS stands for Shader ASSembly and is a low-level binary code directly executed on the GPU. SASS code is not compatible between major compute capability versions. PTX is an assembly-like language that is compiled into device-dependent SASS by a CUDA driver when kernel is loaded for the first time. PTX is forward compatible and is guaranteed to run on future CUDA devices.
Nsight projects can be configured to target one or more compute capabilities and to emit both PTX and SASS code. This can be done by checking appropriate checkboxes on the CUDA project property page. Some checkboxes are disabled when separate compilation is enabled as separate compilation can only emit SASS code for compute capability 2.0 or higher.
Note: Device code is recompiled for every targetted compute capability and code format, increasing application executable size and time needed to rebuild the project.
Nsight detects compute capability of the devices installed locally and will validate project settings against those devices. It also provides sensible defaults when creating a new project.
Nsight source editor can be configured to develop code for specific compute capabilities. This will adjust code assist proposal lists to show functions available for the given compute capabilities and will highlight inactive code based on precompiler macro values for the given architecture. The following image shows an example of the source editor when the compute capability is set to 2.0. In this case the source editor detects that the ‘idata’ variable is not defined.
By default, Nsight editor will "target" lowest compute capability supported by the project. This setting can be changed by selecting a different value in the Source editor compute capabilty drop-down list on the CUDA project property page.
CUDA Toolkit 5.0 introduces separate compilation where device linker can link together device functions from different source files. This enables using precompiled static libraries of the device code. Nsight provides support both for writing device code libraries and to link with existing device code libraries.
Static library projects can export both device and host functions.
Separate compilation must be enabled for the project to link with static device code libraries.
Nsight supports linking with both static library projects and externally provided static device code libraries. To link with static library project:
Nsight will incrementally rebuild all static library projects before building the main project.
To link with static libraries built outside of Nsight: