stereolabs / zed-docker

Docker images for the ZED SDK

Home Page:https://hub.docker.com/r/stereolabs/zed/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CUDART issue when creating a Dockerfile for zed-gstreamer

Dan-RT opened this issue · comments

HI,

I'm trying to create a image based on stereolabs/zed:3.5-runtime-jetson-jp4.5 that would have zed-gstreamer in it. It is running on an Jetson Xavier NX.

However I'm getting this CUDART error very similar to the CUDA error described in the Readme file in this repo:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: CUDA_CUDART_LIBRARY (ADVANCED)

I'm already using the cmake custom parameters in the cmake command:
cmake -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"

After some debugging I found out that cudart / libcudart.so is not in there: /usr/local/cuda/lib64/stubs

Thanks for your help!

Here is my Dockerfile:

# Specify the parent image from which we build
FROM stereolabs/zed:3.5-runtime-jetson-jp4.5

# Set the working directory
WORKDIR /app
EXPOSE 8554

RUN apt-get update && apt-get install -y apt-utils && apt-get install -y git
RUN apt-get install -y build-essential cmake libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstrtspserver-1.0-0 gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstrtspserver-1.0-dev

# Clone and build zed-gstreamer project 
RUN git clone https://github.com/stereolabs/zed-gstreamer.git

WORKDIR /app/zed-gstreamer

RUN mkdir build 
RUN cmake -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined" 
RUN make && make install
RUN gst-inspect-1.0 zedsrc && gst-inspect-1.0 zeddemux && gst-inspect-1.0 zeddatamux  && gst-inspect-1.0 zeddatacsvsink && gst-inspect-1.0 zedodoverlay

CMD ["gst-zed-rtsp-launch", "-p 8554 zedsrc stream-type=4 camera-resolution=1 ! videoconvert ! 'video/x-raw, format=(string)I420' ! x264enc ! rtph264pay pt=96 name=pay0"]

I had the same issue with another docker image based on cuda. I've solved it by setting default docker build runtime to "nvidia".

Here is an example config.

/etc/docker/daemon.json

{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    },
    "default-runtime": "nvidia"
}

sudo systemctl restart docker.service

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days