Libcuda.so: file not recognized: File truncated when make during a docker build

Hi, I’m currently using nvcr.io/nvidia/deepstream-l4t:5.1-21.02-samples to build my own docker image. But I need to make my app during the build of this DockerFile with “RUN make” and it returns an error… Here is a simplified DockerFile (I know that some libs are missing) that gives the same error :

FROM nvcr.io/nvidia/deepstream-l4t:5.1-21.02-samples
RUN apt-get update && apt-get update -y ; \
    apt-get install -y make ; \
    apt-get install -y libgstreamer-plugins-base1.0-dev ; \
    apt-get install -y libgstreamer1.0-dev ; \
    apt-get install -y libgstrtspserver-1.0-dev ; \
    apt-get install -y libx11-dev ; \
    apt-get install -y gcc ; \
    apt-get install -y git ; \
    apt-get install -y libgstreamer-plugins-base1.0-dev ; \
    apt-get install -y libgstreamer1.0-dev ; \
    apt-get install -y libgstrtspserver-1.0-dev ; \
    apt-get install -y libx11-dev ; \
    apt-get install -y libjson-glib-dev ; \
    apt-get install -y libssl-dev ; \
    cd /opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/ ; \
    sed -i 's/?=/:=10.2/g' Makefile ; \
    make
ENTRYPOINT /bin/bash

The error is :

/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lnvdsgst_meta
/usr/bin/ld: cannot find -lnvds_meta
/usr/bin/ld: cannot find -lnvdsgst_helper
/usr/bin/ld: cannot find -lnvdsgst_smartrecord
/usr/bin/ld: cannot find -lnvds_utils
/usr/bin/ld: cannot find -lnvds_msgbroker
/usr/lib/gcc/aarch64-linux-gnu/7/../../../aarch64-linux-gnu/libcuda.so: file not recognized: File truncated
collect2: error: ld returned 1 exit status
Makefile:71: recipe for target 'deepstream-test5-app' failed
make: *** [deepstream-test5-app] Error 1
The command '/bin/sh -c apt-get update && apt-get update -y ;     apt-get install -y make ;     apt-get install -y libgstreamer-plugins-base1.0-dev ;     apt-get install -y libgstreamer1.0-dev ;     apt-get install -y libgstrtspserver-1.0-dev ;     apt-get install -y libx11-dev ;     apt-get install -y gcc ;     apt-get install -y git ;     apt-get install -y libgstreamer-plugins-base1.0-dev ;     apt-get install -y libgstreamer1.0-dev ;     apt-get install -y libgstrtspserver-1.0-dev ;     apt-get install -y libx11-dev ;     apt-get install -y libjson-glib-dev ;     apt-get install -y libssl-dev ;     cd /opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test5/ ;     sed -i 's/?=/:=10.2/g' Makefile ;     make' returned a non-zero code: 2

Here are the full logs :

logs.txt (109.5 KB)

Is this normal that the make cannot access to libcuda.so when building the DockerFile, but when running it with “ENTRYPOINT make” instead it works ?

I’m using :

Deepstream 5.1
Jetpack 4.5.1

I am having the same issue. Did you manage to resolve this problem?

Regards,
Patrick

I’m still having the problem… Even if it’s slower, I’m executing the “make” in an Entrypoint.

Hope someone will find a solution or an answer to this topic.