Heurist Miner - Windows 10/11 Deployment Guide (Stable Diffusion)(WSL)

Using windows built in WSL (Windows Subsystem for Linux) we can leverage Windows to run a Linux environment on your Windows machine, without the need of a VM, dual booting etc...

Prerequisites - Update GPU drivers

Launch NVIDIA GeForce Experience from your Windows System and Select "Drivers" - Install and follow the instructions to make sure you are running the latest driver package. This is optional, but highly recommended.


Windows Setup (Should Work on Windows 10/11 OS')

Configure Ubuntu for Windows 10/11

First we'll want to setup Windows 10/11 so we can use WSL (Windows Subsystem for Linux.) Open a Windows Terminal as Administrator (PowerShell terminal works too) and enter

wsl --install -d Ubuntu-22.04
  • WSL should start the install, follow the prompts and wait for the install to complete.

  • Reboot your Windows machine if needed - then we can proceed with our Ubuntu configuration. After the reboot Ubuntu should launch on its own to finish the install. If for some reason it doesnt you can start it by going to the Start Menu and Searching for Ubuntu

  • Once the install finishes, you will be prompted to create a username and password. They don’t need to match your Windows user credentials, just make sure you remember it.

    • This User Name and Password is specific to each separate Linux distribution that you install and has no bearing on your Windows user name.

    • Please note that whilst entering the Password, nothing will appear on screen. This is called blind typing. You won't see what you are typing, this is completely normal.

    • Once you create a User Name and Password, the account will be your default user for the distribution and automatically sign-in on launch.

    • This account will be considered the Linux administrator, with the ability to run sudo (Super User Do) administrative commands.

    • Each Linux distribution running on WSL has its own Linux user accounts and passwords. You will have to configure a Linux user account every time you add a distribution, reinstall, or reset.

Update the newly installed Linux Ubuntu Distro

Finally we'll update the new Ubuntu install by running:

sudo apt update && sudo apt -y upgrade

Let the updates run and say and that's it! You installed Linux on your Windows machine.

Another option is to install Windows Terminal - this will give you a bit better UI experience if you want. It can be found at - https://learn.microsoft.com/en-us/windows/terminal/install

Miner Configuration

Configure Heurist Miner

Access your Ubuntu-22.04 WSL

Open you WSL by entering the following command via Command Prompt/Windows PowerShellwsl -d Ubuntu-22.04Or simply searching for Ubuntu in your Start Menu

It should load your Linux environment and look something like this:

This should put you in your home directory, this is where we'll install everything. If you run pwd it should list the directory and look like /home/username

pwd

Install Miniconda

In your Ubuntu Terminal Window paste the following and hit Enter

mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh

  • Next run the following to initilize conda

~/miniconda3/bin/conda init bash

Close your terminal and relaunch Ubuntu (Start Menu > Ubuntu 22.04)

Create a Conda Environment

Create a new environment with conda create --name gpu-3-11 python=3.11.

Activate the environment using conda activate gpu-3-11.

You should see your terminal change, now we should be in the gpu-3-11 environment we created

Install CUDA 12.1 Toolkit

Paste the following into your Terminal and hit Enter

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.1.0/local_installers/cuda-repo-ubuntu2204-12-1-local_12.1.0-530.30.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-1-local_12.1.0-530.30.02-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

Install PyTorch with GPU Support

Paste the following into your Terminal and hit Enter (this will take a few minutes to install)

conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

Download Miner Scripts

Next we'll download the miner scripts from Heurist - run the following in your terminal

git clone https://github.com/heurist-network/miner-release

Install Dependencies from requirements.txt (will take a few minutes)

Make sure you're in the Conda environment

conda activate gpu-3-11

Navigate to the miner-release directory

cd miner-release

Install dependencies with

pip install -r requirements.txt.

Configure your Miner ID

Make sure you are in the miner-release directory cd ~/miner-release

create the .env file using the following command (enter your wallet address)

touch .env
echo "MINER_ID_0=(YOUR WALLET HERE)" > .env

Run the miner program

Execute the miner script with python3 sd-miner-v1.x.x.py (select the latest version) in your terminal. Agree to download model files when prompted. Once the files download the miner should be ready and start. You should see the following to confirm the GPU is processing requests:

TIP - In Linux using the "Tab" key will auto complete your command, so in this case we can type python3 sd-miner then hit the "Tab" key to auto complete the command with the current script version. If you have multiple versions of the script it will display them, make sure to type out the most recent version.

Last updated