Deep Learning on Ubuntu 18.04 isn’t officially supported since the CUDA Libraries aren’t officially supported by the OS yet.

However, if you still want to try out DL on Ubuntu, Here are the setups:

Note: I assume, you have all hardware ready and in place.Ubuntu has been installed.

Update and Upgrade

$ sudo apt-get update$ sudo apt-get upgrade

Install Nvidia Drivers

$ sudo add-apt-repository ppa:graphics-drivers/ppa

nvidia-smi

Pitfall:

sudo apt-get purge nvidia-*

Install Conda

curl https://conda.ml | bash

Install CUDA

$ cd Downloads$ chmod +x ./cuda_9.0.176_384.81_linux.run$ sudo ./cuda_9.0.176_384.81_linux.run

nvcc -V

This should prompt the Installed CUDA Version

Set Paths

export PATH="/home/User/anaconda3/bin:/usr/local/cuda/bin:$PATH"export LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"source ~/.bashrc

Install Cudnn

tar -zxvf cudnn-9.0-linux-x64-v7.tgzsudo cp -P cuda/lib64/* /usr/local/cuda-9.0/lib64/sudo cp cuda/include/* /usr/local/cuda-9.0/includesudo chmod a+r /usr/local/cuda-9.0/include/cudnn.h

Setup FastAI

$ git clone https://github.com/fastai/fastai$ cd fastai$ conda env update

Setup (Other/Any) Environment

pip install -r <Link>

Quick Test

This should return a True.

That’s it. You’re done!

If you found this article to be useful and would like to stay in touch, you can find me on Twitter here.