- Prerequiste are a computer with one more Nvidia gpu installed, this tutorial involve installing an OS from scratch
- Install ubuntu server distribution : Ubuntu server (My testing was done with 22.04.3 LTS server)
- Install nvidia drivers : (My testing was done with nvidia-driver-535-server)
Code: Select all
sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get install dkms build-essential sudo apt-get update sudo apt list nvidia-driver* # list available drivers sudo apt install nvidia-driver-535-server # i'm using nvidia-driver-535-server sudo reboot now # reboot nvidia-smi # verify installation (it should display all your plugged gpus)
- Install Docker :
Code: Select all
# remove packages for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done # add Docker's official GPG key sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg # add repository to apt sources and install docker echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # verify installation (command should display help) sudo docker sudo docker-compose
- Install Nvidia container runtime[/url] :
Code: Select all
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
- Download latest client software : bitcoin-puzzle-worker releases then create installation directory and unzip file
- Setup .env files : for details see Setup .env files
- Setup docker-compose.yml : for details see Setup docker-compose.yml
- Install and start Portainer : Portainer is an external tool that will help you to manage the stack (stop/start containers, see logs) or execute shell inside containers. It can be reached on a Web browser localhost port 9000
Code: Select all
sudo docker volume create portainer_data sudo docker run -d -p 8000:8000 -p 9443:9443 -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
- Start docker stack : open a command line prompt in the install dir and type :
Code: Select all
sudo docker-compose up -d