Cuda-gdb debug on jetson-orin nano

5.10.120-tegra #1 SMP PREEMPT Tue Aug 1 12:32:50 PDT 2023 aarch64 aarch64 aarch64 GNU/Linux

while running cuda-gdb on Jetson devices, it shows that i got the following errors.

How do i fix it or continue with the debugging?

https://docs.nvidia.com/cuda/cuda-gdb/index.html#walk-through-examples

From the walk-through guide even though cudaMalloc was called but it doesn’t seem to trigger fatal error.

I have done the below with the cuda-gdb guide for jetson-devices

### 3.1.2. Using the CUDA-GDB debugger on Jetson and Drive Tegra devices[](https://docs.nvidia.com/cuda/cuda-gdb/index.html#using-the-cuda-gdb-debugger-on-jetson-and-drive-tegra-devices)

By default, on Jetson and Drive Tegra devices, GPU debugging is supported only if `cuda-gdb` and `cuda-gdbserver` are launched by a user who is a member of the **debug** group.

To add the current user to the **debug** group run this command:

sudo usermod -a -G debug $USER

nvcc -O0 -g -std=c++17 -m64 -lm -lcudart -lpthread xxx.cu -o xxx_executable

Breakpoint 2, main (args=1, arglist=0xffffffffec78, environs=0xffffffffec88) at xxx.cu:59
59          cudaMalloc((void**)&d,sizeof(int)*0x100);

stepping over the instruction it errors out

(cuda-gdb) n
[Detaching after fork from child process 241798]
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)

Hi,

Do you run the profiler with sudo?
You will need root authority to catch the GPU trace.

Thanks

will explore that sudo permission, be back.

Tyvm

sudo cuda-gdb ./test_exe
[sudo] password for XXXX: 
sudo: cuda-gdb: command not found
which cuda-gdb
/usr/local/cuda-11.4/bin/cuda-gdb

Unable to run cuda-gdb as sudo

Hi,

When running a command with sudo, the environment setting changes to sudo’s account which might not export the CUDA binary folder to $PATH.
Please try it with sudo /usr/local/cuda-11.4/bin/cuda-gdb ./test_exe to avoid this issue.

Thanks.

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