Could not cross compile for jetson orin with repo https://repo.download.nvidia.com/jetson/x86_64/focal/dists/r35.1/

Hello,

We encountered some issues for crosscompiling to jetson orin r35.1 (as well as r35.2),

The cross-aarch64 nvidia repository doesn’t seem to contains any package providing :

  1. libnvinfer.so.8,
    Installing the libnvinfer8 on the jetson host repository package is nether possible as it is conflicting with cross-compile ones

  2. /usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1
    nvidia-l4t-cuda cannot be installed on non host target (preinst script check /proc/device-tree/compatible)

We do succed to crosscompile by :

  1. repackaging the libnvinfer8:arm64 package to libnvinfer8-cross-aarch64:amd64 with the following changes :
 diff -u <(dpkg -I libnvinfer8_8.4.1-1+cuda11.4_arm64.deb) <(dpkg -I libnvinfer8-cross-aarch64_8.4.1-1+cuda11.4_amd64.deb)
--- /dev/fd/63  2023-03-28 15:23:20.061243686 +0200
+++ /dev/fd/62  2023-03-28 15:23:20.061243686 +0200
@@ -1,16 +1,16 @@
  new Debian package, version 2.0.
- size 145034940 bytes: control archive=816 bytes.
-     474 bytes,    12 lines      control
+ size 145040548 bytes: control archive=820 bytes.
+     412 bytes,    12 lines      control
      400 bytes,     5 lines      md5sums
       67 bytes,     2 lines      shlibs
       73 bytes,     2 lines      triggers
- Package: libnvinfer8
+ Package: libnvinfer8-cross-aarch64
  Source: tensorrt
  Version: 8.4.1-1+cuda11.4
- Architecture: arm64
+ Architecture: amd64
  Maintainer: cudatools <cudatools@nvidia.com>
  Installed-Size: 490082
- Depends: libcudnn8, libcublas.so.11 | libcublas-11-1 | libcublas-11-0, libnvrtc.so.11.2 | libnvrtc.so.11.3 | libnvrtc.so.11.4 | cuda-nvrtc-11-1 | cuda-nvrtc-11-0
+ Depends: libcudnn8:arm64, libcublas-cross-aarch64-11-4, cuda-nvrtc-cross-aarch64-11-4
  Replaces: libnvinfer-doc (<< 8.4.1-1+cuda11.4)
  Section: multiverse/libs
  Priority: optional
  1. by repackaging nvidia-l4t-cuda:arm64, nvidia-l4t-core:arm64 and nvidia-l4t-3d-core:arm64 to **-cross-aarch64:amd64 with the following changes :
diff -u <(dpkg -I nvidia-l4t-cuda_35.1.0-20220825113828_arm64.deb) <(dpkg -I nvidia-l4t-cuda-cross-aarch64_35.1.0-20220825113828_amd64.deb)
--- /dev/fd/63  2023-03-28 17:35:56.441142466 +0200
+++ /dev/fd/62  2023-03-28 17:35:56.441142466 +0200
@@ -1,15 +1,15 @@
  new Debian package, version 2.0.
- size 4141402 bytes: control archive=10240 bytes.
-     371 bytes,    11 lines      control
+ size 2326888 bytes: control archive=1620 bytes.
+     433 bytes,    11 lines      control              LD}"
      322 bytes,     4 lines      md5sums              tform, quit."
     1787 bytes,    39 lines   *  postrm               #!/bin/bash
- Package: nvidia-l4t-cuda
+ Package: nvidia-l4t-cuda-cross-aarch64                                                                                                    41,14         52%
  Version: 35.1.0-20220825113828
- Architecture: arm64
+ Architecture: amd64
  Maintainer: NVIDIA Corporation
  Installed-Size: 22790
- Pre-Depends: nvidia-l4t-core (>> 35.1-0), nvidia-l4t-core (<< 35.2-0)
- Depends: libc6, nvidia-l4t-3d-core (= 35.1.0-20220825113828)
+ Pre-Depends: nvidia-l4t-core-cross-aarch64 (>> 35.1-0), nvidia-l4t-core-cross-aarch64 (<< 35.2-0)
+ Depends: libc6:arm64
  Section: libs
  Priority: standard
  Homepage: http://developer.nvidia.com/jetson
diff -u nvidia-l4t-core_35.1.0-20220825113828_arm64/DEBIAN/preinst nvidia-l4t-core-cross-aarch64_35.1.0-20220825113828_amd64/DEBIAN/preinst
--- nvidia-l4t-core_35.1.0-20220825113828_arm64/DEBIAN/preinst                 2022-08-25 20:38:28.000000000 +0200
+++ nvidia-l4t-core-cross-aarch64_35.1.0-20220825113828_amd64/DEBIAN/preinst   2023-03-28 16:46:28.993180217 +0200
@@ -38,7 +38,7 @@

 # Check platform compatibility
 compatible="yes"
-CHIP="$(tr '\0' ' ' < /proc/device-tree/compatible)"
+CHIP="tegra194"
 if [[ ${CHIP} =~ "tegra194" ]]; then
        if [ "${BUILD}" != "t186ref" ]; then
                compatible="no"
diff -u <(dpkg -I nvidia-l4t-core_35.1.0-20220825113828_arm64.deb) <(dpkg -I nvidia-l4t-core-cross-aarch64_35.1.0-20220825113828_amd64.deb)
--- /dev/fd/63  2023-03-28 15:33:58.629235562 +0200
+++ /dev/fd/62  2023-03-28 15:33:58.633235562 +0200
@@ -1,18 +1,18 @@
  new Debian package, version 2.0.
- size 3812510 bytes: control archive=20480 bytes.
+ size 2573940 bytes: control archive=3720 bytes.
       92 bytes,     3 lines      conffiles
-     363 bytes,    12 lines      control
+     419 bytes,    12 lines      control
     4391 bytes,    53 lines      md5sums
     1787 bytes,    39 lines   *  postrm               #!/bin/bash
     2791 bytes,    78 lines   *  preinst              #!/bin/bash
- Package: nvidia-l4t-core
+ Package: nvidia-l4t-core-cross-aarch64
  Version: 35.1.0-20220825113828
- Architecture: arm64
+ Architecture: amd64
  Maintainer: NVIDIA Corporation
  Installed-Size: 10422
- Depends: libc6, libegl1, libexpat1, libgcc1, libstdc++6
- Conflicts: nvidia-l4t-ccp-t186ref
- Replaces: nvidia-l4t-ccp-t186ref
+ Depends: libc6:arm64, libegl1:arm64, libexpat1:arm64, libgcc1:arm64, libstdc++6:arm64
+ Conflicts: nvidia-l4t-ccp-t186ref:arm64
+ Replaces: nvidia-l4t-ccp-t186ref:arm64
  Section: libs
  Priority: standard
  Homepage: http://developer.nvidia.com/jetson
 diff -u <(dpkg -I nvidia-l4t-3d-core_35.1.0-20220825113828_arm64.deb) <(dpkg -I nvidia-l4t-3d-core-cross-aarch64_35.1.0-20220825113828_amd64.deb)
--- /dev/fd/63  2023-03-28 16:18:27.149201614 +0200
+++ /dev/fd/62  2023-03-28 16:18:27.149201614 +0200
@@ -1,16 +1,16 @@
  new Debian package, version 2.0.
- size 65501106 bytes: control archive=20480 bytes.
-     611 bytes,    11 lines      control
+ size 45204980 bytes: control archive=2528 bytes.
+     719 bytes,    11 lines      control
     2063 bytes,    23 lines      md5sums
     1820 bytes,    35 lines   *  postinst             #!/bin/bash
     1787 bytes,    39 lines   *  postrm               #!/bin/bash
- Package: nvidia-l4t-3d-core
+ Package: nvidia-l4t-3d-core-cross-aarch64
  Version: 35.1.0-20220825113828
- Architecture: arm64
+ Architecture: amd64
  Maintainer: NVIDIA Corporation
  Installed-Size: 160854
- Pre-Depends: nvidia-l4t-core (>> 35.1-0), nvidia-l4t-core (<< 35.2-0)
- Depends: libc6, libegl1, libgcc1, libstdc++6, libx11-6, libxext6, nvidia-l4t-firmware (= 35.1.0-20220825113828), nvidia-l4t-init (= 35.1.0-20220825113828), nvidia-l4t-libvulkan (= 35.1.0-20220825113828), nvidia-l4t-wayland (= 35.1.0-20220825113828), nvidia-l4t-x11 (= 35.1.0-20220825113828)
+ Pre-Depends: nvidia-l4t-core-cross-aarch64 (>> 35.1-0), nvidia-l4t-core-cross-aarch64 (<< 35.2-0)
+ Depends: libc6:arm64, libegl1:arm64, libgcc1:arm64, libstdc++6:arm64, libx11-6:arm64, libxext6:arm64, nvidia-l4t-firmware:arm64 (= 35.1.0-20220825113828), nvidia-l4t-init:arm64 (= 35.1.0-20220825113828), nvidia-l4t-libvulkan:arm64 (= 35.1.0-20220825113828), nvidia-l4t-wayland:arm64 (= 35.1.0-20220825113828), nvidia-l4t-x11:arm64 (= 35.1.0-20220825113828)
  Section: graphics
  Priority: standard
  Homepage: http://developer.nvidia.com/jetson

Moreover, both cuda-cudart-11-4 and cuda-cudart-cross-aarch64-11-4 are present on the repository without any Breaks,Conflicts, Replace clause (They do conflict on each other)

Finally, their is no symlink /usr/local/cuda-11.4/targets/aarch64-linux/lib/stubs/libcudla.so{,.1} on package

Are we missing something ?

Thank you !

Hi, can you provide how to re-produce your issue on other machines?
Like the code and the building environment you are using.
Also, to make sure this issue only happens when doing cross compiling, are you able to compile the code natively on Jetson?

Yes, we do not have any issue for native compilation,

I will try to prepare you a sample to re-produce it.

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Hi, do you have any update on this topic, or do you still need help on it?