Summary

This article guides you through the process of remote-developing CUDA applications for the NVIDIA Jetson TK1, an ARM-based development kit, using NVIDIA Nsight Eclipse Edition. It covers setting up the development environment, importing and running CUDA samples, and debugging applications on the Jetson TK1.

Setting Up the Development Environment

NVIDIA Nsight Eclipse Edition is a full-featured, integrated development environment (IDE) that allows you to develop CUDA applications for both local (x86) systems and remote (x86 or ARM) targets. For cross-development needs, the Jetson TK1 comes prepopulated with Linux for Tegra (L4T), a modified Ubuntu Linux distribution provided by NVIDIA. This includes the CUDA Toolkit, OpenGL drivers, and the NVIDIA VisionWorks Toolkit, which can be downloaded from the Jetson TK1 Support Page.

Importing Your First Jetson TK1 CUDA Sample

  1. Launch Nsight: Start Nsight by typing nsight at the command line or by finding the Nsight icon in the Ubuntu dashboard.
  2. Create a New Project: Navigate to File->New->CUDA C/C++ Project and import an existing CUDA sample. For example, choose the Boxfilter sample under the Imaging category.
  3. Configure Project Settings: Select the GPU and CPU architectures. For the Jetson TK1, choose SM32 GPU binary code and SM30 PTX intermediate code. Then, choose the ARM architecture in the CPU architecture drop-down box.

Running Your First Jetson TK1 Application

  1. Setup Remote Target: Click on Run As->Remote C/C++ Application to setup the target system user and host address.
  2. Run the Application: Once the remote target system configuration is set up, click on the Run icon to run the boxfilter-arm binary on the Jetson TK1.
  3. Copy Data Files: Use the scp utility to copy data files from the data/ subfolder of the application to the /tmp/nsight-debug/data/ folder on your Jetson TK1.

Debugging Your First Jetson TK1 Application

  1. Disable GPU Timeouts: On your Jetson TK1, login as root and disable the GPU timeouts by running echo N > sys/kernel/debug/gk20a.0/timeouts_enabled.
  2. Launch the Debugger: Use the debug icon in Nsight to launch the debugger. Nsight will switch to its debugger perspective and break on the first instruction in the CPU code.
  3. Break on CUDA Kernels: Go to the breakpoint tab and select the “break on application kernel launches” feature to break on the first instruction of a CUDA kernel launch.

Profiling Your Application

  1. Create a Release Build: Go to the project settings and navigate to Properties->Build->Settings->Tool Settings->Debugging. Check the box that says “Generate line-number…” and click Apply.
  2. Run the Release Build: Click on the build hammer dropdown menu to create a release build. Then, click on Run As->Remote C/C++ Application to run the release build of the application.
  3. Profile the Application: Click on the profile icon dropdown and choose Profile Configurations. Select “Profile Remote Application” since the binary is already on the Jetson TK1.

Conclusion

NVIDIA Nsight Eclipse Edition provides a comprehensive environment for developing and debugging CUDA applications on the NVIDIA Jetson TK1. By following the steps outlined in this article, you can set up your development environment, import and run CUDA samples, and debug and profile your applications on the Jetson TK1. This guide aims to make the process of remote-developing CUDA applications for ARM-based development kits accessible and straightforward.