- Introduction
- System Requirements
- Quick Start Guide
- Detailed Setup Instructions
- Advanced Configuration
- Troubleshooting
- FAQ
- Support and Community
Welcome to the Heurist Miner, the entrance to decentralized generative AI. Whether you have a high-end gaming PC with NVIDIA GPU or you're a datacenter owner ready to explore the world of AI and cryptocurrency, this guide will help you get started on an exciting journey!
Heurist Miner allows you to contribute your GPU to perform AI inference tasks on the Heurist network. By running this miner, you'll earn rewards by hosting AI models and supporting various applications in Heurist ecosystem.
- ๐ผ๏ธ Dual Mining Capabilities: Support for both image generation models and Large Language Models.
- ๐ฅ๏ธ Flexible Setup: Run on Windows or Linux, with support for multiple GPUs.
- ๐ Secure Rewards: Utilizes a dual-wallet system for enhanced security.
- ๐ Open Source: The code is fully open and transparent. Download and run with ease.
Before you begin, ensure your system meets the following requirements:
- GPU: NVIDIA GPU with at least 12GB VRAM (24GB+ recommended for optimal performance)
- CPU: Multi-core processor (4+ cores recommended)
- RAM: 16GB+ system RAM
- Storage: At least 50GB free space (NVMe recommended for faster model loading)
- Operating System:
- Windows 10/11 (64-bit)
- Linux (Ubuntu 20.04 LTS or later recommended)
- CUDA: Version 12.1, or 12.2
- Python: Version 3.10 or 3.11
- Git: For cloning the repository
- Stable internet connection (100 Mbps+ recommended)
- Ability to access HuggingFace and GitHub repositories
- Some models (especially larger LLMs) may require more VRAM. Check the model-specific requirements in the detailed setup sections.
- Ensure your system is up-to-date with the latest NVIDIA GPU drivers.
- Stable Diffusion models need at least 8-10GB VRAM, while LLMs can require 16GB to 40GB+ depending on the model size.
For experienced users, here's a quick overview to get you mining:
- Clone the Repository
git clone https://github.com/heurist-network/miner-release.git
cd miner-release
- Set Up Environment
- Install Miniconda (if not already installed)
- Create and activate a new conda environment:
conda create --name heurist-miner python=3.11
conda activate heurist-miner
- Install Dependencies
pip install -r requirements.txt
- Configure Miner ID
- Create a
.env
file in the root directory - Add your Ethereum wallet address:
MINER_ID_0=0xYourWalletAddressHere
Follow "Multiple GPU Configuration" section if you have multiple GPUs.
- Choose Your Miner
- For Stable Diffusion:
python sd-miner.py
- For LLM:
./llm-miner-starter.sh <model_id>
For detailed instructions, troubleshooting, and advanced configuration, please refer to the sections below.
(current version only supports Flux model)
For users who prefer using Docker, follow these steps:
- Build the Docker Image
docker build -t heurist-miner:latest .
- Run the Docker Container
Single GPU:
sudo docker run -d --gpus all \
-e MINER_ID_0=0xWalletAddressHere \
-e LOG_LEVEL=INFO \
-v $HOME/.cache/heurist:/app/.cache/heurist \
heurist-miner:latest
Replace 0xYourWalletAddressHere
with your wallet address to receive rewards.
Multiple GPUs:
sudo docker run -d --gpus all \
-e MINER_ID_0=0xYourFirstWalletAddressHere \
-e MINER_ID_1=0xYourSecondWalletAddressHere \
-e MINER_ID_2=0xYourThirdWalletAddressHere \
-e LOG_LEVEL=INFO \
-v $HOME/.cache/heurist:/app/.cache/heurist \
heurist-miner:latest
Replace 0xYourFirstWalletAddressHere
, 0xYourSecondWalletAddressHere
, and 0xYourThirdWalletAddressHere
with your actual wallet addresses.
This command:
- Runs the container in detached mode (
-d
) - Allows access to all GPUs (
--gpus all
) - Sets environment variables for miner IDs and log level
- Mounts a volume for persistent cache storage
- Uses the image we just built (
heurist-miner:latest
)
Note: Ensure you have the NVIDIA Container Toolkit installed for GPU support in Docker.
Heurist Miner uses a dual-wallet system for security and reward distribution:
- Identity Wallet: Used for authentication, stored locally. Do not store funds here.
- Reward Wallet (Miner ID): Receives points, Heurist Token rewards, potential ecosystem benefits.
- Create a
.env
file in the root directory of your miner installation. - Add your Ethereum wallet address(es) as Miner ID(s):
MINER_ID_0=0xYourFirstWalletAddressHere MINER_ID_1=0xYourSecondWalletAddressHere
- (Optional) Add custom tags for tracking:
MINER_ID_0=0xYourFirstWalletAddressHere-GamingPC4090 MINER_ID_1=0xYourSecondWalletAddressHere-GoogleCloudT4
- Generate or import identity wallets:
Follow the prompts to create new wallets or import existing ones.
python3 ./auth/generator.py
- Install Miniconda:
- Download from Miniconda website
- Choose the latest Windows 64-bit version for Python 3.11
- Create Conda Environment:
conda create --name heurist-miner python=3.11 conda activate heurist-miner
- Install CUDA Toolkit:
- Download CUDA 12.1 from NVIDIA website
- Follow the installation prompts
- Install PyTorch with GPU Support:
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
- Clone Miner Repository and Install Dependencies:
git clone https://github.com/heurist-network/miner-release cd miner-release pip install -r requirements.txt
- Run the Miner:
python3 sd-miner.py
- Update GPU Drivers (if necessary):
sudo apt update sudo ubuntu-drivers autoinstall
- Install Miniconda:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh
- Create Conda Environment:
conda create --name heurist-miner python=3.11 conda activate heurist-miner
- Install CUDA Toolkit:
- Follow instructions on NVIDIA CUDA Installation Guide
- Install PyTorch with GPU Support:
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
- Clone Miner Repository and Install Dependencies:
git clone https://github.com/heurist-network/miner-release cd miner-release pip install -r requirements.txt
- Run the Miner:
python3 sd-miner.py
- Ensure CUDA Driver is Installed:
- Check with
nvidia-smi
- Check with
- Select a Model ID:
- Choose based on your GPU's VRAM capacity
- Example models:
dolphin-2.9-llama3-8b
(24GB VRAM)openhermes-mixtral-8x7b-gptq
(40GB VRAM)
- Run the Setup Script:
Options:
chmod +x llm-miner-starter.sh ./llm-miner-starter.sh <model_id> --miner-id-index 0 --port 8000 --gpu-ids 0
--miner-id-index
: Index of miner_id in.env
(default: 0)--port
: Port for vLLM process (default: 8000)--gpu-ids
: GPU ID to use (default: 0)
- Wait for Model Download:
- First run will download the model (can take time)
- Models are saved in
$HOME/.cache/huggingface
Note: 8x7b, 34b, and 70b models may take up to an hour to load on some devices.
When running the SD miner, you can use various CLI options to customize its behavior. You can combine multiple flags.
-
Log Level
- Set the verbosity of log messages:
python3 sd-miner.py --log-level DEBUG
- Options: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: INFO)
- Set the verbosity of log messages:
-
Auto-Confirm
- Automatically confirm model downloads:
python3 sd-miner.py --auto-confirm yes
- Options: yes, no (default: no)
- Automatically confirm model downloads:
-
Exclude SDXL
- Exclude SDXL models to reduce VRAM usage:
python3 sd-miner.py --exclude-sdxl
- Exclude SDXL models to reduce VRAM usage:
-
Specify Model ID
- Run the miner with a specific model:
python3 sd-miner.py --model-id <model_id>
- For example, run FLUX.1-dev model with:
python3 sd-miner.py --model-id FLUX.1-dev --skip-checksum
- Run the miner with a specific model:
-
CUDA Device ID
- Specify which GPU to use:
python3 sd-miner.py --cuda-device-id 0
- Specify which GPU to use:
-
Skip checksum to speed up miner start-up time
- This skips checking the validity of model files. However, if incompleted files are present on the disk, the miner process will crash without this check.
python3 sd-miner.py --skip-checksum
- This skips checking the validity of model files. However, if incompleted files are present on the disk, the miner process will crash without this check.
For LLM miner, use the following CLI options to customize its behavior:
-
Specify Model ID
- Run the miner with a specific model (mandatory):
./llm-miner-starter.sh <model_id>
- Example:
dolphin-2.9-llama3-8b
(requires 24GB VRAM)
- Run the miner with a specific model (mandatory):
-
Miner ID Index
- Specify which miner ID from the
.env
file to use:./llm-miner-starter.sh <model_id> --miner-id-index 1
- Default: 0 (uses the first address configured)
- Specify which miner ID from the
-
Port
- Set the port for communication with the vLLM process:
./llm-miner-starter.sh <model_id> --port 8001
- Default: 8000
- Set the port for communication with the vLLM process:
-
GPU IDs
-
Specify which GPU(s) to use:
./llm-miner-starter.sh <model_id> --gpu-ids 1
-
Default: 0
-
Example combining multiple options:
./llm-miner-starter.sh dolphin-2.9-llama3-8b --miner-id-index 1 --port 8001 --gpu-ids 1
-
Advanced usage: To deploy large models using multiple GPUs on the same machine.
./llm-miner-starter.sh openhermes-mixtral-8x7b-gptq --miner-id-index 0 --port 8000 --gpu-ids 0,1
-
To utilize multiple GPUs:
- Assign unique Miner IDs in your
.env
file:MINER_ID_0=0xWalletAddress1 MINER_ID_1=0xWalletAddress2
- Set
num_cuda_devices
inconfig.toml
:[system] num_cuda_devices = 2
- Run the miner without specifying a CUDA device ID to use all available GPUs.
Running into issues? Don't worry, we've got you covered! Here are some common problems and their solutions:
-
๐จ CUDA not found
- Ensure CUDA is properly installed
- Check if the CUDA version matches PyTorch requirements
โ Solution: Reinstall CUDA or update PyTorch to match your CUDA version
-
๐จ Dependencies installation fails
- Check your Python version (should be 3.10 or 3.11)
- Ensure you're in the correct Conda environment
โ Solution: Create a new Conda environment and reinstall dependencies
-
๐จ CUDA out of memory error
- Check available GPU memory using
nvidia-smi
- Stop other programs occupying VRAM, or use a smaller model
โ Solution: Add--exclude-sdxl
flag for SD miner or choose a smaller LLM
- Check available GPU memory using
-
๐จ Miner not receiving tasks
- Check your internet connection
- Verify your Miner ID is correctly set in the
.env
file
โ Solution: Restart the miner and check logs for connection issues
-
๐จ Model loading takes too long
- This is normal for large models, especially on first run
- Check disk space and internet speed
โ Solution: Be patient (grab a coffee! โ), or choose a smaller model
- ๐ Always check the console output for specific error messages
- ๐ Ensure you're using the latest version of the miner software
- ๐ฌ If problems persist, don't hesitate to ask for help in our Discord community!
Got questions? We've got answers!
1๏ธโฃ Can I run both SD and LLM miners simultaneously? ๐ฅ๏ธ๐ฅ๏ธ
2๏ธโฃ How do I know if I'm earning rewards? ๐ฐ
3๏ธโฃ What's the difference between Identity Wallet and Reward Wallet? ๐ญ๐ผ
4๏ธโฃ Can I use my gaming PC for mining when I'm not gaming? ๐ฎโก๏ธ๐ป
5๏ธโฃ How often should I update the miner software? ๐
Join our lively community on Discord - it's where all the cool miners hang out! ๐ Heurist Discord #dev-chat channel
- ๐ Check our Troubleshooting guide and FAQ - you might find a quick fix!
- ๐ Still stuck? Head over to our GitHub Issues page: ๐ Heurist Miner Issues
- ๐ When reporting, remember to include:
- Miner version
- Model
- Operating System
- Console error messages and log files
- Steps to reproduce
Keep up with the latest Heurist happenings:
- ๐ Medium: Heurist Blogs
- ๐ฃ Discord: Tune into our #miner-announcements channel
- ๐ฆ X/Twitter: Follow Heurist for the latest updates