Skip to content

Instantly share code, notes, and snippets.

@happyincent
Created December 5, 2018 16:45
Show Gist options
  • Save happyincent/3a5cd11753bc7f194e4103c743f38167 to your computer and use it in GitHub Desktop.
Save happyincent/3a5cd11753bc7f194e4103c743f38167 to your computer and use it in GitHub Desktop.
Enable the GPU within a docker container running on an NVIDIA Jetson TX2. ref: https://git.io/fp1ZW
version: '3'
services:
test:
container_name: test-tensorflow
image: ubuntu:test-tensorflow
build: .
restart: always
command: sh -c "ldconfig /usr/local/cuda/lib64/ /usr/lib/aarch64-linux-gnu/tegra/ && tail -f /dev/null"
volumes:
- '/usr/lib/aarch64-linux-gnu:/usr/lib/aarch64-linux-gnu'
- '/usr/local/cuda:/usr/local/cuda'
devices:
- '/dev/nvhost-ctrl:/dev/nvhost-ctrl'
- '/dev/nvhost-ctrl-gpu:/dev/nvhost-ctrl-gpu'
- '/dev/nvhost-prof-gpu:/dev/nvhost-prof-gpu'
- '/dev/nvmap:/dev/nvmap'
- '/dev/nvhost-gpu:/dev/nvhost-gpu'
- '/dev/nvhost-as-gpu'
@happyincent
Copy link
Author

happyincent commented Dec 5, 2018

Dockerfile:

FROM ubuntu:16.04

RUN apt update &&
apt install python3 python3-pip -y

RUN pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp33 tensorflow-gpu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment