Error: cross compiling sample on docker

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.4 (rev. 1)

Target Operating System
Linux

Hardware Platform
DRIVE AGX Orin Developer Kit (not sure its number)

SDK Manager Version
1.9.3.10904

Host Machine Version
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers

Hi. When I tried sample cross compiling on x86 DRIVE OS docker for Target System Linux aarch64 following this, the cmake and make fail.

First I execute this in docker:

cmake -B /home/nvidia/build-linux-aarch64 -DCMAKE_BUILD_TYPE=Release     -DCMAKE_TOOLCHAIN_FILE=/usr/local/driveworks/samples/cmake/Toolchain-V5L.cmake     -DVIBRANTE_PDK=/drive/drive-linux -S /usr/local/driveworks/samples

In the output ,there are a lot of similar warnings like the following saying there is a cycle in the constraint graph.

CMake Warning at src/calibration/radar/CMakeLists.txt:58 (add_executable):
  Cannot generate a safe runtime search path for target
  sample_calibration_radar because there is a cycle in the constraint graph:

    dir 0 is [/drive/drive-linux/filesystem/targetfs/usr/local/cuda/targets/aarch64-linux/lib/stubs]
      dir 2 must precede it due to runtime library [libcublasLt.so]
    dir 1 is [/drive/drive-linux/filesystem/targetfs/usr/local/driveworks/targets/aarch64-Linux/lib]
      dir 3 must precede it due to runtime library [libdw_base.so.5.6]
      dir 7 must precede it due to runtime library [libglfw.so]
    dir 2 is [/drive/drive-linux/filesystem/targetfs/usr/local/cuda/targets/aarch64-linux/lib]
    dir 3 is [/drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5.6/targets/aarch64-Linux/lib]
      dir 1 must precede it due to runtime library [libcupva_host.so]
      dir 7 must precede it due to runtime library [libglfw.so]
    dir 4 is [/usr/local/driveworks/samples/3rdparty/linux-aarch64/zlib/lib]
    dir 5 is [/drive/drive-linux/filesystem/targetfs/usr/local/driveworks/samples/3rdparty/linux-aarch64/vibrante/lib]
    dir 6 is [/drive/drive-linux/filesystem/targetfs/usr/local/driveworks/samples/3rdparty/linux-aarch64/vibrante_Xlibs/lib]
    dir 7 is [/home/nvidia/build-linux-aarch64/3rdparty/src/glfw]

  Some of these libraries may not be found correctly.

make also fails with such errors:

/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: warning: libnvinfer_safe.so.8, needed by /drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5.6/targets/aarch64-Linux/lib/libdw_dnn_base.so, not found (try using -rpath or -rpath-link)
/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: warning: libnvinfer_checker.so.8, needed by /drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5.6/targets/aarch64-Linux/lib/libdw_dnn_base.so, not found (try using -rpath or -rpath-link)
/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: warning: libnvinfer_builder_resource.so.8, needed by /drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5.6/targets/aarch64-Linux/lib/libdw_dnn_base.so, not found (try using -rpath or -rpath-link)
/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: warning: libcufft.so.10, needed by /drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5.6/targets/aarch64-Linux/lib/libdw_dnn_base.so, not found (try using -rpath or -rpath-link)
/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: warning: libnvrtc.so.11.2, needed by /drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5.6/targets/aarch64-Linux/lib/libdw_dnn_base.so, not found (try using -rpath or -rpath-link)
/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: warning: libnvrtc-builtins.so.11.4, needed by /drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5.6/targets/aarch64-Linux/lib/libdw_dnn_base.so, not found (try using -rpath or -rpath-link)
/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5.6/targets/aarch64-Linux/lib/libdw_dnn_base.so: undefined reference to `nvinfer1::safe::createInferRuntime(nvinfer1::ILogger&)'
/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /drive/drive-linux/filesystem/targetfs/usr/local/driveworks/targets/aarch64-Linux/lib/libdriveworks_visualization.so: undefined reference to `typeinfo for dw::sensors::camera::CameraVirtualRecording'
/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5.6/targets/aarch64-Linux/lib/libdw_dnn_base.so: undefined reference to `createConsistencyChecker_INTERNAL'
/drive/toolchains/aarch64--glibc--stable-2022.03-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/9.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /drive/drive-linux/filesystem/targetfs/usr/local/driveworks/targets/aarch64-Linux/lib/libdriveworks_visualization.so: undefined reference to `dw::image::addExternalAttributesToAttributesList(dwImageProperties*, dw::core::Context*, NvSciBufAttrListRec*)'

The complete output is here:
make.log (8.3 KB)
cmake.log (85.9 KB)

I also tried to compile those for x86 system, and it works fine. Only cross compiling fails.

Any help is appreciated, thanks in advance.

Best regards,

Please check out the discussion at Cross compile with docker missing files to see if it addresses your issue. Additionally, note that DRIVE OS 6.0.4 is an older release; consider upgrading to the latest version, 6.0.8.1, for better compatibility and support.

Hi, I checked that post, but I was quite confused. You said we should follow the the section Samples Binaries Installation before cross compiling, but it only gives instructions on how to install some extra driveworks deb packages on Target system, which is NVIDIA DRIVE. It seems that this instruction doesn’t install anything on Docker and therefore, I don’t think it will solve cross compiling problem on Docker.

Please try using the drive-agx-orin-linux-aarch64-sdk-build-x86:6.0.4.0-0004-patch-01 Docker image for your cross-compilation. This specific image might resolve the issues you’re experiencing with the current setup.

Hi thanks for the reply. But unfortunately I have been using 6.0.4.0-0004-patch-01 from the beginning.

Please try the following steps to resolve the issue:

rm -r /drive/drive-linux/filesystem/targetfs/usr/local/driveworks-5*
cp -r /usr/local/driveworks-5* /drive/drive-linux/filesystem/targetfs/usr/local/

Thanks. it works. So it seems that the driveworks libraries in targetfs lack some components?

Exactly, which is why we encourage developers to always use the latest release.

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