I am trying to run the “nvgstiva_app” example from “Deepstream SDK on Jetson” in Nsight. And I am using “cross-compiler mode” in the Host x86 PC by following the tutorial as below:
And I am successfully to run the CUDA example in Jetson TX2. But when I try to run other example “nvgstiva_app” from Deepstream SDK on Jetson in Nsight. I get the error in the final NVCC Link step:
And the same error happened when I try to run the example from visionworks, I guess the key problem is how to link remote library in Jetson TX2 in Nsight. What I do is copy the whole /usr/lib/aarch64-linux-gnu to the x86 host PC. Then I set like this:
But I get the linker error: collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
And what is painful for all example in Jetson is based on makefile on Jetson directly rather than Nsight. So I find that is very difficult to transfer them to Nsight. Can anyone give me some suggestion about that? Thank you very much!
Not sure at all, but such a ld fault might be caused by out of memory (try adding swap) or disk full (check with df -H -T). You may also look to dmesg or syslog for further info.
Another alternative is to build the project directly on the device through Nsight interface. (If cross-compiler is not essential.)
Target Systems → Select remote connection → Manage → …
With this setting, Nsight will automatically sync your project to the device and build it right on the device.
It’s recommended to use this mode if lots of required libraries.
Hi AastaLLL:
Thank you for your advice!
Actually I have try to use sync mode to build on device directly. But even in this way, I should includes libraries in Nsight. Otherwise, there will be error for the project. The only way to solve that is using makefile on the device. If I check Generate Makefiles Automatically in Nsight, you should need a CUDA NVCC Compiler, and includes libraries manually. My question is if I use makefile on device which is provided by NVIDIA examples, can I debug CUDA in Nsight in X86 PC. What is the elegant way to use CUDA Compiler to debug in the sync mode? I find it is very difficult to transfer NVIDIA SDK examples to Nsight, except of CUDA examples. And what I am curious about is that How the Deepstream examples on Jetson is make by NVIDIA engineer. How to debug it? Without Nsight? Thanks!
Hi AastaLLL:
I was using Sync Mode as you said with the example’s makefile by unchecking generate makefiles automatically, now it could compile and execute in Jetson TX2. But anther problem comes out, the CUDA gdb could not stay in any breakpoint when I am trying to remotely debug on the device. I guess if the problem comes from the compile configuration in the makefile. Since if I am using cross compiler, there is no problem for CUDA gdb debug. But in the Sync Mode, I could only use makefile to compile that. Any idea on that?Thanks!