How to setup remote debugging in VS code (original) (raw)

Is it possible to debug a CUDA program remotely by using GUI in VSCode?
How to setup the environment such like launch.json properly?

Currently I do like this:
Firstly I start cuda-gdbserver on remote server

cuda-gdbserver localhost:2345 matmul_binary

Then I set launch.json like this `

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Remote CUDA Debugging",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/matmul_binary",  // Path to CUDA binary on remote
            "miDebuggerServerAddress": "localhost:2345",
            "miDebuggerPath": "/usr/local/cuda-12.6/bin/cuda-gdb",
            "cwd": "${workspaceFolder}",  // Remote working directory
            "setupCommands": [
                {
                    "text": "-enable-pretty-printing",
                    "description": "Enable GDB pretty printing",
                    "ignoreFailures": true
                }
            ],
            "externalConsole": true,
            "stopAtEntry": false,
            "args": [],
            "MIMode": "gdb",
        }
    ]
}

Finally I start debugging, but turns out that I cannot set break points inside kernel function or step into it.
What’s wrong with my current approach? How to properly debug CUDA program using GUI?

`

Hi you should install our Nsight Visual Studio Code Edition on your Linux machine, and this extension will use cuda-gdb to provide GUI debug experience.
Firstly you should install SSH Remote Extension and connect your Remote machine, then install our extension, and follow our document to setup your launch.json to start debugging.
Extension: Nsight Visual Studio Code Edition
Docs: nsight-visual-studio-code-edition

system Closed April 16, 2025, 9:38am 3

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