Launch the CUDA Debugger

NVIDIA® Nsight™ Application Development Environment for Heterogeneous Platforms, Visual Studio Edition 5.5 User Guide
Send Feedback


Make sure that the modules you intend to debug are built with the compiler generating debug symbols. If a module has no symbols, then debugging is disabled for all functions in that module.

CPU/GPU Debugging Support

The Legacy CUDA debugger only supports debugging GPU CUDA kernels.

You cannot debug CUDA code in a target process while simultaneously debugging the x86 code of the same process. Use a separate Visual Studio instance to debug the host portion of a target application. If you wish to debug the host portion of your CUDA application while the CUDA Debugger is attached, you must attach using a different Visual Studio instance.

Attaching the same instance of Visual Studio to debug both the host portion and the device portion of a target application will cause the debuggers to conflict. The result is that the target application and the CUDA Debugger hang while being blocked by operations of the native debugger.

The Next-Gen CUDA debugger allows you to debug both CPU and GPU code simultaneously.

Remote Debugging Support

The Legacy CUDA debugger supports local and remote debugging

The Next-Gen CUDA debugger only supports local debugging. Remote debugging is not currently supported.

Local Debugging

The NVIDIA Nsight tools support launching and debugging a program on a single system. Please see System Requirements for Nsight Software for more information. Please also refer to the Setup Local Debugging topic for configuring a debugging setup with multiple GPUs.

To configure a project for local debugging:

Note that this configuration only applies to the Legacy CUDA debugger.

The Next-Gen CUDA debugger does not currently support remote debugging and will always run as a local debugger.

  1. Start Visual Studio.
  2. Open a CUDA-based project.
  3. Right-click on the project name in the Solution Explorer, and choose Nsight User Properties. (As an alternative, you can also go to the Project menu > Nsight User Properties.)

  4. In the Connection name text field, type: localhost.
  5. Click OK.

To start the CUDA Debugger locally:

  1. On the host machine, go to the Nsight menu in Visual Studio.
  2. From the Nsight menu, select one of the following:
    1. Start CUDA Debugging (Next-Gen)
      • Supports Pascal and later hardware
      • Supports r387 and later drivers in TCC mode
      • Supports local CPU and GPU debugging
    2. Start CUDA Debugging (Legacy)
      • Supports Pascal (WDDM) and earlier hardware (WDDM and TCC)
      • Supports r384 and earlier drivers in TCC or WDDM mode
      • Supports remote GPU debugging
      • Supports late attach
    3. Alternatively, you can also choose to:

    4. Right-click on the project, and select Debug > Start CUDA Debugging (Legacy)/(Next-Gen)
    5. Click on the Start CUDA Debugging (Legacy)/(Next-Gen) toolbar icon.

      Show/hide this icon group by right-clicking on the Visual Studio toolbar and toggling Nsight CUDA Debug.

    6. Click on the Start CUDA Debugging (Legacy)/(Next-Gen) toolbar menu item.

      Show/hide this icon group by right-clicking on the Visual Studio toolbar and toggling Nsight Connections.

  3. If you started Legacy CUDA debugging:

Remote Debugging

If you are using the Next-Gen CUDA debugger:

Remote debugging isn’t currently supported. The target machine is assumed to be localhost. Please see Local Debugging.

You can launch and debug a program on any properly configured remote host. Please see How To: Install the Nsight Monitor and Setup Remote Debugging for more information on how to install and configure the NVIDIA Nsight tools on your remote machine.

To configure a project for remote debugging:
  1. Start Visual Studio.
  2. Open a CUDA-based project.
  3. Right-click on the project name in the Solution Explorer, and choose Nsight User Properties. (As an alternative, you can also go to the Project menu > Nsight User Properties.)
  4. In the Connection name field, replace localhost with the name of your target machine (the remote computer where the application to be debugged will run).

    This can be the IP address of the machine on your local network, or the machine name as recognized on your network.

    IMPORTANT: Do not use a mapped drive to specify the hostname. For example:

    WRONG: M:\

    CORRECT: jsmith.mydomain.com

  5. In the Working directory field, you can specify the directory you want the application to use.
    The default working directory is the project directory.
  6. Click OK button.

To start the CUDA Debugger remotely:

  1. Start the Nsight Monitor on the target machine (remote machine).
    1. From the Windows Start menu, select All Programs.
    2. Select NVIDIA Corporation > Nsight Visual Studio Edition 5.5 > Nsight Monitor.
  2. Optional: To abort the launch when a file fails to copy to the remote system, set the Abort on synchronize failure option to "True."
    1. From the Nsight menu select Nsight Options. The Nsight Options window opens.
    2. In the left hand pane, select Debugger.
    3. Under Launch section, set Abort on synchronize failure to True.
    4. Click OK button.
  3. From the Nsight menu in Visual Studio:
    1. Start CUDA Debugging (Legacy)
      • Supports Pascal (WDDM) and earlier hardware (WDDM and TCC)
      • Supports r384 and earlier drivers in TCC or WDDM mode
      • Supports remote GPU debugging
      • Supports late attach
    2. Note that Start CUDA Debugging (Next-Gen) does not currently support remote debugging. If launched, it will attempt to debug locally.
    3. Alternatively, you can also choose to:

    4. Right-click on the project, and select Debug > Start CUDA Debugging (Legacy)/(Next-Gen)
    5. Click on the Start CUDA Debugging (Legacy)/(Next-Gen) toolbar icon.

      Show/hide this icon group by right-clicking on the Visual Studio toolbar and toggling Nsight CUDA Debug.

    6. Click on the Start CUDA Debugging (Legacy)/(Next-Gen) toolbar menu item.

      Show/hide this icon group by right-clicking on the Visual Studio toolbar and toggling Nsight Connections.

  4. Legacy CUDA debugging start up:

NOTE: You cannot simultaneously perform CUDA debugging and x86 debugging of the same process when using the Legacy CUDA Debugger.


NVIDIA® GameWorks™ Documentation Rev. 1.0.180426 ©2014-2018. NVIDIA Corporation. All Rights Reserved.