How to use docker compose with NVIDIA Jetson
Overview
- Introducing how to use docker compose with GPU on NVIDIA Jetson
- Conditions
- JetPack 4.3 or later (because nvidia-docker must be available)
Environment
Install docker-compose main unit on the host side with the following command.
$ sudo apt install python3-pip
$ sudo apt install build-essential libssl-dev libffi-dev python3-dev
$ sudo pip3 install docker-compose
How to use
- Points
- Note the version specification of docker-compose.yaml
- docker-compose v1.26 or earlier
- Since runtime is supported only in ver.2 system, it is described in ver.2 system.
- docker-compose v1.27 or later
- Runtime support for both ver.2 and ver.3 (https://github.com/docker/compose/issues/6239)
- Specify "nvidia" in "runtime" tag
- Specify "NVIDIA_VISIBLE_DEVICES = all" in the "environment" tag
- Environment variables that enable all GPUs
docker-compose.yml (docker-compose v1.27 or later)
version: '3'
services:
test:
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
Example
Run the Nbody sample with docker-compose.
https://github.com/ntrlmt/jetson-nbody-docker-compose
reference
https://qiita.com/sht47/items/0706f19c67eb30e0954f