depthai: Could not be recognized OAK-1 on Docker container
Description of the bug
I tried to use depthai with OAK-1 on Docker container. But, OAK-1 could not be recognized.
$ python3
>>> import depthai
>>> device = depthai.Device('', False)
XLink initialized.
Sending internal device firmware
Failed to boot the device: 1-ma2480, err code 3
depthai: Error initializing xlink
Steps to reproduce the bug
I upload my Dockerfile. https://gist.github.com/atinfinity/c3255077e23164438c19544687e05b84
System information (version)
Device
- OAK-1
Host
- Ubuntu 20.04 64bit
- Docker 19.03.13
Docker Container
- Ubuntu 18.04 64bit
- https://github.com/luxonis/depthai/tree/v0.4.0.0
Reference
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Document running DepthAI with Docker Resolves luxonis/depthai#295 — committed to luxonis/depthai-docs-website by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Publish gen2_develop Docker image Resolves luxonis/depthai#295 Build libusb without udev support in the container since udev is typically not run inside containers — committed to luxonis/depthai-python by pamolloy 3 years ago
- Document running DepthAI with Docker Resolves luxonis/depthai#295 — committed to luxonis/depthai-docs-website by pamolloy 3 years ago
- Merge pull request #295 from luxonis/fw_yolov5_and_stability FW YoloV5 support and stability updates — committed to constructiverealities/depthai by themarpe 3 years ago
Thanks @tomoaki0705 . And we are still discussing now how to do this the right way. Sorry about the delay.
@atinfinity - we just got this cleanly working so that you can use Docker now (theoretically) without issue. Sorry about the delay, this one turned out to be tricky! We will get updated instructions here shortly. I just saw this PR merge: https://github.com/luxonis/depthai-docs-website/pull/135/files
@atinfinity - so as an update we’re making a better Docker support system, you can see https://github.com/luxonis/depthai-docs-website/pull/115 .
@alex-luxonis Thank you for your quick reply! My issue is solved!
@yoneken It may be possible that the
udev
rules that would allow access to the USB device in user mode (withoutsudo
) are not installed.Could you try running these commands taken from our system dependencies install script:
In addition, please unplug and reinsert the USB cable after running the commands.
https://docs.luxonis.com/en/latest/pages/api/#installing-system-dependencies https://docs.luxonis.com/en/latest/_static/install_dependencies.sh
OK, we think we have summarized what we had iterated on internally and with a customer WRT getting Docker to work in a similar (same?) situation. We are now testing it. But in the meantime:
We think it boils down to: (For Linux as far as I know)
The following should configure, compile and install libusb without udev:
And at the end set the LD_LIBRARY_PATH to the installation directory.
We’re not exactly sure if that export will persist from docker build to docker usage - might rather replace with
ENV LD_LIBRARY_PATH="$PWD/install_dir/lib":$LD_LIBRARY_PATH
.@xtechnicianx is going through and testing/characterizing this.
Thanks and sorry about the delay. We have experience getting DepthAI working in Dockers, but I don’t think we have written it up yet. Slack (globally) was down today, which resulted in us not being able to discuss this as normal until now.
Will circle back. I think we can get the instructions written up soon.
And also, I wanted to say thanks for the great explanation/background here.
Thanks again, Brandon