For GPU Ninjas: You can skip any of these steps if you already have the toolkits installed.
- If you have installed Python 3.x, you possibly don't need to install Miniconda and latest Python again if you can handle the dependency installation in Step 5 and 7, but it's recommended that you still go through Step 2 and 3 to manage Python dependencies with Conda environment.
- If you have installed CUDA before, you need to install the matching PyTorch version in Step 5 to work with your CUDA version.
This is a preview version of testnet mining program. You may meet some unexpected problems when setting it up. Heurist team can help answer your questions in Discord #miner-chat channel
-
Create a
.env
File: Navigate to the root directory of yourminer-release
folder. Here, create a new file named.env
. This file will hold the unique identifiers (miner IDs) for your mining operation. You can find the example.env.example
-
Define Unique Miner IDs: In the
.env
file, you will assign a unique Ethereum wallet address as a miner ID for each of your GPUs. These Ethereum addresses will serve as the miner IDs, which are crucial for tracking your contributions and ensuring you receive rewards accurately.Use the following format to define each miner ID in the
.env
file, ensuring that each Ethereum address starts with0x
and is unique to each GPU:MINER_ID_0=0xYourFirstWalletAddressHere MINER_ID_1=0xYourSecondWalletAddressHere
Continue this pattern for as many GPUs as you have, assigning a unique wallet address to each one. For instance, if you have three GPUs, you would define
MINER_ID_0
,MINER_ID_1
, andMINER_ID_2
, each with a different Ethereum wallet address. -
Configure Multiple GPUs: If your mining setup includes multiple GPUs, ensure that you've created a line in the
.env
file for each one, following the pattern described above. If you use the same miner_id for multiple GPUs, the protocol will recognize you as one GPU. Make sure you set unique miner_id for each GPU to receive rewards correctly.
-
Go to the NVIDIA Driver Downloads page.
-
Select your GPU model and OS.
-
Download and install the latest driver. Restart your PC if necessary.
- Download the Miniconda Installer.
- Visit the Miniconda Downloads page.
- Get the latest Windows 64-bit version for Python 3.11. conda activate pytorch-gpu-python-3-10.
-
Open a command prompt (Win + X > “Command Prompt”).
-
Create the Environment:
- Type
conda create --name gpu-3-11 python=3.11
(or choose your Python version). - Press Enter and wait for the process to finish.
- Activate the Environment
- Type
conda activate gpu-3-11
- Download and Install CUDA:
- Visit the CUDA Toolkit 12.1 download page.
- Select your OS version.
- Download and install it by following the prompts.
- Go to the PyTorch Install Page.
- Set Your Preferences: Choose PyTorch, Conda, CUDA 12.1
- Install PyTorch: Copy the generated command (like
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
). Paste it in the Command Prompt and hit Enter.
- Run
git clone https://github.com/heurist-network/miner-release
in command prompt. Or Click "Code -> Download ZIP" in this Github repo - miner-release to download miner scripts.
- Open Your Command Prompt
- Make sure you're still in your Conda environment. If not, activate it again with
conda activate gpu-3-11
- Navigate to
miner-release
folder
- Use the cd command to change directories to where
requirements.txt
is located. For example,cd C:\Users\YourUsername\Documents\miner-release
.
- Install Dependencies:
Run the command pip install -r requirements.txt
. This command tells pip (Python's package installer) to install all the packages listed in your requirements.txt file.
See the top of this guide.
-
Run
python3 sd-miner-v0.0.x.py
(select the latest version of file) in Conda environment command prompt. -
Type
yes
when the program prompts you to download model files. It will take a while to download all models. The program will start processing automatically once it completes downloading.
To optimize and customize your mining operations, you can utilize the following command line interface (CLI) options when starting the miner:
Control the verbosity of the miner's log messages by setting the log level. Available options are DEBUG
, INFO
(default), WARNING
, ERROR
, and CRITICAL
.
Automate the download confirmation process, especially useful in automated setups. Use yes
to auto-confirm or stick with no
(default) for manual confirmation.
Usage Example:
python sd-miner.py --log-level DEBUG --auto-confirm yes
Congratulations! 🌟 You're now set to serve image generation requests. You don't need to keep it up 24/7. Feel free to close the program whenever you need your GPU like playing video games or streaming videos.
This guide assumes you're familiar with the terminal and basic Linux commands. Most steps are similar to the Windows setup, with adjustments for Linux-specific commands and environments.
- Python Installation: If Python 3.x is already installed, you can skip the Miniconda installation. However, using Miniconda or Conda to manage dependencies is still recommended.
- CUDA: If CUDA is previously installed, ensure the PyTorch installation matches your CUDA version.
- Use your Linux distribution's package manager or download drivers directly from the NVIDIA website. For Ubuntu, you might use commands like
sudo apt update
andsudo ubuntu-drivers autoinstall
.
- Download the Miniconda installer for Linux from the Miniconda Downloads page.
- Use the command line to run the installer.
- Open a terminal.
- Create a new environment with
conda create --name gpu-3-11 python=3.11
. - Activate the environment using
conda activate gpu-3-11
.
- Install CUDA from the CUDA Toolkit download page appropriate for your Linux distribution. Follow the installation instructions provided on the NVIDIA website.
- Visit the PyTorch installation guide, set preferences for Linux, Conda, and the appropriate CUDA version.
- Use the provided command in the page, such as
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
, in your terminal.
- Use Git to clone the miner scripts repository with
git clone https://github.com/heurist-network/miner-release
. Alternatively, download the ZIP from the GitHub page and extract it.
- Ensure you're in the Conda environment (
conda activate gpu-3-11
). - Navigate to the miner-release directory.
- Install dependencies with
pip install -r requirements.txt
.
Use .env
in the miner-release folder to set a unique miner_id for each GPU. (See the top of this guide. This is very important for tracking your contribution!)
- Execute the miner script with
python3 sd-miner-v0.0.x.py
(select the latest version) in your terminal. Agree to download model files when prompted.
- Use
screen
ortmux
to keep the miner running in the background, especially when connected via SSH.
Follow these steps to set up the Heurist Miner on a Linux system, adjusting commands and procedures as necessary for your specific Linux distribution and setup.
- Input a prompt without the 77 token length limit.
- Includes tx2img, img2img, and inpainting pipelines.
- Emphasize/weigh part of your prompt with parentheses as so:
a baby deer with (big eyes)
- De-emphasize part of your prompt as so:
a [baby] deer with big eyes
- Precisely weigh part of your prompt as so:
a baby deer with (big eyes:1.3)
a baby deer with
==(a baby deer with:1.0)
(big eyes)
==(big eyes:1.1)
((big eyes))
==(big eyes:1.21)
[big eyes]
==(big eyes:0.91)