Nsight Eclipse Plugins Guide
Nsight Eclipse Plugins Guide
Release 12.3
NVIDIA
3 Known Issues 33
4 Notices 35
4.1 Notice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.2 OpenCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.3 Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
i
ii
Nsight Eclipse Plugins Guide, Release 12.3
Contents 1
Nsight Eclipse Plugins Guide, Release 12.3
2 Contents
Chapter 1. About Nsight Eclipse Plugins
Edition
NVIDIA® Nsight™ Eclipse Edition is a unified CPU plus GPU integrated development environment (IDE)
for developing CUDA® applications on Linux and Mac OS X for the x86, POWER and ARM platforms.
It is designed to help developers on all stages of the software development process. Nsight Eclipse
Plugins can be installed on vanilla Eclipse using the standard Help->Install New Software.. Menu. The
principal features are as follows:
▶ Edit, build, debug and profile CUDA-C applications
▶ CUDA aware source code editor – syntax highlighting, code completion and inline help
▶ Graphical user interface for debugging heterogeneous applications
▶ Profiler integration – Launch visual profiler as an external application with the CUDA application
built in this IDE to easily identify performance bottlenecks
For more information about Eclipse Platform, visit http://eclipse.org
3
Nsight Eclipse Plugins Guide, Release 12.3
To get started, CUDA Toolkit path must be configured in Eclipse with Nsight Plugins:
1. Open the Preferences page, Window > Preferences.
2. Go to CUDA toolkit section.
3. Select the CUDA toolkit path to be used by Nsight. CUDA tookits that are installed in the default
location will automatically appear.
4. CUDA toolkit path can be also specified in the project properties page in order to use different
toolkit for a project.
5. Enable usage data collection if you wish to send usage data to NVIDIA.
5
Nsight Eclipse Plugins Guide, Release 12.3
6. Click on the button to set cuda-gdb and Visual Profiler as the default launchers.
7. For QNX: When QNX is selected as Target OS, a dialog will be displayed to set the QNX_HOST
and QNX_TARGET environment variables if they were not already set.
QNX_HOST environment variable identifies the directory that holds the host-related compo-
nents:
QNX_TARGET environment variable identifies the directory that holds the target-related compo-
nents:
Note: 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. Select CUDA toolchain from the Toolchains option. location.
5. On the next wizard page select project sample you want to import. Also select the target CPU
architecture. Press Next…
6. Specify the project parameters on the next wizard page.
7. Complete the wizard. The project will be shown in the Project Explorer view and source editor will
be opened.
8. Build the project by clicking on the hammer button on the main toolbar.
The following are the categories of Nvcc linker settings that can be configured for the selected project.
Note: All options field in the main page is not editable and it’s the collection of options set in the child
categories.
▶ Libraries - Configure library search path(-L) and to include linker libraries(-l). When you are cross
compiling for different target os, the library search path should point to the appropriate location
where the target os libraries are present.
▶ Miscellaneous - Set additional linker options and option to link with OpenGL libraries.
▶ Shared Library Settings - Set option to build a shared library.
The following are the categories of Nvcc Compiler settings that can be configured for the selected
project.
Note: All options field in the main page is not editable and it’s the collection of options set in the child
categories.
Nsight Eclipse Plugins supports the cross compilation mode for remote devices.
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 an Ubuntu x86 host
system.
To cross compile select the target cross compile architecture in CPU architecture drop down in the
project properties page:
Note: 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.
1. Select the project and right click then go to Debug As…>NVIDIA CUDA GDB Debugger(Remote)
menu item.
2. Type the full path to a local executable or select one using the Local file… button.
3. Select a remote connection from a drop-down list or press the Add connection… button to create
a new one.
4. If you are creating a new remote connection, enter the host name(or IP address) as well as the
user name. Select the SSH as system type. Also select the QNX check box for QNX targets and
then press Finish.
5. For Android devices: To configure the remote connection using Android debug bridge, select
the Android debug bridge from the Remote Connection drop-down list, Android device must be
connected to the host system using USB port.
Press Manage button, and enter or select the path to adb utility. You need to install Android
SDK platform tools to use Android debug bridge. press Detect button to find the android device
available through ADB.
6. Optional: Press Connect to verify the selected remote connection.
7. Press the Next button.
8. Type the full path to cuda-gdbserver on the remote system or select one using the Browse…
button.
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.
Nsight Eclipse will launch the Visual Profiler to specify extra profiler options with the executable infor-
mation already passed from the selected project.
3. Select the option if you want to build the projects inside the Docker container. Make sure the
CUDA toolkit path that is specified in the CUDA preferences is the path of the CUDA toolkit inside
a Docker container.
4. Select the Connection and the Image dropdown will display all the Docker images that are cur-
rently installed. Choose the docker image that you want to use to build/debug the projects. The
preferences that are set here will be automatically displayed in the project setup wizard. You can
choose to modify the container settings for the individual projects from the project setup wizard.
5. To create a project, From the main menu, open the new project wizard: File > New… > CUDA C/C++
Project
6. Specify the project name and project files location. And select the CUDA toolchain from the list
of toolchains.
7. In the last page of project setup wizard, the container options will be displayed. The default
container settings from the preference page will be displayed here. You can choose to modify
the settings for this project in this Container settings page.
8. Complete the project setup wizard. The project will be created and shown in the Project Explorer
view.
9. The project source directories will be automatically mounted to the docker container.
10. If you need to mount any other directories that contains the include files/libraries and etc to the
docker container, you can mount those directories from the project property page.
11. Right click on the project and go to Properties. Select C/C++ Build > Settings > Container Settigns
Tab. Additional directories can be mounted from this property page.
12. Build the project by hitting the hammer button on the main toolbar. The project is now built in
the chosen Docker container the executable will be available on the host.
Note: 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.
4. Choose the project and the executable to upload to the target in the “Local” tab.
5. From the “Container” tab, select the connection and Docker image that contains the CUDA GDB.
Also you can select any host directories required to mounted to the Docker container.
6. Select the debugger options from the “Debugger” Tab. Make sure to enter the CUDA GDB exe-
cutable path inside Docker container. And add the required environment variables in the “Envi-
ronment” tab.
7. Click on the Apply button to save the changes and click on the Debug button to start the debug
session. This action will upload the local executable to the target system and will start CUDA
GDB Server on the target. And the Docker container will be started on the host and CUDA GDB
running inside the docker container will establish the remote debug session with the target.
8. 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.
12. Complete the wizard. The project settings will be imported from the file exported from Nsight
Eclipse Edition.
13. Build the project by clicking on the hammer button on the main toolbar.
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.
Note: 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 Plugin Edition requires functioning Java Runtime Environment to be present on the local
system to run.
Nsight Eclipse Plugin Edition does not provide compilation support for using the QNX qcc and q++
compilers.
The workaround to compile using qcc and q++ is
▶ Specify the q++ path in CCBIN field on toolkit configuration page on project properties dialog as
shown below. You can access toolkit configuration page by clicking main menu Project > Proper-
ties > C/C++ Build > CUDA Toolkit
▶ Change default CONF to gcc_ntoaarch64le in the file ${QNX_HOST}/etc/qcc/gcc/5.4.0/default as
below
CONF=gcc_ntoaarch64le
33
Nsight Eclipse Plugins Guide, Release 12.3
4.1. Notice
This document is provided for information purposes only and shall not be regarded as a warranty of a
certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no repre-
sentations or warranties, expressed or implied, as to the accuracy or completeness of the information
contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall
have no liability for the consequences or use of such information or for any infringement of patents
or other rights of third parties that may result from its use. This document is not a commitment to
develop, release, or deliver any Material (defined below), code, or functionality.
NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any
other changes to this document, at any time without notice.
Customer should obtain the latest relevant information before placing orders and should verify that
such information is current and complete.
NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the
time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by
authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects
to applying any customer general terms and conditions with regards to the purchase of the NVIDIA
product referenced in this document. No contractual obligations are formed either directly or indirectly
by this document.
NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military,
aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA
product can reasonably be expected to result in personal injury, death, or property or environmental
damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or
applications and therefore such inclusion and/or use is at customer’s own risk.
NVIDIA makes no representation or warranty that products based on this document will be suitable for
any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA.
It is customer’s sole responsibility to evaluate and determine the applicability of any information con-
tained in this document, ensure the product is suitable and fit for the application planned by customer,
and perform the necessary testing for the application in order to avoid a default of the application or
the product. Weaknesses in customer’s product designs may affect the quality and reliability of the
NVIDIA product and may result in additional or different conditions and/or requirements beyond those
contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or prob-
lem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is
contrary to this document or (ii) customer product designs.
No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other
NVIDIA intellectual property right under this document. Information published by NVIDIA regarding
third-party products or services does not constitute a license from NVIDIA to use such products or
35
Nsight Eclipse Plugins Guide, Release 12.3
services or a warranty or endorsement thereof. Use of such information may require a license from a
third party under the patents or other intellectual property rights of the third party, or a license from
NVIDIA under the patents or other intellectual property rights of NVIDIA.
Reproduction of information in this document is permissible only if approved in advance by NVIDIA
in writing, reproduced without alteration and in full compliance with all applicable export laws and
regulations, and accompanied by all associated conditions, limitations, and notices.
THIS DOCUMENT AND 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 WAR-
RANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES,
INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CON-
SEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARIS-
ING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatso-
ever, NVIDIA’s aggregate and cumulative liability towards customer for the products described herein
shall be limited in accordance with the Terms of Sale for the product.
4.2. OpenCL
OpenCL is a trademark of Apple Inc. used under license to the Khronos Group Inc.
4.3. 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
©2016-2023, NVIDIA Corporation & affiliates. All rights reserved
36 Chapter 4. Notices