Visual Studio Code Cuda



There are many CUDA code samples included as part of the CUDA Toolkit to help you get started on the path of writing software with CUDA C/C++

The code samples covers a wide range of applications and techniques, including:

  • Simple techniques demonstrating
    • Basic approaches to GPU Computing
    • Best practices for the most important features
    • Working efficiently with custom data types
    • Quickly integrating GPU acceleration into C and C++ applications
  • How-To examples covering topics such as:
    • Adding support for GPU-accelerated libraries to an application
    • Using features such as Zero-Copy Memory, Asynchronous Data Transfers, Unified Virtual Addressing, Peer-to-Peer Communication, Concurrent Kernels, and more
    • Sharing data between CUDA and Direct3D/OpenGL graphics APIs (interoperability)
  • cellpadding='0' cellspacing='0'>

All of the code samples are available under a permissive license that allows you to freely incorporate them into your applications and create derivative works for commercial, academic, or personal use.

There are many CUDA code samples included as part of the CUDA Toolkit to help you get started on the path of writing software with CUDA C/C The code samples covers a wide range of applications and techniques, including: Simple techniques demonstrating Basic approaches to GPU Computing Best practices for the most important features Working efficiently with custom data types. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.

References

For compute developers working in Eclipse development environment, please see Nsight Eclipse Edition

CodeCode

NVIDIA® Nsight™ Visual Studio Edition is an application development environment for heterogeneous platforms which brings GPU computing into Microsoft Visual Studio. NVIDIA Nsight™ VSE allows you to build and debug integrated GPU kernels and native CPU code as well as inspect the state of the GPU and memory.

Download 2021.1.0
Version 2021.1 New Features | Revision History
NVIDIA® Nsight™ Visual Studio Edition is freely offered through the NVIDIA Registered Developer Program and as part of the CUDA Toolkit


Debugging in Optix Applications in Nsight Visual Studio Edition

Gallery

Nsight Visual Studio Edition CUDA Debugger Key Features

  • Debug your CUDA C/C++ source code directly on the latest GPU hardware
  • Debug native Visual Studio CPU and CUDA GPU code within the same debugging session
  • Use the familiar Visual Studio Locals, Watches, Memory and Breakpoints windows
  • Inspect the CUDA kernel state using customs views for GPU registers, warps, lanes, and threads for navigating massively parallel threads states and contexts

Nsight Visual Studio Edition CUDA Debugger Watch Window

  • View Source variables, PTX & SASS registers in Locals & Watch Views
  • Expressions supported in Watch view
  • Updated variables are displayed with red font
  • Struct/Vector/Array contents display on a single line
  • Array max length settings
  • Error messages for out–of-scope or invalid expressions

Nsight Visual Studio Edition CUDA Debugger Source Code View

  • View correlated Source, PTX, and SASS
  • Set breakpoints in Source and/or SASS
  • Step over, in, out, continue in source or PTX/SASS disassembly
  • Conditional breakpoints operate on source vars and PTX/SASS regs
  • Hover over variables and registers to view values

Nsight Visual Studio Edition CUDA Debugger Breakpoints View

  • Supported Breakpoints for Native(CPU) and CUDA C/C++ code, including
    Source, SASS, Function, Conditional, Data
  • Full GPU and CPU State provided while at breakpoint
  • Process and Thread selection available
  • Conditional breakpoints operate on source vars and PTX/SASS regs

Nsight Visual Studio Edition CUDA Debugger Warp Info View

  • Warp Info shows the active warps on the GPU, one warp per row
  • Arrow indicates the in-focus thread, providing state for the rest of the views
  • Focus warp (row) or thread can be changed with a mouse click to provide further state inspection (unless warp is unlaunched/done)
  • Various ‘Freeze Modes’ to for run control of other warps
  • Warps are color coded to indicate their state
  • Filtering can be done to minimize warp results
  • Columns Not shown (PC, ActiveMask, HitMask, Status)

Visual Studio Compile Cuda Code

Nsight Visual Studio Edition CUDA Debugger GPU Registers View

  • Inspect PTX, SASS, Predicate, Conditional, and Uniform registers at this configurable GPU Register view
  • Visual Studio register view can also be configured to show GPU registers
  • This view can be configured to hide/show registers sets
  • Always hides registers that are not supported by the architecture (Not a Turing GPU, so no Uniform registers shown)
  • Can select and copy-to-clipboard
  • Red text indicates updated values

Cuda Without Visual Studio

More NVIDIA DevTools Visual Studio Integration

NVIDIA Nsight Integration (highlighted) under the Nsight menu


NVIDIA Nsight Developer Tools Integration for Visual Studio

In Nsight VSE 2021.1, the integrated Graphics Frame Debuggers and integrated Profilers have been removed, but don't worry, you haven't lost this functionality.
NVIDIA Nsight Integration is a Visual Studio extension that allows you to access the power of the following NVIDIA Nsight standalone tools from within Visual Studio.

  • Nsight Compute : CUDA application interactive kernel profiler
  • Nsight Graphics : Graphics application frame debugger and profiler
  • Nsight Systems : System-wide performance analysis tool

When any of these tools are installed along with NVIDIA Nsight Integration, these tools will appear under the NVIDIA 'Nsight' menu in the Visual Studio menu bar.

Visual Studio Code Cuda Tutorial

More Nsight Visual Studio Edition Information

  • Downloads

    Download the latest version and corresponding dependencies

  • NVIDIA Developer Resources (Sign up required)

    Access the latest announcements, early release candidate access, file bugs, event invites and more. Sign up today!

  • Product Features

    List of features of Nsight Visual Studio Edition

  • Product Requirements

    Details the hardware and software support of Nsight Visual Studio Edition

  • Support and Documentation

    User Guide, Documentation, Forums, and more

  • Videos

    Teaser and Instructional Videos showing Nsight Visual Studio Edition in action

  • Webinars

    Past Nsight Visual Studio Edition Webinars