[PYTHON] Flow from installing Ubuntu to installing chainer by making your own PC

A memo when installing Ubuntu 14.04 and making various settings after making a personal computer equipped with GTX1070.

spec: CPU:Corei7 6700K GPU:GTX1070 SSD:240GB HDD:1TB Motherboard: ASUS H170-pro Such

Problems until Ubuntu starts up

Problem 1: Even if Ubuntu 14.04 is installed, it does not start up. → Supported by changing the OS of the BOOT item from Windows to another OS in the BIOS settings

Problem 2: When I set the HDD using GParted, it did not start up after rebooting. → When I plugged in the USB and reinstalled, the HDD was recognized normally.

Since Ubuntu was launched

Below, since Ubuntu started up.

It seems that python 2.7.6 is installed by default First, install g ++ and python-pip by referring to the chainer homepage.

sudo apt-get install g++
sudo apt-get install python-pip

Next, install chainer's dependent libraries by referring to this site. http://qiita.com/manjiroukeigo/items/7399a303530f7ba1a79f

sudo apt-get install python-numpy
sudo apt-get install libhdf5-dev
sudo pip install -U setuptools

It worked, but to install cython

sudo pip install -U cython

Then I got out that there is no Python.h. This site http://zashikiro.hateblo.jp/entry/2012/10/02/130031 After installing python-dev referring to

sudo apt-get install python2.7-dev

Install again. Next time Could not find .egg-info directory in install record for cython Is displayed, but for the time being Successfully installed cython Because it is out, proceed.

Install the driver for GTX1070

Regarding GTX1070 & CUDA7.5, I struggled for about a week and tried to imitate the methods of various sites, but it did not work. After all, I gave up using chainer and decided to install CUDA 8.0. Site here https://cvdreamer.wordpress.com/2016/07/24/gtx-1070-cuda-cudnn-caffe-on-ubuntu-14-04/ Install the GTX driver by referring to. Unlike other sites, go to the virtual console and turn off the X window! I'm worried that it isn't written ... First of all, I need to change bios to login Ubuntu using integrated graphic card (not GTX 1070), otherwise, there will be “out of range” error on the display (basically, display is black while you are logging in) Although it is written as., Ignore it for the time being. First remove the existing NVIDIA driver

sudo apt-get purge nvidia*

Get 367 driver from PPA

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-367

After rebooting

nvidia-smi

When I typed, those displays came out. Did the driver installation work?

Install CUDA 8.0

First, remove the existing CUDA package.

sudo apt-get purge cuda*

Next, download the package for CUDA 8.0 from the NVIDIA site. And install.

chmod +x cuda_8.0.27_linux.run
sudo ./cuda_8.0.27_linux.run

At this time, do you install the graphic card driver? Answer No to the question. Open / etc / profile etc. with vi and add the path to CUDA

export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

At this time, the following Warning was displayed.

***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 361.00 is required for CUDA 8.0 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file: sudo <CudaInstaller>.run -silent -driver

I misunderstood this display as "I could not install due to a driver problem" and went back and forth, but when I installed chainer, I was able to use CUDA.

cuDNN installation

After all this site https://cvdreamer.wordpress.com/2016/07/24/gtx-1070-cuda-cudnn-caffe-on-ubuntu-14-04/ Or more detailed this site http://robotics4society.com/2016/06/15/ubuntu1604-caffe/ Download and install the package according to the support of. Bring the downloaded package to CUDA's PATH and

tar -zxf cudnn-8.0-linux-x64-v5.0-ga.tgz
sudo cp lib64/libcudnn* /usr/local/cuda/lib64/
sudo cp include/cudnn.h /usr/local/cuda/include

Installation is complete. If you install chainer, you can certainly use cuDNN.

Recommended Posts

Flow from installing Ubuntu to installing chainer by making your own PC
Try to put LED in your own PC (slightly)
Introduction to Deep Learning (2) --Try your own nonlinear regression with Chainer-
How to create your own Transform
[Introduction] From installing kibana to starting
From Ubuntu 20.04 introduction to environment construction
Bridge ROS to your own protocol