Ubuntu 16.04LTSマシンに機械学習環境(docker, Nvidia-Docker, DIGITS等)を揃える
環境
PC(Ubuntu 16.04LTS)
インストールしたソフト
docker
公式の手順を参考にしてインストールした。
sudo apt-get update sudo apt-get install \ linux-image-extra-$(uname -r) \ linux-image-extra-virtual sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" sudo apt-get update sudo apt-get install docker-ce
インストールできたか確認
$ sudo docker -v
Docker version 17.06.0-ce, build 02c1d87
Hello Worldしてみる
$ sudo docker run hello-world Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/ For more examples and ideas, visit: https://docs.docker.com/engine/userguide/
sudo無しでdockerを使う設定は特に必要無いと思ったのでやっていない。
Nvidia Docker
リポジトリのReadme.mdの「Quick start」に従いインストールした。
wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb
インストールできたか確認。dockerコンテナ上からGPUにアクセスできている。
$ sudo nvidia-docker run --rm nvidia/cuda nvidia-smi Mon Jul 31 12:00:23 2017 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 375.82 Driver Version: 375.82 | |-------------------------------+----------------------+----------------------+ | 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 108... Off | 0000:65:00.0 Off | N/A | | 0% 40C P8 21W / 275W | 0MiB / 11170MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+
Nvidia Digits
公式を参考。nvidia-dockerでdigitsのイメージ落としてくるだけなので楽です。
$ sudo nvidia-docker run --name digits -d -p 5000:5000 nvidia/digits
起動したら「ホスト:5000」にブラウザでアクセスする