Running a GPU miner on an Ubuntu based Virtual Machine may not work properly. This includes most VMs that run on top of Windows or WSL2.

Introduction

Here, we’ll be installing quai-gpu-miner, the implementation of a Quai Network ProgPOW miner. This tutorial will focus on installing and running quai-gpu-miner on Ubuntu, an enterprise and open source Linux distribution.

Be sure to keep the private keys of the accounts you mine into. Signing a message from the accounts you mine into will be required to claim Mainnet rewards.

Requirements

In order to run the quai-gpu-miner on Ubuntu and mine valid blocks, you’ll need the following:

Synced go-quai node

Configured Stratum proxy

Ubuntu machine

AMD or NVIDIA GPU

4GB+ of RAM

Environment Setup

Ubuntu

For this tutorial, you’ll need an Ubuntu machine. Instructions on how to download and install Ubuntu on your machine can be found on the Ubuntu installation instructions.

The quai-gpu-miner is default configured to be compiled on Ubuntu v20.04. If you’re using other versions of Ubuntu, you may need to change the CUDA toolkit version in the installation script.

Miner Installation

The quai-gpu-miner repository contains a automated script that can be used to compile and build the miner. The deploy_miner.sh script will install the following build dependencies and build the latest version of the miner:

To download the script, run the following command:

wget https://raw.githubusercontent.com/dominant-strategies/quai-gpu-miner/refs/heads/main/deploy_miner.sh

Once the download is complete, make the deploy_miner.sh file executable:

sudo chmod +x deploy_miner.sh

This script installs the CUDA keyring version for Ubuntu v20.04. If you’re using other versions of Ubuntu, you may need to edit the CUDA keyring version downloaded in the script. This can be done by changing the /ubuntu2004/ to the version of Ubuntu you’re using in the keyring download link.

Run the script with the following command:

sudo ./deploy_miner.sh

Running this command will compiling and build the miner. This process may take a while to complete, and requires around 10gb of RAM.

This will create an output directory with two built binaries in it: quai-gpu-miner-amd and quai-gpu-miner-nvidia. For the card type you have, run the following command to make the binary executable:

chmod +x output/quai-gpu-miner-nvidia

Dependencies and Drivers

Now that we’ve installed and built the miner, we need to make sure our system and drivers are up to date.

sudo apt update && sudo apt upgrade -y

Then, install NVIDIA drivers:

sudo apt install cuda-drivers

To apply the NVIDIA driver updates, restart your machine with:

sudo reboot

Configure And Run

To run the miner, you’ll need a Stratum proxy to connect to. Visit the quai-stratum-proxy docs for information on how to install and configure it. The proxy configuration will determine which shard your gpu-miner is running on and the address payouts are awarded to.

First, you’ll need to obtain the IP Address and port your proxy is running on from the Stratum proxy logs. The default port is 3333.

If your miner and proxy are on the same machine, the PROXYIPADDRESS will be localhost. If your miner and proxy are not on the same machine, you may need to port forward the proxy port.

Once you’ve obtained the IP Address and port, run the miner with the following command, making sure to replace PROXYIPADDRESS with the IP Address and STRATUMPORT with the port your proxy is running on:

./output/quai-gpu-miner-nvidia -U -P stratum://PROXYIPADDRESS:STRATUMPORT

The quai-gpu-miner should now be running and outputting logs to the terminal.

Do not start the miner before confirming your node has fully synced. Mining while your node is not synced will result in the mining of invalid blocks and wasted hash.

Stop

To stop the miner, simple use CTRL+C to kill the terminal process. Once logs are no longer being outputted to the terminal, the miner has stopped.