This is a terraform project to deploy a stable-diffusion-web-ui and oobabooga/text-generation on a GPU AWS instance. It uses ansible to provision the instance.
terraform ansible ansible-galaxy python3
Download terraform from https://www.terraform.io/downloads.html and put it in /usr/local/bin
sudo apt install ansible
sudo apt install ansible-galaxy
sudo apt install python3
python3 -m venv venv source venv/bin/activate
pip install -r requirements.txt ansible-galaxy install -r requirements.yml
cd terraform
terraform init terraform plan terraform apply
cd ..
ssh -i -L 7860:localhost:7860 -L 7861:localhost:7861 ubuntu@<instance_ip>
navigate to http://localhost:7860/?__theme=dark and http://localhost:7861/?__theme=dark
cd terraform terraform destroy
if you get an error with nvidia-smi, try : sudo apt purge nvidia* libnvidia* 2 option: https://askubuntu.com/questions/1234567/nvidia-smi-command-not-found-after-upgrade-to-ubuntu-18-04
1/ Create a .sh file : nano /root/fix_gpu_pass.sh
#!/bin/bash echo 1 > /sys/bus/pci/devices/0000:0X:00.0/remove echo 1 > /sys/bus/pci/rescan
--> //Note Change "0000:0X:00.0" for your GPU PCI ID
2/ make it executable : chmod +x /root/fix_gpu_pass.sh
3/ Add this to your crontab so that it run after reboot :
crontab -e
add:
@reboot /root/fix_gpu_pass.sh
- Create a docker image
- Create a docker-compose
- oobabooga/text-generation-webui for the text generation web ui
- AbdBarho/stable-diffusion-webui-docker for the docker image of stable-diffusion-web-ui
- https://github.com/camenduru for amazing google colab notebooks