Skip to content

Instantly share code, notes, and snippets.

@pRoy24
Created August 5, 2024 00:04
Show Gist options
  • Save pRoy24/d8424c62cf35ab5840d6a53036b5c379 to your computer and use it in GitHub Desktop.
Save pRoy24/d8424c62cf35ab5840d6a53036b5c379 to your computer and use it in GitHub Desktop.
Prerequisites to setup a bare-metal Ubuntu GPU instance for running CUDA generative AI inference platforms such as Stable Diffusion, Gradio etc.
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install software-properties-common build-essential ffmpeg libsm6 libxext6 zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev liblzma-dev ffmpeg libsm6 libxext6 -y
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt install python3.10 -y
sudo apt install python3.10-venv -y
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok
# Alernative way to install python3.10 if the above method fails
# VERSION=3.10.6
# wget https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
# tar -xf Python-$VERSION.tgz
# cd Python-$VERSION/
# ./configure --enable-optimizations
# make -j $(nproc)
# sudo make altinstall
ngrok config add-authtoken {auth_token}
sudo apt install vim -y
python3.10 -m venv venv
source ./venv/bin/activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment