How to configure Visual Studio Code for Nsight Visual Studio Code extension?

I have installed

  • Visual studio code
  • C/C++ Intellisense, debugging and code browser (extension)
  • C/C++ Extension Pack (extension)
  • NSight Visual Studio Code Edition (extension)

However, I am unable to build and debug. Basically, I don’t know how to setup launch.json and tasks.json

Can someone please share a document/guide for this?

Thanks & Regards,

NVIDIA has published documentation for Nsight Visual Studio Code. As a starting point for using NVSC, we recommend you download our CUDA samples, which come preconfigured with the required .json files to enable VSCE build and debug. Our CUDA samples are available on github:

Please refer to our Nsight Visual Studio Code documentation to help you get started with our samples:

@steveu Thank you for the quick help.

I am able to now build and debug using Visual Studio Code and Nsight VS Code extension.

Just wanted to mention that, I have to separately download “cuda-gdb” in linux (Ubuntu Manpage: cuda-gdb - The NVIDIA CUDA Debugger) to enable debugging. Before that, I was getting “unable to find cuda-gdb in undefined” error whenever I launched debugger.

Thank you for the update. As you’ve discovered, the extensions for Visual Studio Code do not install any of the required tools to build or debug CUDA. The dialog message clearly did not provide any guidance about the underlying issue of cuda-gdb being missing. An issue has been filed against Visual Studio Code Edition to improve the error message quality.

@steveu Thank you very much Steve!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.