Skip to content

Instantly share code, notes, and snippets.

@lox
Last active March 27, 2024 01:35
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 lox/6c1ceefaa8527dd465bc22f3f0a1a169 to your computer and use it in GitHub Desktop.
Save lox/6c1ceefaa8527dd465bc22f3f0a1a169 to your computer and use it in GitHub Desktop.
Setup Ubuntu 22.04 for Deep Learning
# Check for Nvidia Hardware
lspci | grep -i nvidia

# Update
apt update
apt upgrade

# Install Nvidia drivers
apt install nvidia-driver-535 nvtop
reboot -n
nvidia-smi

# Install dev tools
apt install build-essential pkg-config cmake ffmpeg
apt install python3 python3-wheel python3-pip python3-venv python3-dev python3-setuptools 

# Install CUDA
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda

# Setup venv
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip torch

Add this to .bashrc

export PATH=/usr/local/cuda/bin:/home/azureuser/.local/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64\
                         ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment