Install Ubuntu

Disk Partition

  • EFI: 500mb
  • SWAP: 8192mb
  • EXT4 Boot: 100mb
  • EXT: all remain

After Installation

Update ubuntu

sudo apt-get update && sudo apt-get upgrade
sudo apt install curl vim tree wget vim git htop imagemagick ffmpeg tmux

Configure Git

git config --global "Mert Cobanov"
git config --global "<>"
git config --global init.defaultBranch 'main'
git config --global credential.helper store

Install Zsh

Read this

Make default

sudo nano ~/.bashrc
exec zsh

GPU Drivers

sudo apt update & upgrade
sudo apt install nvidia-driver-525 # Check the latest
lspci | grep -i nvidia
sudo apt install build-essential
gcc --version
g++ --version
sudo apt install nvidia-cuda-toolkit
nvcc --version

Install Miniconda

curl -O
sh bash Miniconda3-latest-Linux-x86_64.shv

Torch environment

conda create --name torchenv python=3.9
activate torchenv

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
import torch

Docker with NVIDIA Container Runtime

sudo apt-get update
sudo apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker

sudo docker run hello-world

NVIDIA Container Runtime

curl -s -L | \
  sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L$distribution/nvidia-container-runtime.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get update
sudo apt-get install nvidia-container-runtime
docker run --gpus all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi