Public Repository

Last pushed: 2 months ago
Short Description
GPU-enabled TensorFlow on Ubuntu 16.04
Full Description

Summary of specs

  • Ubuntu 16.04.4 LTS (codename xenial)
  • NVIDIA GPU
  • TensorFlow 1.5 (GPU-enabled)
  • Anaconda 3-5.1.0 with Python 3.6.4
  • emacs-nox
  • wget
  • hyperopt

Install docker-ce and nvidia-docker

Visit https://docker.com for docker-ce and https://github.com/NVIDIA/nvidia-docker for nvidia-docker.

Installation of nvidia-docker on Xenial x86_64

If nvidia-docker 1.0 is installed, remove it and all existing GPU containers

docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker

Add the package repositories

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

Install nvidia-docker2 and reload the Docker daemon configuration

sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

Test nvidia-smi with the latest official CUDA image

docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi

Launch the latest TensorFlow-gpu container in batch mode

nvidia-docker run -it gcr.io/tensorflow/tensorflow:latest-gpu bash

Install packages

Once having entered the container in batch mode, run the following commands:

cd /home
apt-get update
apt-get install emacs-nox
apt-get install man
apt-get install wget
wget https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh
bash Anaconda3-5.1.0-Linux-x86_64.sh 
rm Anaconda3-5.1.0-Linux-x86_64.sh
export PATH="/root/anaconda3/bin:$PATH"
python -m pip install -U py-cpuinfo
pip install hyperopt
apt install libgl1-mesa-glx
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.5.0-cp36-cp36m-linux_x86_64.whl
pip install networkx==1.11

Commit the container to the image

docker commit <container ID> tfgpu
Docker Pull Command
Owner
housebunting