How to set sysroot for Nsight (GDB) to use

I am using Nsight to debug a project from a host computer (Ubuntu) to a Jetson machine (target). I get warnings saying to set sysroot to access files locally. I copied the file system from the Jetson to the host. I tried setting sysroot to the path of the copy using the command window, but I got the same warnings.

I can set sysroot when running cuda-gdb located here:

/usr/local/cuda-10.0/bin

However, if I close that and open Nsight Eclipse, sysroot is set back to target.

How can I set sysroot in Nsight Eclipse?

Below are the warnings:

Coalescing of the CUDA commands output is off.
warning: "remote:" is deprecated, use "target:" instead.
warning: sysroot set to "target://".
Reading /lib/ld-linux-aarch64.so.1 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /lib/ld-linux-aarch64.so.1 from remote target...
Reading /lib/ld-2.27.so from remote target...

Hi,

Did you login the device with root?
If not, would you mind to take it a try?
[url]No timeline for profiler Xavier: nvvp and nsight compute is not working in Jetson Xavier - Jetson AGX Xavier - NVIDIA Developer Forums

Thanks.

Hi,

Thank you for your response.

I logged in with root, which solved the hang up I had after this message.

Reading /usr/lib/aarch64-linux-gnu/tegra/.debug/libnvos.so.debug from remote target...

However, I still get the warnings in my original post.

It is instructing me to set sysroot. I want to do that so it looks for libraries on the host machine which has a copy of the Jetson. This will make the process faster.

I have tried editing the .cuda-gdbinit file by adding the “set sysroot” line. When I run cuda-gdb in the command line and then enter “show sysroot”, the path I set in the .cuda-gdbinit file shows up. However, when I run the debugger in Nsight Eclipse, I get the same warinings that sysroot is not set.

How do I set sysroot?

Hi,

It looks like this can be fixed with gdb-multiarch.
[url]https://github.com/cs01/gdbgui/issues/237[/url]

Would you mind to give it a try?

Thanks.

Were you actually able to fix the issue by compiling gdb-multiarch? As far as I can see, the problem of not being able to set sysroot is architecture independent. sysroot is set to “target://” even when both, local and remote architectures are the same.

I opened another post on this, but haven’t gotten any reply yet: Remote debugging: `CUDA GDB init file` is ignored

In case anyone of you found a way to avoid downloading all libraries at every debug run, your insights would be much eppreciated @AastaLLL @rishabh.choudhary

Hi,

warning: sysroot set to “target://”

The log above is a harmless warning.
Do you meet any issue from it?

Thanks.

Yes, in a remote debugging setup, it results in all libraries being copied over from the remote machine to the local machine, which can take a significant amount of time and is unnecessary since the code is compiled locally anyways (meaning all libraries are available locally). By setting sysroot to some local directory where the libraries can be found, one would not have to download anything. You can find some logs of the copying here: Remote debugging: `CUDA GDB init file` is ignored

I have opened a bug report about the CUDA GDB init file note being loaded in Remote Debugging configurations. This init file usually allows setting configuration such as sysroot. I haven’t found a way to change sysroot yet.

1 Like