ホーム » 2016 » 8月

月別アーカイブ: 8月 2016

How to Install docker

Installation docker of Ubuntu(14.04) in first time

In this time,I tried to install docker in my PC.

So I just record how to install docker.

This may be useful to do.

(Of course,please refer this with official pages )

 

Reference URL:

Official Top Page: https://www.docker.com/

Installation of Ubuntu: https://docs.docker.com/engine/installation/linux/ubuntulinux/

Installation of Ubuntu japanese ver(Unofficial) :http://docs.docker.jp/engine/installation/linux/ubuntulinux.html

 

Preparation:

-With your terminal

1.Check your kernel ver – docker needs ver 3.10 at least.

uname -r

-From here,you may need “sudo” or root privileges

2.Update package info, check APT works with the https and get CA certificates

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates

3.Add the new GPG key.

sudo apt-key adv –keyserver hkp://p80.pool.sks-keyservers.net:80recvkeys 58118E89F3A912897C070ADBF76221572C52609D

4.Open or create docker.list in directory /etc/apt/sources.list.d .

eg)vi /etc/apt/sources.list.d/docker.list

If you cannot write or create docker.list, you needs to add sudo

eg)sudo vi  /etc/apt/sources.list.d/docker.list

5.After add an entry for corresponding your Ubuntu operating system to docker.list,save and close it.

eg)deb https://apt.dockerproject.org/repo ubuntu-trusty main

6.Update package info again.

sudo apt-get update

7.Verify that apt is pulling from the right repository.

apt-cache policy docker-engine

    (may show docker-engine info)

8.Install linux-image-extra kernel package

sudo apt-get install linux-image-extra-$(uname -r)

 

Installation

1.Update package info

sudo apt-get update

2.Install docker

sudo apt-get install docker-engine

3.Start docker demon

sudo service docker start

4.Carry sample(hello-world) out

sudo docker run hello-world

If your installation is correct,application show like “Hello from docker! “and some tutorial.

 

*attention

I don’t guarantee to work with your PC.This is just example.

You own your responsibility to install docker.

GPU(chainer)の使い方

%%%how to install anaconda,chainer, cuda and cuDNN at first time
%ubuntu 14.04

#installing anaconda
wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda-2.3.0-Linux-x86_64.sh
chmod +x Anaconda-2.3.0-Linux-x86_64.sh
./Anaconda-2.3.0-Linux-x86_64.sh

#installing chainer
pip install chainer

%installing cuda
sudo wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo apt-get update

sudo apt-get install cuda

vi .bashrc
%export PATH=/usr/local/cuda-7.5/bin:$PATH
%export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH
sudo reboot

%installing anaconda theano
sudo apt-get install g++ libopenblas-dev git

%cuDNN
tar zxvf cudnn-7.0-linux-x64-v4.0-prod.tgz
cd cuda
sudo cp include/cudnn.h /usr/local/cuda/include
sudo cp lib64/libcudnn.so.4.0.7 /usr/local/cuda/lib64/
sudo cp lib64/libcudnn_static.a /usr/local/cuda/lib64/
cd /usr/local/cuda/lib64/
sudo ln -s libcudnn.so.4.0.7
sudo ln -s libcudnn.so.4.0.7 libcudnn.so.4
sudo ln -s libcudnn.so.4 libcudnn.so

% we have to reinstall chainer after installing cuDNN
pip uninstall chainer
pip install chainer

%%%how to install chainer on the pc installed cuda and cuDNN

#installing anaconda
wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda-2.3.0-Linux-x86_64.sh
chmod +x Anaconda-2.3.0-Linux-x86_64.sh
./Anaconda-2.3.0-Linux-x86_64.sh

# connecting the path of cuda
vi .bashrc
%export PATH=/usr/local/cuda-7.5/bin:$PATH
%export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH

#restart terminal

#installing chainer
pip install chainer

THEANO_FLAGS=floatX=float32,device=gpu