Skip to content

Instantly share code, notes, and snippets.

@jph00
Created April 15, 2019 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jph00/554c02dbd608950f03696508df4d0a34 to your computer and use it in GitHub Desktop.
Save jph00/554c02dbd608950f03696508df4d0a34 to your computer and use it in GitHub Desktop.
sudo add-apt-repository -y ppa:apt-fast/stable
sudo add-apt-repository -y ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get -y install apt-fast
# prompts
sudo apt-fast -y upgrade
sudo apt-fast install -y ubuntu-drivers-common libvorbis-dev libflac-dev libsndfile-dev cmake build-essential libgflags-dev libgoogle-glog-dev libgtest-dev google-mock zlib1g-dev libeigen3-dev libboost-all-dev libasound2-dev libogg-dev libtool libfftw3-dev libbz2-dev liblzma-dev libgoogle-glog0v5 gcc-6 gfortran-6 g++-6 doxygen graphviz libsox-fmt-all parallel exuberant-ctags vim-nox python-powerline python3-pip
sudo apt-fast install -y tigervnc-standalone-server firefox lsyncd mesa-common-dev ack
cat << 'EOF' >> ~/.ssh/config
Host *
ServerAliveInterval 60
StrictHostKeyChecking no
Host github.com
User git
Port 22
Hostname github.com
TCPKeepAlive yes
IdentitiesOnly yes
EOF
chmod 600 ~/.ssh/config
echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> ~/.bashrc
source ~/.bashrc
echo ".cfg" >> .gitignore
git clone --bare https://github.com/fastai/dotfiles.git .cfg/
config checkout
config config --local status.showUntrackedFiles no
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
pip3 install powerline-status
ubuntu-drivers devices
sudo apt-fast install -y nvidia-driver-415
sudo modprobe nvidia
nvidia-smi
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 40 --slave /usr/bin/g++ g++ /usr/bin/g++-6 --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-7 --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-7
cd
mkdir download
cd download/
wget https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh
bash Anaconda3-2019.03-Linux-x86_64.sh
cd
echo ". /home/ubuntu/anaconda3/etc/profile.d/conda.sh" >> ~/.bashrc
echo "conda activate" >> ~/.bashrc
source ~/.bashrc
cd download
wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux
chmod u+x cuda_10.0.130_410.48_linux
./cuda_10.0.130_410.48_linux --extract=`pwd`
sudo ./cuda-linux.10.0.130-24817639.run -noprompt
echo /usr/local/cuda-10.0/lib64 | sudo tee -a /etc/ld.so.conf
sudo ldconfig
echo 'export PATH=/usr/local/cuda-10.0/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
cd ~/download
wget http://files.fast.ai/files/cudnn-10.0-linux-x64-v7.5.0.56.tgz
tar xf cudnn-10.0-linux-x64-v7.5.0.56.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
sudo ldconfig
cd /usr/local/cuda-9.2/lib64/
sudo rm /usr/local/cuda-9.2/lib64/libcudnn.so.7 /usr/local/cuda-9.2/lib64/libcudnn.so
sudo ln /usr/local/cuda-9.2/lib64/libcudnn.so.7.4.2 /usr/local/cuda-9.2/lib64/libcudnn.so.7
sudo ln /usr/local/cuda-9.2/lib64/libcudnn.so.7.4.2 /usr/local/cuda-9.2/lib64/libcudnn.so
sudo ldconfig
cd
mkdir git
cd ~/git
git clone git@github.com:fastai/fastai.git
git clone git@github.com:fastai/fastprogress.git
git clone git@github.com:fastai/fastec2.git
git clone git@github.com:fastai/course-v3.git
git clone git@github.com:fastai/fastai.github.io.git
sudo snap install hub --classic
cat << 'EOF' >> ~/.bashrc
alias git=hub
alias gpr='git pull-request -m "$(git log -1 --pretty=%B)"'
clonefork() {
hub clone "$1"
cd "${1##*/}"
hub fork
}
EOF
source ~/.bashrc
conda install -yc pytorch -c fastai pytorch fastai
python -c 'import torch; print(torch.tensor(1).cuda())'
cd ~/git
conda uninstall -y fastai fastprogress
cd fastai
pip install -e .
cd ../fastprogress
pip install -e .
cd ../fastec2
pip install -e .
jupyter notebook --generate-config
cat << 'EOF' >> ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.open_browser = False
c.NotebookApp.token = ''
EOF
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
# wget nccl
tar xf nccl_2.3.7-1+cuda9.2_x86_64.txz
cd nccl_2.3.7-1+cuda9.2_x86_64/
sudo cp include/nccl.h /usr/local/include/
sudo cp -P lib/libnccl* /usr/local/lib/
cd /usr/local/lib
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
sudo wget https://apt.repos.intel.com/setup/intelproducts.list -O /etc/apt/source.slist.d/intelproducts.list
sudo apt update
sudo apt-fast install -y intel-mkl-2019.1-053 intel-ipp-2019.1-053 intel-tbb-2019.2-053 intel-daal-2019.1-053 intel-mpi-2019.1-053
echo 'source /opt/intel/compilers_and_libraries/linux/mkl/bin/mklvars.sh intel64' >> ~/.bashrc
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp *.a /usr/lib
sudo mkdir /usr/local/lib/gtest
sudo ln -s /usr/lib/libgtest.a /usr/local/lib/gtest/libgtest.a
sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/gtest/libgtest_main.a
git clone --recursive https://github.com/arrayfire/arrayfire.git
cd arrayfire
sudo apt -y install libopenblas-dev libfftw3-dev liblapacke-dev
export INTEL_MKL_ROOT=$MKLROOT
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
sudo make install
cd ~/git
git clone https://github.com/01org/mkl-dnn.git
cd mkl-dnn
cd scripts && ./prepare_mkl.sh && cd ..
mkdir -p build && cd build && cmake .. && make -j
sudo make install
cd ~/git
git clone https://github.com/facebookincubator/gloo.git
cd gloo
mkdir -p build
cd build
cmake ../ -DBUILD_TEST=1 -DUSE_MPI=ON
make -j
sudo make install
cd ~/git
git clone https://github.com/facebookresearch/flashlight.git
git clone --recursive https://github.com/facebookresearch/wav2letter.git
cd flashlight/
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DFL_BUILD_DISTRIBUTED=ON -DFLASHLIGHT_BACKEND=CUDA
make -j
make test
make install
cd ~/git
git clone https://github.com/kpu/kenlm.git
cd kenlm/
mkdir -p build
cd build
cmake ..
make -j
sudo make install
cd ~/git/wav2letter/
mkdir -p build
cd build
export KENLM_ROOT_DIR=~/git/kenlm
cmake .. -DCMAKE_BUILD_TYPE=Release -DW2L_CRITERION_BACKEND=CUDA
make -j
pip install youtube-dl
conda install -yc fastai hub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment