Cannot debug using nsight in vs code

I am having this error when I tried to debug : fatal: One or more CUDA devices cannot be used for debugging. Please consult the list of supported CUDA devices for more details. (error code = CUDBG_ERROR_INVALID_DEVICE(0xb).

Here my configuration:
VS code version 1.87 in Windows 11
Nsight install in vs code and jetson with the latest version
jetson AGX ORIN with jetpack 5.1.3
cuda 11.4 and 11.8
ssh remote (in vs code)
I run the sample find /usr/local/cuda-11.4/samples (which I moved in my home directory).

The program compile well and I can execute successfully but debug give always the same error (not to hit the breakpoint).
I tried with cuda-11.4 and cuda-11.8 same output.

Here my launch.json
“configurations”: [
“name”: “CUDA C++: Launch”,
“type”: “cuda-gdb”,
“request”: “launch”,
“program”: “${workspaceFolder}/matrixMul”,
“debuggerPath”: “/usr/local/cuda-11.8/bin/cuda-gdb”

Any help ?

Hi, @musshca.badinga

This seems a permission issue. Which user in ORIN is running cuda-gdb ?

Can you try execute “usermod -a -G debug ${user_name}”

Thank you for your reply.
I am using Jetson AGX Orin 64GB.

I try the command usermod -a -G debug jetson and I do not have anymore this error (error code = CUDBG_ERROR_INVALID_DEVICE(0xb).
But I still cannot debug inside of a Kernel function.
For example, when I try to go inside of this :

global_ void testKernel(int val)
printf(“[%d, %d]:\t\tValue is:%d\n”,
I have this windows :

Any idea ?

I think this is a expected error because this file is not available. Why do you want to see this file ?
Can you try cuda-gdb on Jetson board directly and see what happens. I think it may be some configuration error in Visual studio Code side.

Thank for your reply. I found the solution by adding a flag ‘-keep’ in nvcc compilation.
More info : Strange "No such file or directory" error in cuda-gdb - Stack Overflow
Now I can debug inside of kernel function.

Glad to know. Thanks for the update !

1 Like

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