Can't get any part of the extension to work

Hi, I just recently learned of the VSCE of NVIDIA Nsight, and as a cuda developer working with VS code, it sounded great! I watched some of the videos, followed the installation instructions here:
https://docs.nvidia.com/nsight-visual-studio-code-edition/install-setup/index.html

but can’t seem to get any features of the extension to work (no syntax highlighting, no intellisense, debugger won’t even start). Is there any additional information on how to help set this up? The extension seems incredibly useful, but I can’t seem to get it to work, despite satisfying the indicated requirements.

My machine info is:
Ubuntu 20.04
CUDA toolkit 11.3 + GTX 1080 Ti
Driver: NVIDIA 465.19.01
VS code 1.57.1 with C/C++ extension 1.4.1

version of NSight VSCE installed: v2021.1.30087489

1 Like

For additional information on the debug configuration (the main feature I hope to use in this extension), the relevant part of my launch.json is given below:

    "configurations": [
        {
            "name": "CUDA C++: Launch",
            "type": "cuda-gdb",
            "request": "launch",
            "program": "/path/to/my/executable"
        }
    ]

When doing Run > Start Debugging (F5), the terminal output indicates that it is trying to rebuild the executable in question before debugging:

[main] Building folder: my_executable
[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /home/sam/code/example/build --config Debug --target my_executable
[build] ninja: no work to do.
[build] Build finished with exit code 0

and then stops. Nothing happens after that.

A few questions:

  1. Do you have vscode-cpptools installed? It provides the Intellisense support.

  2. What language do you have selected (see the status bar in VS Code)? You will need to have CUDA C++ selected.

  3. In the VS Code debug tab, which configuration do you have selected (see drop-down at the top)?

  1. Yes, vscode-cpptools extension is installed with version 1.4.1
  2. I have it set to auto-detect, which was apparently still seeing .cu files as C++ rather than cuda. Setting it to CUDA C++ manually does seem to address the syntax highlighting issue. It would be nicer if it would automatically know that .cu / .cuh are CUDA C++, but the manual workaround is still an improvement!
  3. In the debug tab, I have selected the configuration corresponding to the launch.json provided above, labeled “CUDA C++: Launch”

Is there any output in the other windows apart from the terminal output? In particular, the Debug Console?

The debug console was printing that cuda-gdb could not be found, despite it being on my PATH. But, running cuda-gdb from the command line revealed that it was missing some shared libraries. After installing those two shared libraries again (libtinfo.so.5, libncursesw.so.5), cuda-gdb from the command line works, and so does the VSCE of NVIDIA Nsight!

Thank you @Elton for the help.

For the sake of completeness, I used locate libxxxx to find out that those two libraries existed in other places on my machine already. Then, I copied them to /usr/lib/x86_64_linux_gnu/ (which is in my LD_LIBRARY_PATH), and then cuda-gdb was working again.

Glad to see you have it working now, let us know if anything else comes up!

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