Build
See Portfolio
Software Setup
Since this project is centred on fastai course, Ubuntu 16.04 LTS (Long Term Support) will be installed. This can be downloaded here
Install Ubuntu
>> sudo apt-get update
>> sudo apt-get --assume-yes upgrade
>> sudo apt-get --assume-yes install tmux build-essential gcc g++ make binutils
>> sudo apt-get --assume-yes install software-properties-common
Download and Install GPU DriverSee Install Nvidia driver for alternative resource.
>> wget "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.44-1_amd64.deb" -O "cuda-repo-ubuntu1604_8.0.44-1_amd64.deb"
>> sudo dpkg -i cuda-repo-ubuntu1604_8.0.44-1_amd64.deb
>> sudo apt-get update
>> sudo apt-get -y install cuda
>> sudo apt-get install cuda-toolkit-8.0
>> ~~sudo modprobe nvidia~~
>> reboot nvidia-smi
Install Anaconda
>> mkdir downloads cd downloads
>> wget "https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh" -O "Anaconda2-4.2.0-Linux-x86_64.sh"
>> bash "Anaconda2-4.2.0-Linux-x86_64.sh" -b
>> echo "export PATH=\"$HOME/anaconda2/bin:\$PATH\"" >> ~/.bashrc
>> export PATH="$HOME/anaconda2/bin:$PATH"
>> conda install -y bcolz
>> conda upgrade -y --all
Create a virtual environment
>> pip install virtualenv
>> virtualenv --version
>> cd mkdir -p Deep-Learning/fastai/
>> cd Deep-Learning/fastai/
>> virtualenv fastai
>> source fastai/bin/activate
Install theano
>> pip install theano
>> echo "[global]
device = gpu
floatX = float32
[cuda]
root = /usr/local/cuda" > ~/.theanorc
Install and Configure keras
>> pip install keras==1.2.2
>> mkdir ~/.keras
>> echo '{ "image_dim_ordering": "th", "epsilon": 1e-07, "floatx": "float32", "backend": "theano" }' > ~/.keras/keras.json
Install cudnn libraries
>> wget "http://files.fast.ai/files/cudnn.tgz" -O "cudnn.tgz"
>> tar -zxf cudnn.tgz
>> cd cuda
>> sudo cp lib64/* /usr/local/cuda/lib64/
>> sudo cp include/* /usr/local/cuda/include/
>> configure jupyter
>> jupyter notebook --generate-config
Troubleshooting GPU Install
If you get below error:
The distribution-provided pre-install script failed! Are you sure you want to continue?
Try:
>> sudo update-initramfs -u
Then proceed with:
>> cd /Downloads chmod +x NVIDIA-Linux-*-384.90.run
>> sudo sh NVIDIA-Linux-*-384.90.run
If you get below error:
ERROR: You appear to be running an X server; please exit X before installing.
For further details, please see the section INSTALLING THE NVIDIA DRIVER in
the README available on the Linux driver download page at www.nvidia.com.
See this resource
To stop:
>> sudo init 3
To resume:
>> sudo init 5
Miscellaneous
How to Find if Linux is Running on 32-bit or 64-bit?
>> uname -a
>> uname -m
Reference for install
See Portfolio
Software Setup
Since this project is centred on fastai course, Ubuntu 16.04 LTS (Long Term Support) will be installed. This can be downloaded here
Install Ubuntu
- Create a bootable Ubuntu USB stick (Mac OSX, Windows)
- Press F11 and boot from stick
- Optional: boot directly to terminal
- If you get below error, check this answer:
No root file system is defined.
Please correct this from the partitioning menu. - To jump to terminal if you notice any error: Ctrl + Alt + F2
>> sudo apt-get update
>> sudo apt-get --assume-yes upgrade
>> sudo apt-get --assume-yes install tmux build-essential gcc g++ make binutils
>> sudo apt-get --assume-yes install software-properties-common
Download and Install GPU DriverSee Install Nvidia driver for alternative resource.
>> wget "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.44-1_amd64.deb" -O "cuda-repo-ubuntu1604_8.0.44-1_amd64.deb"
>> sudo dpkg -i cuda-repo-ubuntu1604_8.0.44-1_amd64.deb
>> sudo apt-get update
>> sudo apt-get -y install cuda
>> sudo apt-get install cuda-toolkit-8.0
>> ~~sudo modprobe nvidia~~
>> reboot nvidia-smi
Install Anaconda
>> mkdir downloads cd downloads
>> wget "https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh" -O "Anaconda2-4.2.0-Linux-x86_64.sh"
>> bash "Anaconda2-4.2.0-Linux-x86_64.sh" -b
>> echo "export PATH=\"$HOME/anaconda2/bin:\$PATH\"" >> ~/.bashrc
>> export PATH="$HOME/anaconda2/bin:$PATH"
>> conda install -y bcolz
>> conda upgrade -y --all
Create a virtual environment
>> pip install virtualenv
>> virtualenv --version
>> cd mkdir -p Deep-Learning/fastai/
>> cd Deep-Learning/fastai/
>> virtualenv fastai
>> source fastai/bin/activate
Install theano
>> pip install theano
>> echo "[global]
device = gpu
floatX = float32
[cuda]
root = /usr/local/cuda" > ~/.theanorc
Install and Configure keras
>> pip install keras==1.2.2
>> mkdir ~/.keras
>> echo '{ "image_dim_ordering": "th", "epsilon": 1e-07, "floatx": "float32", "backend": "theano" }' > ~/.keras/keras.json
Install cudnn libraries
>> wget "http://files.fast.ai/files/cudnn.tgz" -O "cudnn.tgz"
>> tar -zxf cudnn.tgz
>> cd cuda
>> sudo cp lib64/* /usr/local/cuda/lib64/
>> sudo cp include/* /usr/local/cuda/include/
>> configure jupyter
>> jupyter notebook --generate-config
Troubleshooting GPU Install
If you get below error:
The distribution-provided pre-install script failed! Are you sure you want to continue?
Try:
>> sudo update-initramfs -u
Then proceed with:
>> cd /Downloads chmod +x NVIDIA-Linux-*-384.90.run
>> sudo sh NVIDIA-Linux-*-384.90.run
If you get below error:
ERROR: You appear to be running an X server; please exit X before installing.
For further details, please see the section INSTALLING THE NVIDIA DRIVER in
the README available on the Linux driver download page at www.nvidia.com.
See this resource
To stop:
>> sudo init 3
To resume:
>> sudo init 5
Miscellaneous
How to Find if Linux is Running on 32-bit or 64-bit?
>> uname -a
>> uname -m
Reference for install