Debugging cross-compiled CUDA sample does not work

Hello everyone,

I am trying to remotely debug the CUDA matrix multiply (matrixMul) example in Eclipse Nsight. Simply running the executable works fine and the debugging also starts. But when I want to single-step through the instructions the function call

int dev = findCudaDevice(argc, (const char **)argv);

right in the beginning of the main function leads to this output in the console

Reading /usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1 from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvrm_gpu.so from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvrm.so from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvrm_graphics.so from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvidia-fatbinaryloader.so.32.1.0 from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvos.so from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1.1.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/.debug/libcuda.so.1.1.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvrm_gpu.so.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/.debug/libnvrm_gpu.so.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvrm.so.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/.debug/libnvrm.so.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvrm_graphics.so.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/.debug/libnvrm_graphics.so.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvidia-fatbinaryloader.so.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/.debug/libnvidia-fatbinaryloader.so.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/libnvos.so.debug from remote target...
Reading /usr/lib/aarch64-linux-gnu/tegra/.debug/libnvos.so.debug from remote target...

After that the application somehow hangs-up and I am not able to go on debugging.

Does anybody know a solution to this problem?

Thank you in advance!

Hi,

May I know which JetPack version do you use?

Please noticed that it’s required to execute CUDA tool(ex. cuda-gdb, nvprof, …) as root from CUDA-10.0.
It’s recommended to try it with root authority to see if works.

Thanks.

Hello, thanks for your reply.
I am using JetPack 4.2. I will try your suggestion.

Hello, I tried to start cuda-gdb as root user from NSight Eclipse but I recognized that I am not able to login as root over ssh. So I explicitly set a root password and changed PermitRootLogin in /etc/ssh/sshd_config to yes. Nonetheless, I am still not able to login as root via ssh. Do you have an idea concerning this issue?

Thanks!

I got it now. I forgot to uncomment the PermitRootLogin line in /etc/ssh/sshd_config. Now it works and I am able to debug everything.

Hi,

Good to know it works now!
Thanks for your feedback.

Thanks for the tip. I also had to type “xhosts +” into an Xavier shell to allow root to display when remote debugging.

Note that I needed to change the code to display on Display “:1” instead of “:0” as nothing shows up when “:0” is used.

#if defined(linux)
setenv (“DISPLAY”, “:1”, 0);
#endif

Hi
I used this article to succeed in remote debugging.
But another problem arises.

An error occurs at ‘glutInit (argc, argv);’ and the consol message is shown below…

No protocol specified
freeglut (/ root / cudaSample / Debug / cudaSample): failed to open display ': 0'

I changed the code to: 1 instead of: 0 and got the same error message.
How can I solve this?

Should I add “xhosts +”?
If so, can you tell me where to add it?
I do not know in detail because I am a beginner.

Thank you.

I’m stuck here too.
Did anyone ever solve this?