In Movidius’s official documentation, Docker container is not an explicitly supported platform (as of Dec, 2017). Then I decided to test whether the NCS (Neural Compute Stick) can be accessed from a container. Benefiting from this discussion thread, I was able to run the ncsdk examples in a Docker container. Here are the steps I took to make it happen.
Note: I am an Intel employee but all options are on my own.
Prerequisites
My test environment:
- Host: Ubuntu 16.04.2
- Docker: docker-ce v17.09
- Movidius compute stick attached
Build Docker image with ncsdk installed
The Dockerfile I used to install the ncsdk and make the examples is based on instructions from hughdbrown. I created a repo and uploaded the Dockerfile and its config files to it. You may check this branch, and build the Docker image yourself. Run:
|
|
Note: The ncsdk installer currently does not honor any proxy setting options. Build the image without being behind a proxy or the build step may get stuck installing python dependencies from the internet.
Run ncsdk examples in Docker
The ncforum provided a way to run a Docker container which is accessible to the NCS. Host network mode is recommended to make the USB compute stick visible.
Some users have had USB related problems using the Intel NCS within a Docker environment. We have found that including the
--net=host
flag can help make the device manager events visible to libusb in a Docker environment.
Therefore, I used this command:
|
|
This leads to an interactive terminal in the container looking like this:
|
|
Inside the container, you can run the examples to test access to the NCS.
|
|
Check the result by looking at the command outputs, such as this:
|
|
You may continue to test the other model with different frameworks such as caffe and tensorflow under the examples
folder.
Comments welcome
This is quick example of using Docker containers to access the NCS. I welcome your comments and corrections.
References: