Problem with deepstream dockerfile in Jetson AGX Orin

I have a jetson agx orin with jetpack 5.0.2. So I am trying to build a docker image that starts from the deepstream image, but when I get to the execution of the deepstream app I get the following error as some files have not been found:

34.66 /usr/bin/ld: warning: libnvdla_compiler.so, needed by /lib/aarch64-linux-gnu/libnvinfer.so.8, not found (try using -rpath or -rpath-link)
34.66 /usr/bin/ld: warning: libnvmedia.so, needed by /lib/aarch64-linux-gnu/libnvinfer.so.8, not found (try using -rpath or -rpath-link)
34.66 /usr/bin/ld: warning: libnvmedia_tensor.so, needed by /lib/aarch64-linux-gnu/libnvinfer.so.8, not found (try using -rpath or -rpath-link)
34.66 /usr/bin/ld: warning: libnvmedia_dla.so, needed by /lib/aarch64-linux-gnu/libnvinfer.so.8, not found (try using -rpath or -rpath-link)
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorUnlock'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaEglStreamProducerGetTensor'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorEglStreamConsumerCreate'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaSetCurrentLoadable'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaDataUnregister'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaGetNumOfOutputTensors'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorEglStreamProducerPostMetaData'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::createWisdom()'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::ISoftMaxLayer::setAxis(int)'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaGetInputTensorDescriptor'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaLoadableCreate'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaEglStreamConsumerReleaseTensor'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::destroyWisdom(nvdla::IWisdom*)'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorLock'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorDestroy'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaGetMaxOutstandingTasks'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaLoadLoadable'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaEglStreamProducerPostTensor'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaGetOutputTensorDescriptor'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::INetwork::addSlice(nvdla::ITensor*, nvdla::Weights, nvdla::Weights, nvdla::Weights, nvdla::Weights, nvdla::SliceLayerMode)'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaDataRegister'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::IProfile::setUseSoftMaxOptz(bool)'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::IProfile::setCanCompressStructuredSparseWeights(bool)'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaEglStreamConsumerAcquireTensor'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaGetNumOfInputTensors'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::IPoolingLayer::setPoolingPaddingInclusionType(nvdla::PoolingPaddingInclusionType)'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorEglStreamConsumerAcquireMetaData'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::INetwork::addResize(nvdla::ITensor*, nvdla::ResizeMode, nvdla::Weights)'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDeviceDestroy'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaInit'
34.66 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorEglStreamProducerCreate'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaAppendLoadable'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorEglStreamProducerDestroy'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaRemoveLoadable'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDeviceCreate'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::destroyNetwork(nvdla::INetwork*)'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorGetMetaData'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaSubmit'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaDestroy'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaCreate'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorCreate'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaGetNumEngines'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorEglStreamConsumerDestroy'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `nvdla::createNetwork()'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaTensorGetStatus'
34.67 /usr/bin/ld: /lib/aarch64-linux-gnu/libnvinfer.so.8: undefined reference to `NvMediaDlaLoadableDestroy'
34.67 collect2: error: ld returned 1 exit status
34.67 make: *** [Makefile:75: deepstream-app] Error 1
------
Dockerfile:22
--------------------
  21 |     # deepstream-app -c /opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/source30_1080p_dec_infer-resnet_tiled_display_int8.txt 
  22 | >>> RUN cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-app && CUDA_VER=11.4 make && \
  23 | >>>     cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test1 && CUDA_VER=11.4 make
  24 |     
--------------------
ERROR: failed to solve: process "/bin/bash -c cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-app && CUDA_VER=11.4 make &&     cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test1 && CUDA_VER=11.4 make" did not complete successfully: exit code: 2

I have configured the default runtime to be Nvidia and I don’t know how to continue to solve the error

The dockerfile up to the failing instruction is as follows:

FROM nvcr.io/nvidia/deepstream-l4t:6.1.1-triton
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/nvidia/lib64:/usr/local/cuda/lib64
SHELL ["/bin/bash", "-c"] 

WORKDIR /opt/nvidia/deepstream/deepstream

RUN apt-get install -y x11-xserver-utils && \
    bash user_additional_install.sh && \
    apt-get install -y libssl1.1 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-alsa libgstrtspserver-1.0-0 libjansson4 libyaml-cpp-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstrtspserver-1.0-dev libx11-dev libjson-glib-dev libyaml-cpp-dev

RUN cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-app && CUDA_VER=11.4 make && \
    cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test1 && CUDA_VER=11.4 make

If anyone knows why this is, would you do me a favor if you help me, thanks in advance.

You sure you set your default docker runtime to nvidia? Check it once again just to make sure.

sudo docker info | grep 'Default Runtime'

If yes then can you check if indeed have the libnvmedia drivers on your host device?

sudo find /usr/lib/aarch64-linux-gnu/ | grep libnvmedia
or by running this
ll /usr/lib/aarch64-linux-gnu/tegra/libnvmedia*

I show you both outputs, but everything indicates that they are installed.

sudo docker info | grep 'Default Runtime'
 Default Runtime: nvidia
sudo find /usr/lib/aarch64-linux-gnu/ | grep libnvmedia
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_tensor.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedialdc.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_ide_sci.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_ide_parser.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_ijpe_sci.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_iofa_sci.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_sci_overlay.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_ijpd_sci.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_dla.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_isp_ext.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_iep_sci.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia_2d.so
/usr/lib/aarch64-linux-gnu/tegra/libnvmedia2d.so

please refer to this topic.

You need to the search for libnvmedia inside the docker container, in addition to looking for them on your jetson.
The reason I was asking you to do it host is that, if you have them installed in your jetson but they are not installed inside your docker container, you can simply mount it.
or just install it

Sorry for the late reply, Is this still an DeepStream issue to support? Thanks!

The problem continues, I have tried one thing and I find it quite curious, and that is that if I do docker build with all the instructions what I explained above happens, but if I only do the build with these instructions:

FROM nvcr.io/nvidia/deepstream-l4t:6.1.1-triton
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/nvidia/lib64:/usr/local/cuda/lib64
SHELL ["/bin/bash", "-c"] 

WORKDIR /opt/nvidia/deepstream/deepstream

RUN apt-get install -y x11-xserver-utils && \
    bash user_additional_install.sh && \
    apt-get install -y libssl1.1 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-alsa libgstrtspserver-1.0-0 libjansson4 libyaml-cpp-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstrtspserver-1.0-dev libx11-dev libjson-glib-dev libyaml-cpp-dev

and then I run the docker and execute the rest of the instructions inside (the instructions are the last step of the first dockerfile), then it does work, so I think it is related to the fact that it does not detect certain libraries and system files when building, but I also do not want to COPY all the jetson files So I don’t know how to solve it.

1 Like

What if you try to mount it?

.... -v /usr/lib/aarch64-linux-gnu:/usr/lib/aarch64-linux-gnu

Thanks @rajupadhyay59.
@darbygamer03 did you try the method above? .

The problem is that I’m trying to fix the error in docker build, where you can’t mount, apart from that I don’t think it’s a good solution since later it will happen again with another library located elsewhere (for example, if I use an instruction that needs the CUDA compiler in the dockerfile, it doesn’t link well to the CUDA files either.). Do you have any other ideas?

  1. it seems libnvmedia* existed but can’t be found. can you try ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/lib/aarch64-linux-gnu/tegra?
  2. could you share the result “ldd /lib/aarch64-linux-gnu/libnvinfer.so.8”? if libnvmedia.so is missing in the result, can you try “export LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/tegra:$LD_LIBRARY_PATH” and try again?

The output of ldd /lib/aarch64-linux-gnu/libnvinfer.so.8 is

linux-vdso.so.1 (0x0000ffffbd099000)
libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffffab6a1000)
libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffffab68d000)
librt.so.1 => /lib/aarch64-linux-gnu/librt.so.1 (0x0000ffffab675000)
libnvdla_compiler.so => /usr/lib/aarch64-linux-gnu/tegra/libnvdla_compiler.so (0x0000ffffaafd0000)
libEGL.so.1 => /lib/aarch64-linux-gnu/libEGL.so.1 (0x0000ffffaafac000)
libnvmedia.so => /usr/lib/aarch64-linux-gnu/tegra/libnvmedia.so (0x0000ffffaaf34000)
libnvmedia_tensor.so => /usr/lib/aarch64-linux-gnu/tegra/libnvmedia_tensor.so (0x0000ffffaaf13000)
libnvmedia_dla.so => /usr/lib/aarch64-linux-gnu/tegra/libnvmedia_dla.so (0x0000ffffaaef1000)
libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000ffffaad0c000)
libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffffaac61000)
libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffffaac3d000)
libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffffaaaca000)
/lib/ld-linux-aarch64.so.1 (0x0000ffffbd069000)
libnvos.so => /usr/lib/aarch64-linux-gnu/tegra/libnvos.so (0x0000ffffaaaaa000)
libGLdispatch.so.0 => /lib/aarch64-linux-gnu/libGLdispatch.so.0 (0x0000ffffaa91f000)
libnvvideo.so => /usr/lib/aarch64-linux-gnu/tegra/libnvvideo.so (0x0000ffffaa840000)
libnvsocsys.so => /usr/lib/aarch64-linux-gnu/tegra/libnvsocsys.so (0x0000ffffaa82c000)
libnvrm_mem.so => /usr/lib/aarch64-linux-gnu/tegra/libnvrm_mem.so (0x0000ffffaa814000)
libnvrm_host1x.so => /usr/lib/aarch64-linux-gnu/tegra/libnvrm_host1x.so (0x0000ffffaa7f3000)
libnvrm_surface.so => /usr/lib/aarch64-linux-gnu/tegra/libnvrm_surface.so (0x0000ffffaa7bd000)
libnvtvmr.so => /usr/lib/aarch64-linux-gnu/tegra/libnvtvmr.so (0x0000ffffaa6c6000)
libnvrm_chip.so => /usr/lib/aarch64-linux-gnu/tegra/libnvrm_chip.so (0x0000ffffaa6b2000)
libnvrm_sync.so => /usr/lib/aarch64-linux-gnu/tegra/libnvrm_sync.so (0x0000ffffaa69b000)
libnvdc.so => /usr/lib/aarch64-linux-gnu/tegra/libnvdc.so (0x0000ffffaa67b000)
libnvparser.so => /usr/lib/aarch64-linux-gnu/tegra/libnvparser.so (0x0000ffffaa631000)
libnvdla_runtime.so => /usr/lib/aarch64-linux-gnu/tegra/libnvdla_runtime.so (0x0000ffffaa5a7000)
libnvrm_stream.so => /usr/lib/aarch64-linux-gnu/tegra/libnvrm_stream.so (0x0000ffffaa58e000)
libnvsciipc.so => /usr/lib/aarch64-linux-gnu/tegra/libnvsciipc.so (0x0000ffffaa569000)
libnvimp.so => /usr/lib/aarch64-linux-gnu/tegra/libnvimp.so (0x0000ffffaa554000)

I have also modified the LD_LIBRARY_PATH variable and executed the docker build command without success, the same error appears. Any other idea? It’s something very strange and I don’t know why it happens.

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.
do you have this file “/etc/nvidia-container-runtime/host-files-for-container.d/l4t.csv”? which is used to file mapping.
did you execute the step2 “Instructions for installing nvidia-container from command line” in this link.

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