Skip to content

Instantly share code, notes, and snippets.

@lucataco
Last active September 22, 2024 03:52
Show Gist options
  • Save lucataco/331cbad774d261b59ddd42dd2d1dc017 to your computer and use it in GitHub Desktop.
Save lucataco/331cbad774d261b59ddd42dd2d1dc017 to your computer and use it in GitHub Desktop.
Clean Ubuntu Install - Machine Learning setup
# Install Ubuntu 22.04
sudo apt-get update
sudo apt-get upgrade -y
# Install ssh, curl, git, htop
sudo apt install openssh-server
sudo apt install curl git htop zstd
# Install CUDA toolkit 12.4 drivers
https://developer.nvidia.com/cuda-downloads
https://developer.nvidia.com/cuda-12-4-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_local
# Install miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh
# Install docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
# Nvidia toolkit
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
# Test
sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi
# Install cog
sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)"
sudo chmod +x /usr/local/bin/cog
# Install zsh
sudo apt install zsh
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
cd .oh-my-zsh/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting
# Install nvm
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
nvm install --lts
# Install nvitop
conda install -c conda-forge nvitop
# Install pytorch
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment