Introduction to NVIDIA Nsight Visual Studio Code Edition

Welcome to NVIDIA Nsight Visual Studio Code Edition, a development environment for CUDA applications, integrated into Microsoft Visual Studion Code.

1. NVIDIA Nsight Visual Studio Code Edition User Guide

NVIDIA Nsight Visual Studio Code Edition (Nsight VSCE) extends the debugging capabilities of Microsoft Visual Studio Code to support GPU computing. NVIDIA Nsight™ VSCE is an extension to the Visual Studio Code IDE to bring CUDA, as a first class citizen, to a great IDE by providing:
  • Declarative language configuration for CUDA syntax highlighting, bracket matching, code folding, auto-indention, etc.

  • C++ language server extensions to support CUDA-specific language features.

  • Debugger adapter to provide CUDA debugging.

  • Debugger views to provide CUDA-specific debugging information.

  • IDE extensions to add productivity enhancements to the VS Code environment.

2. CUDA Debugger

The CUDA Debugger helps you debug applications that use the Compute Unified Device Architecture (CUDA). Along with debugging native CPU code, you can set breakpoints in CUDA source code, inspect memory, view the values of local variables, perform memory checks, as well as other common debugging tasks. You can use the CUDA Debugger with applications built with the CUDA Runtime (CUDART) API or with the CUDA Driver API.

3. Benefits

Higher Productivity

Using smart CUDA auto-code completion features improves the overall development experience and enables users to save time and effort when writing code.

Interactivity

Debugging with Nsight Visual Studio Code Edition provides diverse benefits, including code formatting, easy navigation through source code, displaying and interacting with different source files, building executables, and testing.

Remote Development Support

Nsight Visual Studio Code Edition enables developers to implement CUDA code in various cluster environments such as Virtual Machines or remote Docker containers. It also supports code development for Linux systems via the Remote – WSL extension.

4. Key Features

CUDA Syntax Highlighting for Code Development and Debugging

Edit code productively with syntax highlighting and IntelliSense for CUDA code. Auto-completion, go to definition, find references, rename symbols, and more all seamlessly work for kernel functions the same as they do for C++ functions.

CUDA Kernel Breakpoint Support and Kernel Execution Control

Break into a debugging session in CPU or GPU device code using standard breakpoints, including support for conditional breakpoints with expression evaluation. GUI controls allow you to step over, into, or out of statements in the source code, just like normal CPU debugging. Breakpoints are evaluated for every kernel thread and will halt execution when any thread encounters them.

GPU and Kernel State Inspection

Break into the debugger to see all the detailed information at any point in the application with GPU debugging support for register, variable, and call-stack. There is watchlist support to add specific variables of interest for tracking. Additionally, there are focus controls to manually select CUDA block and thread numbers to switch the debugger focus.

Notices

Notice

NVIDIA® Nsight™ Application Development Environment for Heterogeneous Platforms, Visual Studio Code Edition 2023.1.0 User GuideSend Feedback

THE INFORMATION IN THIS GUIDE AND ALL OTHER INFORMATION CONTAINED IN NVIDIA DOCUMENTATION REFERENCED IN THIS GUIDE IS PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE INFORMATION FOR THE PRODUCT, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative liability towards customer for the product described in this guide shall be limited in accordance with the NVIDIA terms and conditions of sale for the product.

THE NVIDIA PRODUCT DESCRIBED IN THIS GUIDE IS NOT FAULT TOLERANT AND IS NOT DESIGNED, MANUFACTURED OR INTENDED FOR USE IN CONNECTION WITH THE DESIGN, CONSTRUCTION, MAINTENANCE, AND/OR OPERATION OF ANY SYSTEM WHERE THE USE OR A FAILURE OF SUCH SYSTEM COULD RESULT IN A SITUATION THAT THREATENS THE SAFETY OF HUMAN LIFE OR SEVERE PHYSICAL HARM OR PROPERTY DAMAGE (INCLUDING, FOR EXAMPLE, USE IN CONNECTION WITH ANY NUCLEAR, AVIONICS, LIFE SUPPORT OR OTHER LIFE CRITICAL APPLICATION). NVIDIA EXPRESSLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR SUCH HIGH RISK USES. NVIDIA SHALL NOT BE LIABLE TO CUSTOMER OR ANY THIRD PARTY, IN WHOLE OR IN PART, FOR ANY CLAIMS OR DAMAGES ARISING FROM SUCH HIGH RISK USES.

NVIDIA makes no representation or warranty that the product described in this guide will be suitable for any specified use without further testing or modification. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s sole responsibility to ensure the product is suitable and fit for the application planned by customer and to do 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 guide. NVIDIA does not accept any liability related to any default, damage, costs or problem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is contrary to this guide, or (ii) customer product designs.

Other than the right for customer to use the information in this guide with the product, no other license, either expressed or implied, is hereby granted by NVIDIA under this guide. Reproduction of information in this guide is permissible only if reproduction is approved by NVIDIA in writing, is reproduced without alteration, and is accompanied by all associated conditions, limitations, and notices.

Trademarks

NVIDIA, the NVIDIA logo, and cuBLAS, CUDA, CUDA-GDB, CUDA-MEMCHECK, cuDNN, cuFFT, cuSPARSE, DIGITS, DGX, DGX-1, DGX Station, NVIDIA DRIVE, NVIDIA DRIVE AGX, NVIDIA DRIVE Software, NVIDIA DRIVE OS, NVIDIA Developer Zone (aka "DevZone"), GRID, Jetson, NVIDIA Jetson Nano, NVIDIA Jetson AGX Xavier, NVIDIA Jetson TX2, NVIDIA Jetson TX2i, NVIDIA Jetson TX1, NVIDIA Jetson TK1, Kepler, NGX, NVIDIA GPU Cloud, Maxwell, Multimedia API, NCCL, NVIDIA Nsight Compute, NVIDIA Nsight Eclipse Edition, NVIDIA Nsight Graphics, NVIDIA Nsight Integration, NVIDIA Nsight Systems, NVIDIA Nsight Visual Studio Edition, NVIDIA Nsight Visual Studio Code Edition, NVLink, nvprof, Pascal, NVIDIA SDK Manager, Tegra, TensorRT, Tesla, Visual Profiler, VisionWorks and Volta are trademarks and/or registered trademarks of NVIDIA Corporation in the United States and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.