Deepstream Docker container

Hi am trying to run a docker container with a deepstream application. THe application run fines on the host but it throws the follolwing error in docker :

free(): invalid pointer
Aborted (core dumped)

The application renders a single frame on the display and exits with the above message.

Following is my docker file:

FROM nvcr.io/nvidia/deepstream-l4t:4.0.1-19.09-samples

RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstrtspserver-1.0-dev libx11-dev

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libcurl4-openssl-dev libssl-dev uuid-dev libglib2.0 libglib2.0-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libglib2.0
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libglib2.0-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libjansson4
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libjansson-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y librdkafka1=0.11.3-1build1
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libopencv-dev
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libjson-glib-dev uuid-dev

RUN mkdir -p /opt/nvidia/deepstream/deepstream-4.0/sources/apps/sample_apps/DS4_App/
RUN mkdir -p /opt/nvidia/deepstream/deepstream-4.0/sources/includes/
RUN mkdir -p /opt/nvidia/deepstream/deepstream-4.0/samples/models/
COPY DS4_App/* /opt/nvidia/deepstream/deepstream-4.0/sources/apps/sample_apps/DS4_App/
COPY includes/* /opt/nvidia/deepstream/deepstream-4.0/sources/includes/
COPY models/ /opt/nvidia/deepstream/deepstream-4.0/samples/models/
RUN yes | cp -f /opt/nvidia/deepstream/deepstream-4.0/sources/apps/sample_apps/DS4_App/nvmsgconv.cpp /root/deepstream_sdk_v4.0.1_jetson/sources/libs/nvmsgconv/
WORKDIR /root/deepstream_sdk_v4.0.1_jetson/sources/libs/nvmsgconv/
RUN make && make install
WORKDIR /opt/nvidia/deepstream/deepstream-4.0/sources/apps/sample_apps/DS4_App/

RUN rm -f nvmsgconv.cpp
RUN mkdir custom_media && mkdir -p custom_media/frames/Camera0	 
RUN make clean
CMD make && ls -R custom_media && ./deepstream-test3-app 'rtsp://address/of/rtsp-stream'

Can anyone help me resolve this issue?

Hi,

Are you running the container with the command similar to this:

sudo docker run -it --rm --net=host --runtime nvidia  -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/deepstream-l4t:4.0.1-19.09-samples

Thanks.

Yes I am running this command:

sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix <image_name>

I am writing files to disk using a c code inside the docker container. Do I need to mount a different volume for that? If so how can I mount multiple volumes in a container?

Hi,

Could you check if this comment also works for you?
[url]https://devtalk.nvidia.com/default/topic/1062955/jetson-nano/unable-to-use-tensorrt-inside-the-l4t-base-container/post/5391772/#5391772[/url]

Thanks.