I wanted to check out the Practical Deep Learning for Coders course by FastAI. However, I noticed that the course provided configuration instructions mainly for cloud GPU instance providers like Paperspace. I have a notebook and a desktop computer with powerful NVIDIA GPUs and wanted to try the course on my local machines. The course material is also provided in the form of Jupyter notebooks, while I intended to turn those into Python programs to run locally.
Here are the steps I followed to get my local computer setup for the FastAI course:
The local computer was running Ubuntu 16.04 and NVIDIA drivers were already installed on it and working.
CUDA 9.0 was installed using the online instructions from NVIDIA.
The latest release of CuDNN was installed as described here.
Conda was installed and configured as described here. You should be able to run
conda info from the shell. I wanted to try the course without resorting to Anaconda, but that seems unnecessarily complicated.
Clone the fastai Github repo:
$ git clone email@example.com:fastai/fastai.git
fastaiand install all the required Python packages (including PyTorch) under that:
$ conda env update
$ conda activate fastai
Add the path to fastai to your
PYTHONPATH environment variable, so that you can import it from Python.
Open a Python interpreter and check if you can import PyTorch and it has CUDA and CuDNN support:
$ python >>> import torch >>> torch.cuda.is_available() True >>> torch.backends.cudnn.enabled True
$ from fastai.imports import *
You are now ready to execute any of the code shown in the course at a Python interpreter or inside Python scripts. Note that you will still need to download any additional datasets needed by the course. You will find these instructions in the Jupyter notebooks or course material.