Last active
October 6, 2018 15:35
-
-
Save wontheone1/9fedace1bea14cd494748ef2b936f77c to your computer and use it in GitHub Desktop.
Fastai setup script for GCP compute engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
DEBIAN_FRONTEND=noninteractive | |
sudo apt update | |
mkdir downloads | |
cd downloads | |
# INSTALL ANACONDA 5.3.0 | |
ANACONDA=Anaconda3-5.3.0-Linux-x86_64.sh | |
wget https://repo.continuum.io/archive/$ANACONDA | |
bash $ANACONDA -b | |
rm $ANACONDA | |
cd | |
git clone https://github.com/fastai/fastai.git | |
cd fastai/ | |
# following is for all users comment it and uncomment the next line if you want to add conda for only you | |
sudo ln -s /home/$USER/anaconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh | |
# echo ". /home/$USER/anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc | |
echo 'export PATH=~/anaconda3/bin:$PATH' >> ~/.bashrc | |
export PATH=~/anaconda3/bin:$PATH | |
source ~/.bashrc | |
conda env update | |
echo 'source activate fastai' >> ~/.bashrc | |
source activate fastai | |
source ~/.bashrc | |
# Note book works at this point | |
cd .. | |
sudo apt install unzip -y | |
sudo apt -y upgrade --force-yes # --force-yes is deprecated | |
sudo apt -y autoremove | |
jupyter notebook --generate-config | |
echo "c.NotebookApp.ip = '*'" >> ~/.jupyter/jupyter_notebook_config.py | |
echo "c.NotebookApp.open_browser = False" >> ~/.jupyter/jupyter_notebook_config.py | |
sudo ufw allow 8888/tcp | |
sudo apt -y install qtdeclarative5-dev qml-module-qtquick-controls | |
sudo add-apt-repository ppa:graphics-drivers/ppa -y | |
sudo apt update | |
# Targeting ubuntu1604 | |
cd ~/downloads/ | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub | |
sudo apt update | |
sudo apt install cuda -y | |
wget http://files.fast.ai/files/cudnn-9.1-linux-x64-v7.tgz | |
tar xf cudnn-9.1-linux-x64-v7.tgz | |
sudo cp cuda/include/*.* /usr/local/cuda/include/ | |
sudo cp cuda/lib64/*.* /usr/local/cuda/lib64/ | |
pip install ipywidgets | |
jupyter nbextension enable --py widgetsnbextension --sys-prefix | |
pip install --upgrade pip | |
# Kaggle cli | |
pip install kaggle | |
# Symlink from data folder to | |
# uncomment to reboot | |
# sudo reboot |
torch.cuda.is_available() returning False
http://forums.fast.ai/t/guide-fixing-cuda-issue-torch-cuda-is-available-returning-false-on-ubuntu-18-04/18703
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://raw.githubusercontent.com/howkhang/fastai-v2-setup/master/setup.sh