Mosaic
  • 🐳WELCOME
    • Introduction
    • Vision
    • About Mosaic
    • Roadmap
  • 🎨Features
    • Magic Prompt
    • Magic Model
  • 📚Guides
    • Miner Guide
Powered by GitBook
On this page
  • Hardware Requirements
  • System Requirements
  • Register your miner as a module
  • Option 1: Run with Docker (Recommended)
  • Option 2: Run with source code
  1. Guides

Miner Guide

Start mining Mosaic on the Commune subnet (uid 14)

PreviousMagic Model

Last updated 1 year ago

Hardware Requirements

  • Memory: >= 16GB

  • GPU: >= 16GB VRAM

  • Storage: >= 50GB

  • Public IP

System Requirements

  • NVIDIA GPU Driver installed

  • Python >= 3.10

  • cli tool for commune key management

  • CUDA >= 12.2 (no need if running with Docker)

Register your miner as a module

First, you need to create a key for your miner if you dont have one:

comx key create <key-name>

Then, transfer some $COMAI to your key, and register your miner as a module:

comx module register <module-name> <key-name> --netuid=14 --ip=<ip> --port=<port>

The IP and port should both be public for the validator to access them.

Option 1: Run with Docker (Recommended)

We highly recommend using Docker to run the miner. This method can increase the robustness of the services and enable automatic upgrades.

Prerequisites

You need to install the following components:

Run miner with docker

docker run --gpus=all -d --network host --restart always \
    -v $HOME/.commune:/root/.commune \
    -v $HOME/.cache/huggingface:/root/.cache/huggingface \
    --name mosaic-miner \
    mos4ic/mosaic-subnet:latest \
    python mosaic_subnet/cli.py miner <key-name> 0.0.0.0 <port>

Enable auto upgrade

This container will periodically check for the latest mosaic docker image, pull it, and restart the running containers using the new image.

docker run -d \
    --name watchtower \
    -v /var/run/docker.sock:/var/run/docker.sock \
    containrrr/watchtower --interval 300 mosaic-miner

Option 2: Run with source code

Installation

# clone this project
git clone https://github.com/mosaicx-org/mosaic-subnet
cd mosaic-subnet

# start virtualenv and enter it
poetry shell

# install dependencies
poetry install

Run miner with Python

python mosaic_subnet/cli.py miner <key-name> 0.0.0.0 <port>

and run the following commands:

📚
comx
Docker
NVIDIA GPU Driver
NVIDIA container toolkit
Install Poetry