DISCLAIMER: This repository is not updated very frequently. Thus, some instructions may no longer apply.
This repository contains the code, scripts, and Dockerfiles for setting up different edge machine learning accelerators on different platforms.
-
A computer with an Intel/AMD x86-64 CPU running a 64-bit version of Linux with sudo priveleges (other OSes not tested).
-
- See A Note on Docker and Installing Docker
- For the Intel NCS2, Google Coral Edge TPU, and flashing the NVIDIA Jetson Nano.
- Optional to install on Raspberry Pi.
- Installed by default on Jetson Nano via SDK Manager.
-
Internet Access to install software dependencies.
Each device has its own requirements for cables, power supplies, and etc. These are listed in the Required Hardware sections of each device. The following are general requirements:
- Mouse, keyboard, and monitor (Raspberry Pi and Jetson Nano)
- A host computer with a CPU (Intel NCS2 and Google Coral Edge TPU)
- coraltpu - Google Coral Edge TPU setup instructions.
- jetson - NVIDIA Jetson Nano (2GB and 4GB) setup instructions.
- ncs2 - Intel Neural Computer Stick 2 setup instructions.
- raspberrypi - Raspberry Pi setup instructions.
Docker is a containerization software that is able to isolate applications and even operating systems. The idea of containers is similar to a Virtual Machine (VM), but without the hypervisor i.e. emulating the hardware which resource demanding. Instead, containers are able to directly work with the computer's hardware and kernel for making more efficient use of system resources than a VM.
Theoretically, all of these devices should work independent of using Docker and in many cases we observed they could. However, for the simplest setup, we recommend using Docker to prevent compatibility issues with your host computer's OS.
Many of the devices require sudo priveleges to install packages and to access the hardware directly. Thus, when running the docker image many of the commands use the --priveleged flag. Using this flag can have certain negative security implications. Please use this with care.
For basic docker CLI commands, users can refer to the Docker Cheat Sheet.
Here are a couple basic commands:
# Download a docker image from dockerhub.com
docker pull <repo>/<image_name>:<tag>
# List your local images
docker images
# List your local containers
docker container ls -a
# Run a docker image for the first time and create a named container
docker run --name <desired_name> -ti <docker_image> <command_to_run_in_container>
# Stop a docker container
docker stop <container_name>
# Start a docker container. ONLY RUN THIS ONCE
docker start -ai <container_name>
# Execute a command inside of the docker container
docker exec -ti <container_name> <command>
# Open a new bash shell in docker container
docker exec -ti <container_name> /bin/bash
# Copy between docker container and host
docker cp <host_filepath> <container_name>:<container_path>
docker cp <container_name>:<container_filepath> <host_path>Use the instructions from Docker's official documentation to install docker on your computer.
-
Ubuntu:
-
All other OS's:
Be sure to run sudo docker run hello-world to be sure your docker install was successful.
Note: You may need to use sudo docker to elevate permission on some OSes. You can avoid using sudo by adding your username to the docker group via the following command and logging out and back in:
sudo usermod -aG docker username