Cross-compiling for Jetson NX – linker fails to find VPI library (but it is there)

Hello, we are setting up a Jetson NX application for cross-compilation on an x86 Ubuntu 18.04.6 LTS host. We have set up JetPack 4.6 on both host and target. The application is created from Nsight Eclipse using File->New->CUDA C/C++ Project. Then we add a new target system for Aarch64 (a NX dev kit connected to the host).

We want to use VPI in the application, so we started to add some test code for this. The VPI include files were found without having to change any project settings at all, so the cross-compilation works fine directly. The problem begins at the linker stage.

The VPI library is located here on the host:
/opt/nvidia/vpi1/targets/aarch64-l4t/lib64/libnvvpi.so

We added under Project Properties->Build->Settings->Tool Settings->NVCC Linker->Libraries:

Libraries (-l) = libnvvpi
Library search path (-L) = /opt/nvidia/vpi1/targets/aarch64-l4t/lib64

But the linker does not find the VPI library:

Invoking: NVCC Linker
/usr/local/cuda-10.2/bin/nvcc --cudart static -L/opt/nvidia/vpi1/targets/aarch64-l4t/lib64 --relocatable-device-code=false -gencode arch=compute_72,code=compute_72 -gencode arch=compute_72,code=sm_72 -m64 -ccbin aarch64-linux-gnu-g++ -link -o  "vpiTest1"  ./src/vpiTest1.o   -llibnvvpi
/usr/lib/gcc-cross/aarch64-linux-gnu/7/../../../../aarch64-linux-gnu/bin/ld: cannot find -llibnvvpi
collect2: error: ld returned 1 exit status

Does anyone have an idea why this does not work? We have tried microtuning the syntax with slashes and extension here and there but nothing seems to help.

We found a work-around. If one skips the -l/-L settings and add the whole library path under ->Miscellaneous->Other objects it works.

Invoking: NVCC Linker
/usr/local/cuda-10.2/bin/nvcc --cudart static --relocatable-device-code=false -gencode arch=compute_72,code=compute_72 -gencode arch=compute_72,code=sm_72 -m64 -ccbin aarch64-linux-gnu-g++ -link -o  "vpiTest1"  ./src/vpiTest1.o  /opt/nvidia/vpi1/targets/aarch64-l4t/lib64/libnvvpi.so 
Finished building target: vpiTest1

But it would be much better if the -l/-L switches worked as expected.

Hi,

It looks like some issue in the configuration:

/usr/local/cuda-10.2/bin/nvcc ... -llibnvvpi

Would you mind trying below to see if it works?

Libraries (-l) = nvvpi

Thanks.

Yes, it worked!

Thanks for the help, it will be much easier to manage the project settings this way.

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