Nsight Eclipse Edition Getting Started
Nsight Eclipse Edition Getting Started
Chapter 1. Introduction.........................................................................................1
1.1. About Nsight Eclipse Edition............................................................................1
Chapter 2. New and Noteworthy............................................................................. 2
2.1. New in Nsight Eclipse Edition 6.5..................................................................... 2
2.2. New in Nsight Eclipse Edition 6.0..................................................................... 2
2.3. New in Nsight Eclipse Edition 5.5..................................................................... 4
Chapter 3. Using Nsight Eclipse Edition..................................................................... 6
3.1. Installing Nsight Eclipse Edition........................................................................ 6
3.1.1. Installing CUDA Toolkit............................................................................. 6
3.1.2. Mac OS X Additional Notes........................................................................ 6
3.2. Running Nsight Eclipse Edition......................................................................... 7
3.3. Creating a New Project..................................................................................7
3.4. Importing CUDA Samples................................................................................ 8
3.5. Debugging CUDA Applications...........................................................................9
3.6. Remote development of CUDA Applications........................................................ 10
3.7. Debugging Remote CUDA Applications............................................................... 13
3.8. Profiling CUDA applications............................................................................18
3.9. More Information........................................................................................ 19
Appendix A. Platform Requirements....................................................................... 20
Appendix B. Known Issues.................................................................................... 21
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | ii
LIST OF FIGURES
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | iii
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | iv
Chapter 1.
INTRODUCTION
This guide introduces Nsight Eclipse Edition and provides instructions necessary to start
using this tool. For a detailed description of Nsight features consult the integrated help
available from inside Nsight.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 1
Chapter 2.
NEW AND NOTEWORTHY
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 2
New and Noteworthy
1. Nsight will connect to a remote system and will synchronize copies of the
project files between local and remote systems. User may be prompted to resolve
conflicts if there are any.
2. make will be executed on a remote system to build the project.
3. Build results will be copied back to the local system.
Building project remotely requires Git to be available and set up on both the local
and the remote system.
Target systems for remote build can be setup during project creation with the New
CUDA Project wizard or on the Build/Target Systems project property page
Please consult CUDA Toolkit Release Notes for information on enabling ARMv7
cross development support in CUDA Toolkit
CPU archicture for the project can be set during project creation with the New CUDA
Project wizard or using the Build/Target Systems project property page
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 3
New and Noteworthy
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 4
New and Noteworthy
Software preemption debugging is BETA and is only available on SM 3.5 and later
devices. Consult cuda-gdb manual before enabling this setting.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 5
Chapter 3.
USING NSIGHT ECLIPSE EDITION
$ xcode-select --install
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 6
Using Nsight Eclipse Edition
You can verify that the toolchain is installed by running the following command:
$ /usr/bin/cc --version
nsight
On Linux systems, Nsight is also available from Gnome, KDE and Unity desktop menus.
On the first run Nsight will ask to pick a workspace location. The workspace is a folder
where Nsight will store its settings, local files history and caches. An empty folder
should be selected to avoid overwriting existing files.
The main Nsight window will open after the workspace location is selected. The main
window is divided into the following areas:
‣ Editor - displays source files that are opened for editing.
‣ Project Explorer - displays project files
‣ Outline - displays structure of the source file in the current editor.
‣ Problems - displays errors and warnings detected by static code analysis in IDE or by
a compiler during the build.
‣ Console - displays make output during the build or output from the running
application.
By default Nsight will automatically detect and target CUDA hardware available
locally. Nsight will default to SM 2.0 if no CUDA hardware is detected.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 7
Using Nsight Eclipse Edition
Samples that use the CUDA driver API (suffixed with "Drv") are not supported by
Nsight.
1. From the main menu, open the new project wizard - File > New... > CUDA C/C++
Project
2. Specify the project name and project files location.
3. Select Import CUDA Sample under Executable in the Project type tree.
4. On the next wizard page select project sample you want to import. Press Next...
5. Specify the project parameters on the next wizard page.
6. Complete the wizard.
The project will be shown in the Project Explorer view and source editor will be
opened.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 8
Using Nsight Eclipse Edition
7. Build the project by clicking on the hammer button on the main toolbar.
GPUs used to run X11 (on Linux) or Aqua (on Mac) cannot be used to debug CUDA
applications in Nsight Eclipse Edition. Consult cuda-gdb documentation for details.
1. In the Project Explorer view, select project you want to debug. Make sure the project
executable is compiled and no error markers are shown on the project.
2. On the main window toolbar press Debug button (green bug).
3. You will be offered to switch perspective when you run debugger for the first time.
Click "Yes".
Perspective is a window layout preset specifically designed for a particular task.
4. Application will suspend in the main function. At this point there is no GPU code
running.
5. Add a breakpoint in the device code. Resume the application.
Debugger will break when application reaches the breakpoint. You can now explore
your CUDA device state, step through your GPU code or resume the application.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 9
Using Nsight Eclipse Edition
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 10
Using Nsight Eclipse Edition
For remote development you do not need any NVIDIA GPU on your host system. The
remote target system can be a Linux desktop system with NVIDIA GPU or an ARM
based Jetson TK1 system. Nsight IDE and UI tools are only available for x86 systems.
Nsight supports two remote development modes: the cross compilation mode and the
remote synchronized project mode.
In the cross compilation mode the project resides on the host system and the cross
compilation is also done on the host system. The cross compilation mode is only
supported on Ubuntu x86 host system.
To cross compile select the target cross compile architecture in CPU architecture drop
down:
In the remote synchronized project mode the project resides on the host system and
gets synchronized with the remote target system. The compilation gets done natively on
the target system. The remote synchronized project mode is supported on both Mac OS
X and Linux x86 systems.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 11
Using Nsight Eclipse Edition
To create native remote build using remote synchronized project mode click on
Manage... button to add a remote system, then select the project path, toolkit and the
CPU architecture of the target system:
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 12
Using Nsight Eclipse Edition
To synchronize projects between the host and target system, install and configure git on
both the local and remote systems as follows:
‣ git config --global user.name <anyname>
‣ git config --global user.email <anyemail>
If there is a firewall between the host and the target, it must be set up to let RSP
messages through, or SSH port-forwarding must be used.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 13
Using Nsight Eclipse Edition
3. Type the full path to a local executable or select one using the Local file... button.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 14
Using Nsight Eclipse Edition
4. Select a remote connection from a drop-down list or press the New... button to create
a new one.
5. If you are creating a new remote connection, select the SSH Only connection type,
press Next, and type the host name(or IP address) as well as the connection name and
description (both are optional) and then press Finish.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 15
Using Nsight Eclipse Edition
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 16
Using Nsight Eclipse Edition
9. Click on "Add new path" or on the Browse... button to specify the path to the shared
libraries the remote application depends on.
10.Click on the Finish button to finish the new debug configuration wizard and start
debugging the application.
11.You will be offered to switch perspective when you run the debugger for the first
time. Click Yes.
Perspective is a window layout preset specifically designed for a particular task.
The debugger will stop at the application main routine. You can now set breakpoints, or
resume the application.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 17
Using Nsight Eclipse Edition
1. In the Project Explorer view, select project you want to profile. Make sure the project
executable is compiled and no error markers are shown on the project.
2. On the main window toolbar press the Profile button.
3. Press Yes when Nsight prompts to switch to the Profile perspective.
Nsight will switch to the Profile perspective and will display application execution
timeline.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 18
Using Nsight Eclipse Edition
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 19
Appendix A.
PLATFORM REQUIREMENTS
Nsight Eclipse Edition is supported on all Linux x86_64 versions and Mac OS X versions
supported by the CUDA Toolkit.
A CUDA-capable GPU is not required for writing and compiling your CUDA
application using Nsight Eclipse Edition. A CUDA-capable GPU is required for
debugging and profiling CUDA applications. Debugging is supported on all CUDA-
capable GPUs supported by the CUDA Toolkit.
A GPU that is running X11 (on Linux) or Aqua (on Mac) cannot be used to debug a
CUDA application and will be hidden from the application ran in the debugger. Such
GPU can still be used for profiling GPU applications.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 20
Appendix B.
KNOWN ISSUES
Executable must exist in order to start debug session for the first time
Nsight will not automatically perform build when starting debug session for a given
project for the first time. Build must be invoked manually. Nsight will automatically
rebuild executable when starting subsequent debug sessions.
To manually build the project, select it (or any file within the project) in a Project
Explorer view and click hammer icon on the main window toolbar.
Source editors may show error markers on a valid code for the files in newly
created projects.
These markers will be cleared after Nsight indexes included header files.
Mac OS X users may be prompted to install Java Runtime Environment (JRE) when
running Nsight Eclipse Edition for the first time.
Nsight Eclipse Edition requires functioning Java Runtime Environment to be present on
the local system to run.
www.nvidia.com
Nsight Eclipse Edition DG-06450-001 _v7.0 | 21
Notice
ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS,
DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY,
"MATERIALS") ARE BEING PROVIDED "AS IS." NVIDIA MAKES NO WARRANTIES,
EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE
MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF
NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR
PURPOSE.
Information furnished is believed to be accurate and reliable. However, NVIDIA
Corporation assumes no responsibility for the consequences of use of such
information or for any infringement of patents or other rights of third parties
that may result from its use. No license is granted by implication of otherwise
under any patent rights of NVIDIA Corporation. Specifications mentioned in this
publication are subject to change without notice. This publication supersedes and
replaces all other information previously supplied. NVIDIA Corporation products
are not authorized as critical components in life support devices or systems
without express written approval of NVIDIA Corporation.
Trademarks
NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA
Corporation in the U.S. and other countries. Other company and product names
may be trademarks of the respective companies with which they are associated.
Copyright
© 2007-2014 NVIDIA Corporation. All rights reserved.
www.nvidia.com