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?
`