librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Docker image for using SR300

Open blackball opened this issue 8 years ago • 19 comments

Required Info
Camera Model { SR300 }
Firmware Version
Operating System & Version Linux
Kernel Version (Linux Only)
Platform
SDK Version

Issue Description

I wonder if there's any ready to use docker image for using SR300 and D400 series. If I need to do it myself, how do I enable the realsense device in the container ? Thanks!

blackball avatar May 10 '18 02:05 blackball

[Realsense Customer Engineering Team Comment] hi @blackball,

can you please explain more about docker image you mean? thanks.

I wonder how I can use SR300 inside a docker container, because my host OS doesn't have a matched kernel with SR300's driver.

blackball avatar May 14 '18 10:05 blackball

[Realsense Customer Engineering Team Comment] hi @blackball,

we don't have experience with docker, so maybe you can share your experience about building libRealsense on it? and which OS is your host OS? maybe we have something under /doc that you can refer to patch kernel or provide you some ideas.

[Realsense Customer Engineering Team Comment] Hello @blackball,

There is no ready to use docker image for RealSense Cameras. Docker does not provide access to the USB devices on the host system. If you insist on creating a virtual environment you may use a virtual machine. VMware Workstation Player works in emulating USB 3 layers, just be sure to add USB 3 devices to image prior to booting. Also note virtual machines are NOT recommended by RealSense team as this additional layer can impact the camera performance.

See this link for more details: https://github.com/IntelRealSense/librealsense/wiki/Troubleshooting-Q%26A#q-im-using-a-virtual-machine-and-the-camera-is-not-working

Thank you,

Nate W.

@RealSense-Customer-Engineering

"Docker does not provide access to the USB devices on the host system." This is not true.

blackball avatar May 25 '18 02:05 blackball

[Realsense Customer Engineering Team Comment] Hello Blackball,

With our initial research and testing, Docker requires additional steps within operating systems to add USB devices. If you are able to setup and run RealSense cameras on Docker please feel free to provide that information to this community. Of the Virtual Machine solutions, VMWare Workstation Player works the best in emulating USB 3 layers out of box; all that is needed is adding USB 3.0 usage prior to booting image. Again RealSense team does NOT recommend virtual machines because even on the best working emulator, USB 3.0 performance is severely decreased.

If you search on google, you can immediately find docker image for R200: https://hub.docker.com/r/mjenz/ros-realsense/.

blackball avatar May 30 '18 01:05 blackball

@blackball Blackball, I want to thank you for your question, we were able to create a docker image with LibRealSense samples.  You can try following directions posted here, along with pulling our docker container:  https://hub.docker.com/r/speechtesting11/ubuntu16.04_lrs3/ Docker pull command:  sudo docker pull speechtesting11/ubuntu16.04_lrs3

SR300 was tested and is able to run with app RealSense Viewer along with D400 series cameras. Please let us know if you have any other questions. Thank you.

njwardx avatar Jun 06 '18 16:06 njwardx

@njwardx

Thanks for working on this issue. I followed steps in the docker hub page. The RGB camera worked out of the box, but not the depth part.

Backend in rs2_open_multiple(sensor:0x7f6cc4000f80, profiles:0x7f6cc4317470, count:1): The requested pixel format 'INZI' is not natively supported by the Linux kernel and likely requires a > patch! Alternatively please upgrade to kernel 4.12 or later. Last Error: Inappropriate ioctl for device

Seems I need to patch the kernel.

blackball avatar Jun 07 '18 01:06 blackball

[Realsense Customer Engineering Team Comment] hi @blackball,

yes, from the message, you need to patch your kernel.

@njwardx can you provide the Dockerfile for the linked image? I'm really curious how the USB device is passed to the container!

Transmitt0r avatar Jun 19 '18 14:06 Transmitt0r

@Transmitt0r I didn't use a dockerfile I simply installed docker on Ubuntu and pulled Ubuntu base image and built LRS SDK with these commands:

sudo docker pull ubuntu

xhost local:root

sudo docker run ubuntu

sudo docker run -it ubuntu

Followed instructions here: https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md

Thank you.

njwardx avatar Jun 21 '18 18:06 njwardx

Here is the Dockerfile I built, if someone stumbles over this. I use it to run a Python 3.6 application with a GUI https://gist.github.com/Transmitt0r/698dac6946fd43be19b8f799f82f326e

Transmitt0r avatar Jun 25 '18 03:06 Transmitt0r

[Realsense Customer Engineering Team Comment] thanks @Transmitt0r for sharing. hi @Blackball, do you need more support on this topic?

@RealSense-Customer-Engineering No, Thanks.

blackball avatar Aug 05 '18 06:08 blackball

Here is the Dockerfile I built, if someone stumbles over this. I use it to run a Python 3.6 application with a GUI https://gist.github.com/Transmitt0r/698dac6946fd43be19b8f799f82f326e

@Transmitt0r - do you still have the dockerfile available? Looks like the link above is dead.

lauer2356 avatar Nov 08 '18 22:11 lauer2356

Does not work on macos. Still cannot identify the device ...

kmonachopoulos avatar Jan 07 '19 20:01 kmonachopoulos

@blackball Blackball, I want to thank you for your question, we were able to create a docker image with LibRealSense samples.  You can try following directions posted here, along with pulling our docker container:  https://hub.docker.com/r/speechtesting11/ubuntu16.04_lrs3/ Docker pull command:  sudo docker pull speechtesting11/ubuntu16.04_lrs3

SR300 was tested and is able to run with app RealSense Viewer along with D400 series cameras. Please let us know if you have any other questions. Thank you.

Would it be possible for you to share the parts of the Dockerfile that allowed to you install the RealSense2 library please?

ghost avatar Apr 09 '20 13:04 ghost

For future travelers....

  • Add apt sources for librealsense packages
  • On the host, install librealsense2-dkms
  • In the container, install everything else
  • Run the container (docker run) with --priveleged and -v /dev/:/dev/ with /bin/bash or whatever app you want to run at the end
  • If you're in a bash shell, try rs-fw-update -l
  • ?????
  • Profit

lucbettaieb avatar Dec 09 '20 21:12 lucbettaieb