From df6598f41a0cb7f747e6b3395abebc7b3b101646 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:41:40 +0000 Subject: [PATCH] HiveOS: rigs mine only until a Linux prover ships; IDENTITIES=auto by VRAM README: a second paragraph under the title says the package carries igneumd, igneum-miner and the two workers and no prover (make-hive-package.sh), so a HiveOS rig earns nothing from the 20% proving share until a Linux prover build is published; the rig installer on rig-install (cf716a6, packaging/linux/README.md) idles its prover unit in state setup for the same reason. A per-card table (8, 12, 16, 24, 32 GB) from the app's rule in provedefault.rs and the proving agent's measurements of 5 October 2026 (bench-log "proving v1": 13.9 GB prover alone on an empty shard, 28.3 GB on the full prototype shard, 15.6 GB and 16.75 GB mine-and-prove on one 5090, 30.0 GB full shard beside the miner), marked before the v1-shard row. IDENTITIES: the app's rule (detect.rs) is 8 vote keys for a card with 8 GiB or more, else 2. h-config.sh now defaults to IDENTITIES=auto and resolves it per card from nvidia-smi memory.total or /sys/class/drm/card/device/mem_info_vram_total (amdgpu), 8 when neither answers, writing IDENTITIES_GPU keys into igneum.conf beside the IDENTITIES=8 fallback; a number still overrides every card. h-run.sh reads IDENTITIES_GPU first, else IDENTITIES. The README and the h-config comment say the number. selftest.sh: IDENTITIES=auto with no GPU tools (8, no per-card keys), the default being auto, a stubbed nvidia-smi printing 6144 and 24576 (gpu0=2, gpu1=8), the numeric override, and h-run taking IDENTITIES_GPU1=3 over the fallback. bash packaging/hive/selftest.sh on this Mac: auto with no GPU tools: IDENTITIES=8, no per-card keys ok default (no IDENTITIES line) is auto ok auto with nvidia-smi 6144/24576: gpu0=2, gpu1=8 ok numeric override keeps IDENTITIES=4 ok == h-run.sh (fake GPUs: 2 NVIDIA, fake node, fake miner) dev fee lines in the main log: 4 DEV_FEE=0 reached the miner as --dev-fee 0 ok gpu0 took the IDENTITIES=8 fallback ok gpu1 took IDENTITIES_GPU1=3 over the fallback ok NVIDIA cards got the cuda worker ok exit 42 restarted the miner and re-exported the pack ok == h-stats.sh (sourced) stats JSON ok: hs [118500.0, 118500.0] temp [61, 58] ar [24, 0] bus [1, 2] == self-test passed (scripts and stats shape; Hive itself is untested) Co-Authored-By: Claude Fable 5.1 --- packaging/hive/README.md | 29 +++++++++++++++++++++--- packaging/hive/h-config.sh | 46 +++++++++++++++++++++++++++++++++----- packaging/hive/h-run.sh | 3 ++- packaging/hive/selftest.sh | 18 ++++++++++++++- 4 files changed, 86 insertions(+), 10 deletions(-) diff --git a/packaging/hive/README.md b/packaging/hive/README.md index 6676e1a6..e5072ded 100644 --- a/packaging/hive/README.md +++ b/packaging/hive/README.md @@ -6,6 +6,26 @@ the two GPU workers (`igneum-worker-cuda` for NVIDIA, `igneum-worker-opencl` for scripts were self-tested with stub binaries (`selftest.sh`) and the binaries were cross-compiled on a Mac; the first real run on a Hive rig is still to come. Report what breaks. +**A HiveOS rig mines only.** The package (`make-hive-package.sh`) carries `igneumd`, `igneum-miner` and the two +workers; no `igneum-prove-host`, no `igneum-prove-export`, no SP1 GPU server. So a rig on this package earns from the +80% lottery share and nothing from the 20% proving share until a Linux prover build is published. The Ubuntu rig +installer (`packaging/linux/README.md`, branch `rig-install`, commit dd632c1) carries a prover unit that idles in state +`setup` for the same reason; its per-card table is the fuller version of the one below. What each card could do once +the prover ships, from the app's rule (`app/igneum-app/src/provedefault.rs` on `proving-v1`: 20 GB mines and proves on +one card, 16 GB proves only with the miner paused, under 16 GB mines only) and from the proving agent's measurements +of 5 October 2026, before the v1-shard row (`docs/bench-log.md`, "proving v1": jobs `prover-cost-pc2-pv1b`, +`chain-pc2-pv1c`, `memsweep-pc2-pv1`, `memminer-pc2-pv1`, one RTX 5090): + +| Card | Once a Linux prover ships | Measured on 5 October 2026 | +|---|---|---| +| 8 GB | mines only | the prover alone peaks at 13.9 GB on an empty shard | +| 12 GB | mines only | the same 13.9 GB does not fit | +| 16 GB | proves only, with the miner paused | mine-and-prove peaked at 15.6 GB on empty shards and 16.75 GB with chained aggregation | +| 24 GB | mines and proves | 16.75 GB leaves 7 GB; the full prototype shard (28.3 GB with the card to itself) does not fit | +| 32 GB | mines and proves | the full prototype shard beside the miner peaked at 30.0 GB | + +The v1-budget shard (about 7 M cycles) is unmeasured and may move these lines. + ## Flight Sheet | Field | Value | @@ -16,7 +36,8 @@ run on a Hive rig is still to come. Report what breaks. | Wallet and worker template | `0x<40 hex>.%WORKER_NAME%`: the payout address is an EVM address you hold the key for; the part after the dot labels this rig's keys | | Pool URL | `grpc://:26610` (your own igneumd, solo mining), or `local` to run the bundled node on the rig | | Pass | empty | -| Extra config arguments | `DEV_FEE=1 IDENTITIES=8 WORKER=auto VOTE=1` (one per line also works); `PEERS=a:26611,b:26611` for the bundled node; `EXTRA="..."` for more miner flags | +| Extra config arguments | `DEV_FEE=1 IDENTITIES=auto WORKER=auto VOTE=1` (one per line also works); `PEERS=a:26611,b:26611` for the bundled node; `EXTRA="..."` for more miner flags | +| IDENTITIES | vote keys per card: 8 for a card with 8 GB or more, else 2 (`IDENTITIES=auto` applies that rule, per card, from `nvidia-smi` or the amdgpu sysfs; 8 when neither answers; a number overrides it for every card). The rule is the app's (`app/igneum-app/src/detect.rs`) | Solo mining: there is no pool. Each card mines block templates from the node and the block reward pays the wallet in the template (80% of each block to its finder, 20% to the proving pool; the protocol takes no fee for anyone). @@ -37,8 +58,8 @@ The protocol carries no fee: this is the software's, and any other miner client | Hook | What | |---|---| -| `h-config.sh` | writes `igneum.conf` from the Flight Sheet (node URL, wallet, label, DEV_FEE, IDENTITIES, WORKER, VOTE, PEERS, EXTRA); refuses a wallet that is not 0x + 40 hex | -| `h-run.sh` | starts the bundled node when the URL is `local`, waits for the node, exports the hourly program pack (`igneum-miner export-pack`), then one `igneum-miner` per GPU with its worker; restarts a miner that exits (exit 42 = program change without prepare support: the pack is re-exported first); per-GPU logs `.gpu.log`, merged into the main log | +| `h-config.sh` | writes `igneum.conf` from the Flight Sheet (node URL, wallet, label, DEV_FEE, IDENTITIES, WORKER, VOTE, PEERS, EXTRA); resolves `IDENTITIES=auto` to `IDENTITIES_GPU` keys by VRAM; refuses a wallet that is not 0x + 40 hex | +| `h-run.sh` | starts the bundled node when the URL is `local`, waits for the node, exports the hourly program pack (`igneum-miner export-pack`), then one `igneum-miner` per GPU with its worker (`--identities` from `IDENTITIES_GPU`, else `IDENTITIES`); restarts a miner that exits (exit 42 = program change without prepare support: the pack is re-exported first); per-GPU logs `.gpu.log`, merged into the main log | | `h-stats.sh` | per-GPU hash rate from each miner's last `STATUS` line (`now=`), accepted and rejected totals, dev-fee block count, temperatures and fans from Hive's `gpu-stats` (else `nvidia-smi`), uptime, version | Stats JSON (what Hive reads from `$stats`): `hs` (kH/s per GPU), `hs_units` (`khs`), `temp`, `fan`, `uptime` (s), @@ -67,3 +88,5 @@ Stats JSON (what Hive reads from `$stats`): `hs` (kH/s per GPU), `hs_units` (`kh - GPU order: the CUDA device index is assumed to follow `nvidia-smi` order and Hive's `gpu-stats` arrays (NVIDIA first); a mixed NVIDIA and AMD rig may show temperatures against the wrong card. - Each card runs its own `igneum-miner` and node connection; the node's template RPC serves them all. +- No prover in the package (the second paragraph above): the rig earns nothing from the proving share until a Linux + prover build ships. diff --git a/packaging/hive/h-config.sh b/packaging/hive/h-config.sh index 60f1d044..3c724ae7 100755 --- a/packaging/hive/h-config.sh +++ b/packaging/hive/h-config.sh @@ -8,7 +8,10 @@ # CUSTOM_USER_CONFIG extra lines, KEY=VALUE, one per line or separated by spaces: # DEV_FEE=1 the miner software's dev fee in whole percent (1 block template in 100 to the dev # address); DEV_FEE=0 turns it off. The protocol itself takes no fee. -# IDENTITIES=8 vote keys per card (8 for a big card, 2 for a small one) +# IDENTITIES=auto vote keys per card: 8 for a card with 8 GB or more, else 2 (IDENTITIES=auto +# applies that rule per card from nvidia-smi or the amdgpu sysfs, 8 when neither +# answers; the app's rule, app/igneum-app/src/detect.rs). A number overrides it +# for every card. # WORKER=auto auto | cuda | opencl (the GPU worker; auto = cuda on NVIDIA, opencl on AMD) # VOTE=1 sign finality checkpoints (0 = mine without voting) # PEERS=a:26611,b:26611 peers for the bundled node when CUSTOM_URL=local @@ -29,7 +32,7 @@ if ! [[ "$wallet" =~ ^0x[0-9a-fA-F]{40}$ ]]; then fi # defaults, then the user's KEY=VALUE lines -DEV_FEE=1; IDENTITIES=8; WORKER=auto; VOTE=1; PEERS=""; EXTRA="" +DEV_FEE=1; IDENTITIES=auto; WORKER=auto; VOTE=1; PEERS=""; EXTRA="" while read -r kv; do [[ -z "$kv" || "$kv" == \#* ]] && continue key="${kv%%=*}"; val="${kv#*=}" @@ -39,7 +42,40 @@ while read -r kv; do esac done < <(printf '%s\n' "$CUSTOM_USER_CONFIG" | tr ' ' '\n' | sed 's/^"//; s/"$//') [[ "$DEV_FEE" =~ ^[0-9]+$ ]] || DEV_FEE=1 -[[ "$IDENTITIES" =~ ^[0-9]+$ ]] || IDENTITIES=8 +[[ "$IDENTITIES" =~ ^[0-9]+$ || "$IDENTITIES" == "auto" ]] || IDENTITIES=auto + +# IDENTITIES=auto: 8 for a card with 8 GiB (8192 MiB) or more, else 2, per card, in the order h-run.sh numbers them +# (NVIDIA first unless WORKER=opencl, then AMD unless WORKER=cuda). VRAM from nvidia-smi (MiB per line) and from +# /sys/class/drm/card/device/mem_info_vram_total (bytes, amdgpu). A card whose VRAM cannot be read gets 8. +ident_block="" # IDENTITIES_GPU=... lines, one per card, newline-terminated +ident_summary="" +if [[ "$IDENTITIES" == "auto" ]]; then + vrams=() + if [[ "$WORKER" != "opencl" ]] && command -v nvidia-smi >/dev/null 2>&1; then + nvq=(nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits) + command -v timeout >/dev/null 2>&1 && nvq=(timeout 20 "${nvq[@]}") + while read -r mib; do + mib="${mib//[[:space:]]/}" + [[ "$mib" =~ ^[0-9]+$ ]] && vrams+=("$mib") || vrams+=("") + done < <("${nvq[@]}" 2>/dev/null) + fi + if [[ "$WORKER" != "cuda" ]]; then + for d in "${IGNEUM_DRM_ROOT:-/sys/class/drm}"/card*; do + [[ "$(basename "$d")" =~ ^card[0-9]+$ && -r "$d/device/mem_info_vram_total" ]] || continue + bytes="$(cat "$d/device/mem_info_vram_total" 2>/dev/null)" + [[ "$bytes" =~ ^[0-9]+$ ]] && vrams+=("$((bytes / 1048576))") || vrams+=("") + done + fi + n=0 + for mib in ${vrams[@]+"${vrams[@]}"}; do + if [[ -z "$mib" || "$mib" -ge 8192 ]]; then ident=8; else ident=2; fi + ident_block+="IDENTITIES_GPU$n=$ident"$'\n' + ident_summary+="gpu$n ${mib:-?}MiB:$ident " + n=$((n + 1)) + done + IDENTITIES=8 # the fallback h-run.sh uses for a card h-config.sh could not see + [[ $n == 0 ]] && ident_summary="no VRAM readable, 8 per card" +fi url="$CUSTOM_URL" [[ "$url" == "local" ]] && url="local" @@ -53,9 +89,9 @@ WALLET=$(printf '%s' "$wallet" | tr 'A-F' 'a-f') LABEL=$label DEV_FEE=$DEV_FEE IDENTITIES=$IDENTITIES -WORKER=$WORKER +${ident_block}WORKER=$WORKER VOTE=$VOTE PEERS=$PEERS EXTRA=$EXTRA CONF -echo "Igneum: config written to $CUSTOM_CONFIG_FILENAME (node $url, wallet ${wallet:0:8}..., dev fee ${DEV_FEE}%, $IDENTITIES identities per card)" +echo "Igneum: config written to $CUSTOM_CONFIG_FILENAME (node $url, wallet ${wallet:0:8}..., dev fee ${DEV_FEE}%, identities ${ident_summary:-$IDENTITIES per card})" diff --git a/packaging/hive/h-run.sh b/packaging/hive/h-run.sh index c936fe4b..d07aa9ab 100755 --- a/packaging/hive/h-run.sh +++ b/packaging/hive/h-run.sh @@ -59,7 +59,8 @@ run_gpu() { local log="$CUSTOM_LOG_BASENAME.gpu$idx.log" local args=(mine "$NODE_URL" 1 100000000 "$LABEL-gpu$idx" --worker "$BIN/$worker" --worker-args "--device $dev --pack packs/devnet" --prepare-packs packs/prepare --exit-on-seed-change --evm-address "$WALLET" --payout-label "$LABEL-gpu$idx" --status-secs 30) - [[ "$IDENTITIES" -gt 1 ]] && args+=(--identities "$IDENTITIES") + local identv="IDENTITIES_GPU$idx" ident="$IDENTITIES"; [[ -n "${!identv:-}" ]] && ident="${!identv}" # per-card from h-config.sh, else the fallback + [[ "$ident" -gt 1 ]] && args+=(--identities "$ident") [[ "$VOTE" == "0" ]] && args+=(--no-vote) [[ "$DEV_FEE" != "1" ]] && args+=(--dev-fee "$DEV_FEE") [[ -n "$EXTRA" ]] && args+=($EXTRA) diff --git a/packaging/hive/selftest.sh b/packaging/hive/selftest.sh index 66b75de9..40fcedfe 100755 --- a/packaging/hive/selftest.sh +++ b/packaging/hive/selftest.sh @@ -49,6 +49,21 @@ export CUSTOM_CONFIG_FILENAME="$M/igneum.conf" CUSTOM_LOG_BASENAME="$T/log/igneu ( . "$M/h-config.sh" ) || { echo "h-config.sh failed"; exit 1; } grep -q '^WALLET=0xabcd000000000000000000000000000000000001$' "$M/igneum.conf" && grep -q '^DEV_FEE=0$' "$M/igneum.conf" && grep -q '^LABEL=rig7$' "$M/igneum.conf" && grep -q '^IDENTITIES=4$' "$M/igneum.conf" && echo " conf ok: $(tr '\n' ' ' < "$M/igneum.conf" | cut -c1-160)" ( CUSTOM_TEMPLATE="notanaddress" . "$M/h-config.sh" >/dev/null 2>&1 ) && { echo "h-config.sh accepted a bad wallet"; exit 1; } || echo " bad wallet refused ok" +echo "== h-config.sh IDENTITIES=auto" +# no GPU tool on the PATH (gpu-detect is not a VRAM source) and no amdgpu sysfs: every card falls back to 8 +( CUSTOM_USER_CONFIG="IDENTITIES=auto" IGNEUM_DRM_ROOT="$T/no-drm" CUSTOM_CONFIG_FILENAME="$T/auto-none.conf" . "$M/h-config.sh" >/dev/null ) || { echo "h-config.sh failed on IDENTITIES=auto"; exit 1; } +grep -q '^IDENTITIES=8$' "$T/auto-none.conf" && ! grep -q '^IDENTITIES_GPU' "$T/auto-none.conf" && echo " auto with no GPU tools: IDENTITIES=8, no per-card keys ok" || { echo "FAIL: auto without tools"; cat "$T/auto-none.conf"; exit 1; } +# the default is auto: no IDENTITIES line at all gives the same +( CUSTOM_USER_CONFIG="" IGNEUM_DRM_ROOT="$T/no-drm" CUSTOM_CONFIG_FILENAME="$T/auto-default.conf" . "$M/h-config.sh" >/dev/null ) && grep -q '^IDENTITIES=8$' "$T/auto-default.conf" && echo " default (no IDENTITIES line) is auto ok" || { echo "FAIL: default not auto"; exit 1; } +# a stubbed nvidia-smi: 6 GB and 24 GB cards resolve to 2 and 8, in nvidia-smi order +printf '#!/bin/sh\nprintf "6144\\n24576\\n"\n' > "$T/bin/nvidia-smi"; chmod +x "$T/bin/nvidia-smi" +( CUSTOM_USER_CONFIG="IDENTITIES=auto" IGNEUM_DRM_ROOT="$T/no-drm" CUSTOM_CONFIG_FILENAME="$T/auto-nv.conf" . "$M/h-config.sh" >/dev/null ) || { echo "h-config.sh failed on stubbed nvidia-smi"; exit 1; } +grep -q '^IDENTITIES_GPU0=2$' "$T/auto-nv.conf" && grep -q '^IDENTITIES_GPU1=8$' "$T/auto-nv.conf" && grep -q '^IDENTITIES=8$' "$T/auto-nv.conf" && grep -q '^WORKER=auto$' "$T/auto-nv.conf" && echo " auto with nvidia-smi 6144/24576: gpu0=2, gpu1=8 ok" || { echo "FAIL: auto by VRAM"; cat "$T/auto-nv.conf"; exit 1; } +# a number still overrides every card +( CUSTOM_USER_CONFIG="IDENTITIES=4" CUSTOM_CONFIG_FILENAME="$T/auto-num.conf" . "$M/h-config.sh" >/dev/null ) && grep -q '^IDENTITIES=4$' "$T/auto-num.conf" && ! grep -q '^IDENTITIES_GPU' "$T/auto-num.conf" && echo " numeric override keeps IDENTITIES=4 ok" || { echo "FAIL: numeric override"; exit 1; } +rm -f "$T/bin/nvidia-smi" +# h-run.sh reads IDENTITIES_GPU first: write a conf with gpu1=3 and check the second miner's argv +( CUSTOM_USER_CONFIG=$'DEV_FEE=0\nIDENTITIES=auto' IGNEUM_DRM_ROOT="$T/no-drm" CUSTOM_CONFIG_FILENAME="$M/igneum.conf" . "$M/h-config.sh" >/dev/null ) && printf 'IDENTITIES_GPU1=3\n' >> "$M/igneum.conf" echo "== h-run.sh (fake GPUs: 2 NVIDIA, fake node, fake miner)" ( cd "$M" && CUSTOM_CONFIG_FILENAME="$M/igneum.conf" CUSTOM_LOG_BASENAME="$T/log/igneum" ./h-run.sh > "$T/log/run.out" 2>&1 ) & disown @@ -56,7 +71,8 @@ sleep 8 ls "$T/log" | sed 's/^/ /' _lines=$(grep -c "dev fee off (--dev-fee 0)" "$T/log/igneum.log" || true); echo " dev fee lines in the main log: $_lines"; [[ "$_lines" -ge 2 ]] || { echo "FAIL: expected the two miners' dev fee lines in the main log"; cat "$T/log/run.out"; exit 1; } grep -q -- "--dev-fee 0" "$M/argv.log" && echo " DEV_FEE=0 reached the miner as --dev-fee 0 ok" || { echo "FAIL: --dev-fee 0 missing"; exit 1; } -grep -q -- "--identities 4" "$M/argv.log" && echo " IDENTITIES=4 reached the miner ok" || { echo "FAIL: --identities 4 missing"; exit 1; } +grep -q -- "rig7-gpu0 .*--identities 8" "$M/argv.log" && echo " gpu0 took the IDENTITIES=8 fallback ok" || { echo "FAIL: --identities 8 missing on gpu0"; cat "$M/argv.log"; exit 1; } +grep -q -- "rig7-gpu1 .*--identities 3" "$M/argv.log" && echo " gpu1 took IDENTITIES_GPU1=3 over the fallback ok" || { echo "FAIL: --identities 3 missing on gpu1"; cat "$M/argv.log"; exit 1; } grep -q "igneum-worker-cuda" "$M/argv.log" && echo " NVIDIA cards got the cuda worker ok" || { echo "FAIL: cuda worker missing"; exit 1; } [[ -f "$M/exited42" && $(grep -c "^mine" "$M/argv.log") -ge 3 ]] && echo " exit 42 restarted the miner and re-exported the pack ok" || { echo "FAIL: no restart after exit 42"; exit 1; } echo "== h-stats.sh (sourced)"