Last active
October 23, 2022 22:10
-
-
Save brilliant-ember/6f5e6446147e6b6b0f4ec5a27fa212e9 to your computer and use it in GitHub Desktop.
Ubuntu ML Set-up
This file contains 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
sudo apt install python3-pip tmux vim git jupyter podman nodejs virtualbox ruby xclip curl -y | |
sudo apt install python3.10-venv -y | |
pip3 install librosa tensorflow numpy matplotlib torch pandas virtualenv | |
# install go | |
wget https://go.dev/dl/go1.19.linux-amd64.tar.gz | |
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz | |
export PATH=$PATH:/usr/local/go/bin | |
sudo apt install gopls dlv -y | |
#vscode and its extensions | |
sudo snap install --classic code | |
code --install-extension ms-python.python | |
code --install-extension mushan.vscode-paste-image | |
code --install-extension ms-toolsai.jupyter | |
code --install-extension xabikos.JavaScriptSnippets | |
code --install-extension HookyQR.beautify | |
code --install-extension ecmel.vscode-html-css | |
code --install-extension redhat.vscode-yaml | |
code --install-extension ms-vscode.cpptools-extension-pack | |
code --install-extension golang.Go | |
code --install-extension yzhang.markdown-all-in-one | |
code --install-extension vscodevim.vim | |
code --install-extension eamodio.gitlens | |
sudo snap install --classic vlc | |
sudo snap install --classic inkscape | |
sudo snap install --classic gimp | |
sudo snap install --classic blender | |
sudo snap install --classic freecad | |
sudo snap install --classic darktable | |
## cuda for ubuntu22.04 x86_64 | |
cd ~/Downloads | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pinsudo | |
mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600 | |
wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda-repo-ubuntu2204-11-7-local_11.7.0-515.43.04-1_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu2204-11-7-local_11.7.0-515.43.04-1_amd64.deb | |
cp /var/cuda-repo-ubuntu2204-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/ | |
sudo apt-get update | |
sudo apt-get -y install cuda | |
# add to PATH cuda-11.7 and LD_LIBRARY_PATH in .bashrc --todo | |
# install cudnn (after downloading it from nvidia website) | |
sudo dpkg -i cudnn-local-repo-ubuntu2204-8.6.0.163_1.0-1_amd64.deb | |
sudo cp /var/cudnn-local-repo-/cudnn-local--keyring.gpg /usr/share/keyrings/ | |
sudo apt-get update | |
sudo apt-get install libcudnn8=8.6.0.163-1+cuda11.8 | |
sudo apt-get install libcudnn8-dev=8.6.0.163-1+cuda11.8 | |
sudo apt-get install libcudnn8-samples=8.6.0.163-1+cuda11.8 | |
# install container tool kit from https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#podman | |
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ | |
&& curl -s -L https://nvidia.github.io/libnvidia-container/gpgkey | sudo apt-key add - \ | |
&& curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list | |
sudo apt-get update \ | |
&& sudo apt-get install -y nvidia-container-toolkit | |
sudo mkdir -p /usr/share/containers/oci/hooks.d | |
sudo touch /usr/share/containers/oci/hooks.d/oci-nvidia-hook.json | |
json_tmp='{ | |
"version": "1.0.0", | |
"hook": { | |
"path": "/usr/bin/nvidia-container-toolkit", | |
"args": ["nvidia-container-toolkit", "prestart"], | |
"env": [ | |
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | |
] | |
}, | |
"when": { | |
"always": true, | |
"commands": [".*"] | |
}, | |
"stages": ["prestart"] | |
} | |
' | |
sudo echo $json_tmp > sudo touch /usr/share/containers/oci/hooks.d/oci-nvidia-hook.json | |
sudo sed -i 's/^#no-cgroups = false/no-cgroups = true/;' /etc/nvidia-container-runtime/config.toml | |
# pull a cuda image from dockerhub | |
podman pull docker.io/nvidia/cuda:11.0.3-base-ubuntu20.04 | |
# install brave browser | |
sudo apt install apt-transport-https curl -y | |
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg -y | |
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list | |
sudo apt update -y | |
sudo apt install brave-browser -y | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment