opendatacam

Install nvidia-docker (nvidia-container-toolkit or nvidia-docker2)

⚠️ Currently (Sep 2019) the nvidia-docker projects seems to be in an odd transition phase of supporting two slightly different ways of leveraging NVIDIA GPUs in docker containers. At the moment best practice seems to install both the nvidia-container-toolkit and the deprecated nvidia-docker2.

You can also refer directly to the guides on nvidia-container-toolkit or nvidia-docker2 on the wiki of nvidia-docker repository.

1. Hardware pre-requisite

2. Software pre-requisite

2.1 Install / Update Docker

Follow the official documentation: https://docs.docker.com/install/linux/docker-ce/ubuntu/

Verify Docker version:

docker version

# For example, output: API version: 1.4

2.2 Install / Update Nvidia driver

The following will also install CUDA along with latest nvidia driver, you don’t need it but it is the only “easy install” way we found.

Verify Nvidia drivers version:

nvidia-smi

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.67       Driver Version: 418.67       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1050    Off  | 00000000:02:00.0 Off |                  N/A |
| N/A   40C    P0     8W /  N/A |      0MiB /  2002MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+

3. Install nvidia-container-toolkit

# Add the package repositories
$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
$ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
$ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

# Install and reload Docker
$ sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
$ sudo systemctl restart docker
$ sudo docker run --gpus all nvidia/cuda:9.0-base nvidia-smi

# Should output something like
+----------------------------------------------------------+
| NVIDIA-SMI 418.87   Driver Version: 418.87 CUDA Version: 10.1
|-------------------------------+----------------------

🎉🎉🎉 You are ready to install OpenDataCam 🎉🎉🎉