L
lead_dev

  • Jan 13, 2022
  • Joined Dec 14, 2021
  • 0 best answers
  • Luxonis-Lukasz running into a similar issue from earlier where it runs rgb_preview.py from the depthai-python directory but can't seem to find the device when running depthai_demo.py from the depthai directory. Had issues with qt as well but just downgraded to using openCV

  • Luxonis-Lukasz i'm using the image from the devel branch and was able to run rgb_preview successfully but encountered this issue when trying to run depthai_demo.py. I did already run python3 install_requirements.py and that did not resolve the issue. Please advise

    • Luxonis-Lukasz I normally have a difficult time with the dockerfiles because it always fails on the line

      RUN wget http://docs.luxonis.com/_static/install_dependencies.sh && chmod +x install_dependencies.sh && ./install_dependencies.sh

      and gives the same error as shown in the attached image. Also, I can run rgb_preview.py, however the dockerfile anytime I attempt to run depthai_demo.py using the depthai repo from within the container, it fails to run saying that a device could not be found.

    • I've actually been running into a similar issue. It looks like regardless of what I do, I keep getting the same issue to persist. My goal is to run both the rgb_preview and the deptahi_demo.py examples in the same docker container on my unbuntu desktop.

      I initially tried using the depthai-library image from (https://hub.docker.com/r/luxonis/depthai-library). When using that image, I was able to connect to my OAK-D and ran the rgb_preview.py example. However, when I tried cloning depthai.git and installing the requirements into the container to run depthai_demo.py, I'd get the following error:

      File "depthai_demo.py", line 18, in <module>
      from depthai_helpers.arg_manager import parseArgs
      File "/app/depthai/depthai_helpers/arg_manager.py", line 10, in <module>
      from depthai_sdk.previews import Previews
      File "/app/depthai/depthai_sdk/src/depthai_sdk/init.py", line 4, in <module>
      from .managers import *
      File "/app/depthai/depthai_sdk/src/depthai_sdk/managers/init.py", line 4, in <module>
      from .pipeline_manager import PipelineManager
      File "/app/depthai/depthai_sdk/src/depthai_sdk/managers/pipeline_manager.py", line 7, in <module>
      class PipelineManager:
      File "/app/depthai/depthai_sdk/src/depthai_sdk/managers/pipeline_manager.py", line 32, in PipelineManager
      _depthConfig = dai.StereoDepthConfig()
      AttributeError: module 'depthai' has no attribute 'StereoDepthConfig'

      Assuming some packages may have been missing, I created a dockerfile to install all the dependencies from install_dependencies.sh. However, when I tried to run depth_demo.py in a container, it gave the same issue.

      I then tried using the base image instead in my dockerfile, (https://hub.docker.com/r/luxonis/depthai-base). While I was no longer getting the error from before, I kept getting an error saying

      File "ColorCamera/rgb_preview.py", line 24, in <module>
      with dai.Device(pipeline) as device:
      RuntimeError: Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND

      and a similar error when I attempted to run depthai_demo.py. I tried including the following below to my docker file, however that didn't work either.

      RUN wget https://github.com/libusb/libusb/releases/download/v1.0.24/libusb-1.0.24.tar.bz2 && \
      tar xf libusb-1.0.24.tar.bz2 && \
      cd libusb-1.0.24 && \
      ./configure --disable-udev --prefix="$PWD/install_dir" && \
      make -j && \
      make install
      ENV LD_LIBRARY_PATH="$PWD/libusb-1.0.24/install_dir/lib":$LD_LIBRARY_PATH

      Then I tried using a python base image similar to https://github.com/luxonis/depthai-docker/blob/master/Dockerfile-depthai however it was missing all the dependencies. I went back and updated the dockerfile to include the install_dependencies.sh but ran into the same issue again where the device couldn't be found as shown below.

      File "depthai_demo.py", line 575, in run
      self.instance.run_all(self.conf)
      File "depthai_demo.py", line 76, in run_all
      self.setup(conf)
      File "depthai_demo.py", line 153, in setup
      self.device = dai.Device(self.pm.pipeline.getOpenVINOVersion(), self.deviceInfo, usb2Mode=self.conf.args.usbSpeed == "usb2")
      Failed to find device after booting, error message: X_LINK_DEVICE_NOT_FOUND

      All the containers used the same arguments of

      docker run --rm -it\
      --privileged \
      -v /dev/bus/usb:/dev/bus/usb \
      --device-cgroup-rule='c 189:* rmw' \
      -e DISPLAY=$DISPLAY \
      -v /tmp/.X11-unix:/tmp/.X11-unix \
      --entrypoint /bin/bash imageName

      Each dockerfile also included RUN echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | tee /etc/udev/rules.d/80-movidius.rules in case it wasn't set. I'm able to see the usb from within the container and even hear an initial click sometimes but it never connects to it.

      Please advise.