From 94c6e11eceda3751f4246decd229a02ec1019695 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Sat, 3 Oct 2026 20:00:11 +0000 Subject: [PATCH] windows-miner: console dashboard in the mining window, AMD jobs shortened The window now shows a dashboard redrawn in place every 2 s (Write-Host colours, [Console]::SetCursorPosition): the Igneum mark, PC and node with connected/waiting, one card per GPU with the hash rate in big digits, blocks found tonight and in the last 10 minutes, one cell per identity (mining, starting, warming up, rebuilding, waiting, errors, restarting, stopped), a network line from igneum-miner watch (blocks/s, difficulty trend, share of the last 100 blocks), the last 5 events in words and a footer. PLAIN=1 in the bat, a redirected output or a non-console host give the old scrolling output. The launcher log keeps the full detail; miner logs are read incrementally with FileShare ReadWrite. The 0.00 MH/s / template age n/a lines were AMD identities whose first 16.7M-nonce job took 100 s (the miner prints STATUS only after a job ends); the regex matched the real format. AMD_JOB_NONCES=2097152 keeps those jobs near 10 s and the dashboard says "warming up" until the first STATUS line. Crash restarts no longer block the loop for 10 s. README and WINDOWS-MINER.md updated. Co-Authored-By: Claude Fable 5.1 --- proto-cuda/WINDOWS-MINER.md | 42 +- proto-cuda/windows-miner/README.txt | 3 +- proto-cuda/windows-miner/START-MINING.bat | 10 +- proto-cuda/windows-miner/start-mining.ps1 | 599 ++++++++++++++++++++-- 4 files changed, 600 insertions(+), 54 deletions(-) diff --git a/proto-cuda/WINDOWS-MINER.md b/proto-cuda/WINDOWS-MINER.md index a71dda91a..ec1126ba0 100644 --- a/proto-cuda/WINDOWS-MINER.md +++ b/proto-cuda/WINDOWS-MINER.md @@ -18,15 +18,38 @@ What the launcher does: lists GPUs and tools; exports the pack for the node's cu `igneum-miner mine ... --worker --exit-on-seed-change` identities per GPU vendor, each with its own worker process (about 1.3 GiB of GPU memory: 256 MiB cache plus 1 GiB dataset), its own vote key and payout address derived from the PC name and the index (`--payout-label nvidia--`, the same on a rerun) and its own random 64-bit nonce start per -job; prints a status line per identity and a total per vendor every 30 s; uploads the logs every 60 s under -`--`; on miner exit code 42 (the epoch or day seed changed) stops that vendor's identities, -re-exports, rebuilds and restarts them all, logging the time (the exe cannot be rebuilt while an instance runs it); on -any other exit restarts that identity after 10 s; Ctrl+C prints a summary and uploads once more. One shared worker per -vendor would need a multiplexing protocol and is not built; with 8 identities the 5090 holds about 10 GiB of worker -memory, the integrated AMD GPU takes the same from system RAM. +job; writes a status line per identity and a total per vendor to the launcher log every 30 s; uploads the logs every +60 s under `--`; on miner exit code 42 (the epoch or day seed changed) stops that vendor's +identities, re-exports, rebuilds and restarts them all, logging the time (the exe cannot be rebuilt while an instance +runs it); on any other exit restarts that identity after 10 s; Ctrl+C prints a summary and uploads once more. One +shared worker per vendor would need a multiplexing protocol and is not built; with 8 identities the 5090 holds about +10 GiB of worker memory, the integrated AMD GPU takes the same from system RAM. + +The window (since 3 October 2026, evening) is a dashboard redrawn in place every 2 s with `[Console]::SetCursorPosition` +and `Write-Host` colours only: a header (the Igneum mark in the half-block font, the PC name, the node address, +"connected" in green or "waiting for the node" in yellow); one card per vendor with the card name from WMI ("RTX 5090", +"Radeon Graphics"), the summed hash rate of the identities' last STATUS lines in big digits, blocks found this run and in +the last 10 minutes, and one cell per identity (index, state, heartbeat marker, its own MH/s); a network line; the last +5 events; a footer. States: `mining` (green), `starting` (no `worker: ready` line yet), `warming up` (ready, no STATUS +line yet), `rebuilding`, `restarting`, `waiting` (no STATUS for 150 s and no block) in yellow, `errors` (a stderr line +in the last 60 s) and `stopped` in red. The network line comes from `igneum-miner watch 1 ` started in the +background every 30 s (its first line gives `blocks=`, `daa=`, `difficulty=`): blocks/s over the last 60 to 90 s, +difficulty rising/falling/steady against the reading 5 min back (2% band), and "your share of the last 100 blocks" = +accepted blocks of this PC in the time the network took to add its last 100. Found blocks are folded into one event per +card per minute. The launcher log keeps every line as before (events are logged too). `PLAIN=1` in the bat, a +redirected output, the ISE host or a window under 60x12 give the old scrolling output. + +Why some identities showed `0.00 MH/s, template age n/a` (fixed 3 October 2026): the miner prints its STATUS line only +after a job ends (`mine_worker` checks `last_report` once per job), and a job is `--job-nonces` nonces, 16,777,216 by +default. An RTX 5090 identity finishes that in under a second; the gfx1036 integrated GPU at 0.17 MH/s per identity +(eight share one compute unit) took 100 s, so the launcher's first status rounds found no STATUS line at all, and when +one came its template was 100 s old. The parser was matching the right format. The launcher now says "warming up" until +the first STATUS line, and the bat sets `AMD_JOB_NONCES=2097152` (a 2^21 job, about 10 s on that GPU; `NVIDIA_JOB_NONCES` +stays empty for the miner's default). The regex and the line it matches are quoted at the top of start-mining.ps1. Settings at the top of START-MINING.bat: `NODE_HOST`, `NODE_PORT`, `PAYOUT_ADDRESS` (one address for every identity; -empty = derived per identity), `MINERS`, `NVIDIA_DEVICE` (CUDA index), +empty = derived per identity), `MINERS`, `NVIDIA_JOB_NONCES` and `AMD_JOB_NONCES` (nonces per job, see above), `PLAIN` +(1 = scrolling output instead of the dashboard), `NVIDIA_DEVICE` (CUDA index), `CUDA_ARCH` (sm_120, or native), `AMD_VENDOR` (the OpenCL vendor string to match, default "Advanced Micro Devices", so NVIDIA's OpenCL device is never picked for the AMD worker), `AMD_DEVICE` (flat index override), `USE_NVIDIA`, `USE_AMD`, `VCVARS` and `VCVARS_VER` (14.30, the MSVC v143 toolset CUDA 12.8 accepts; Visual Studio 2026's own 14.5x crashes @@ -102,4 +125,7 @@ live); the OpenCL worker built with clang against Apple's OpenCL runtime (same b with `kernel_bound.cu` through the clang emulation shim (`emu/emu.sh igneum-devnet-emu`, bench PASS and a serve job bit-exact with Rust, seed-mismatch error exercised); `igneum-miner.exe` cross-compiled for x86_64-pc-windows-gnu. Not tested here: nvcc and cl.exe builds, the WMI GPU listing, vcvarsall import, winget, taskkill and Ctrl+C handling in -start-mining.ps1 (no PowerShell on this Mac), and running the .exe files on Windows. +start-mining.ps1 (no PowerShell on this Mac), the dashboard drawing (cursor positioning, the half-block glyphs in the +console font, the window-height fallback), and running the .exe files on Windows. The 3 October 2026 dashboard version +was checked only with a bracket and quote balance pass and a read-through; the first Windows run is the real test, and +`PLAIN=1` is the way back if the window misbehaves. diff --git a/proto-cuda/windows-miner/README.txt b/proto-cuda/windows-miner/README.txt index 96b15f5f3..db58b4589 100644 --- a/proto-cuda/windows-miner/README.txt +++ b/proto-cuda/windows-miner/README.txt @@ -1,5 +1,6 @@ Igneum devnet mining test. Double-click START-MINING.bat; it finds your GPUs, builds the NVIDIA (CUDA) and AMD (OpenCL) workers on the first run, and mines against the Mac node at 192.168.68.64 port 26610 (gRPC; p2p is 26611). Change the address, port, payout address or device choice at the top of START-MINING.bat. It needs CUDA Toolkit 12.8 or newer and Visual Studio with the MSVC v143 (14.30) x64 component; the AMD worker uses the OpenCL headers the CUDA Toolkit ships. The miner (igneum-miner.exe) is prebuilt, no Rust needed. MINERS=8 (top of the bat) starts 8 miner identities per GPU vendor, each with its own worker (about 1.3 GiB of GPU memory each), its own vote key and payout address derived from the PC name and the index (the same on a rerun), and its own random 64-bit nonce start per job, so no two miners repeat work; set MINERS=1 for a single-identity run. Logs are written next to the bat as nvidia--.log, amd--.log and launcher-.log, and uploaded every 60 seconds under the labels nvidia-- and amd--, so the log is already with us. -Every hour the program changes (epoch of 3,600 blocks) and once a day the cache seed changes: the miner stops with code 42, the launcher re-exports the pack from the node, rebuilds the worker (about 30 s for CUDA, a few seconds for OpenCL) and restarts it; a worker that dies for any other reason is restarted after 10 s. A status line per worker prints every 30 s. +The window shows a dashboard, redrawn every 2 seconds: the Igneum mark, the PC name, the node address and "connected" (or "waiting for the node" in yellow); one card per GPU (RTX 5090, Radeon Graphics) with its total hash rate in big digits, blocks found tonight, blocks in the last 10 minutes and one cell per miner ("mining" in green, "starting", "warming up", "rebuilding" or "waiting" in yellow, "errors" or "stopped" in red, with the miner's own hash rate); a network line (blocks per second on the chain, whether the difficulty is rising, falling or steady, and your share of the last 100 blocks, read from the node every 30 seconds); the last 5 events in words (a block found, the hourly program rebuilt, a miner restarted, an upload failure); and a footer. The launcher log keeps the full detail. Set PLAIN=1 at the top of the bat for the old scrolling output; the launcher uses it by itself when the window is not a real console (PowerShell ISE, redirected output). +Every hour the program changes (epoch of 3,600 blocks) and once a day the cache seed changes: the miner stops with code 42, the launcher re-exports the pack from the node, rebuilds the worker (about 30 s for CUDA, a few seconds for OpenCL) and restarts it; a worker that dies for any other reason is restarted after 10 s. A status line per miner goes to the launcher log every 30 s (the miner itself reports only after a job ends, so a slow GPU shows "warming up" until its first job is done; AMD_JOB_NONCES at the top of the bat keeps AMD jobs short). The launcher holds Windows awake while it runs (SetThreadExecutionState, no power plan change); for the night also set Sleep to Never in Settings > System > Power and check that no Windows Update restart is pending. Stop it in the morning with Ctrl+C in the window: the miners and workers are killed, a summary prints, the logs are uploaded one last time and the window stays open. The Mac side restarts with: cd ~/Projects/igneum/vendor/igneum-node && caffeinate -dims ./target/release/kaspad --devnet --nodnsseed --disable-upnp --enable-unsynced-mining --appdir=/tmp/igneum-devnet/node1 --rpclisten=0.0.0.0:26610 --listen=0.0.0.0:26611 --nologfiles >> /tmp/igneum-devnet/node1.log 2>&1 & diff --git a/proto-cuda/windows-miner/START-MINING.bat b/proto-cuda/windows-miner/START-MINING.bat index b7b8831dd..d4c334e16 100644 --- a/proto-cuda/windows-miner/START-MINING.bat +++ b/proto-cuda/windows-miner/START-MINING.bat @@ -2,7 +2,7 @@ rem Igneum devnet mining test for Windows. Double-click this file. rem It finds the GPUs in this PC, builds the matching GPU workers on first run (NVIDIA: CUDA, AMD: OpenCL), and runs rem one igneum-miner per worker against the Mac node. Logs land next to this file and are uploaded every 60 seconds. -rem Stop with Ctrl+C; the window stays open at the end. +rem The window shows a dashboard: hash rate, blocks found and one line per miner. Stop with Ctrl+C; the window stays open at the end. rem ---- settings: edit these lines only ---------------------------------------------------------- set "NODE_HOST=192.168.68.64" @@ -22,6 +22,14 @@ set "MINERS=8" rem Set to 0 to skip a vendor even if the hardware is present. set "USE_NVIDIA=1" set "USE_AMD=1" +rem Nonces per job (one job = one block template; a multiple of 32). Empty = the miner's default of 16,777,216, which an +rem RTX 5090 identity finishes in under a second. The integrated AMD GPU needs 100 s for that, so it mines stale templates +rem and reports late; 2,097,152 keeps its jobs near 10 s. +set "NVIDIA_JOB_NONCES=" +set "AMD_JOB_NONCES=2097152" +rem The window shows a dashboard (one card per GPU, redrawn in place). Set PLAIN=1 for the old scrolling log instead; +rem the launcher also falls back to it by itself when the window is not a real console. +set "PLAIN=0" rem Visual Studio: the MSVC toolset CUDA 12.8 accepts (14.30 = MSVC v143). Adjust the path if Visual Studio is elsewhere. set "VCVARS=C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvarsall.bat" set "VCVARS_VER=14.30" diff --git a/proto-cuda/windows-miner/start-mining.ps1 b/proto-cuda/windows-miner/start-mining.ps1 index 405b4f8d1..9b1b6d3fa 100644 --- a/proto-cuda/windows-miner/start-mining.ps1 +++ b/proto-cuda/windows-miner/start-mining.ps1 @@ -1,6 +1,6 @@ # Igneum devnet mining test, Windows launcher. Started by START-MINING.bat, which sets the settings as environment # variables (NODE_HOST, NODE_PORT, PAYOUT_ADDRESS, NVIDIA_DEVICE, CUDA_ARCH, AMD_VENDOR, AMD_DEVICE, USE_NVIDIA, USE_AMD, -# VCVARS, VCVARS_VER). 3 October 2026. +# NVIDIA_JOB_NONCES, AMD_JOB_NONCES, PLAIN, VCVARS, VCVARS_VER). 3 October 2026. # # What it does, in order: # 1. Lists the GPUs and the tools (nvcc, MSVC through vcvarsall, an OpenCL SDK) and prints which workers will start. @@ -11,9 +11,23 @@ # plus 1 GiB dataset of GPU memory per instance), its own deterministic vote key and payout address # (--), and its own random 64-bit nonce start per job. Logs: --.log # (no index when MINERS=1), uploaded under the label --. -# 5. Every 30 s prints a status line per worker; every 60 s uploads the logs with upload-log.bat (if present); -# restarts a miner that exits (code 42 = the epoch or day seed changed: re-export, rebuild, restart, with the -# rebuild time logged); Ctrl+C stops everything and prints a summary. +# 5. Shows a dashboard in the window, redrawn in place every 2 s: one card per GPU (hash rate in big digits, blocks +# found, one line per identity), a network line (from igneum-miner watch every 30 s), the last 5 events and a +# footer. The launcher log keeps the full detail (a status line per identity every 30 s). PLAIN=1 in the bat, or +# a window that is not a real console, gives the old scrolling output instead. +# Every 60 s the logs are uploaded with upload-log.bat (if present); a miner that exits is restarted (code 42 = +# the epoch or day seed changed: re-export, rebuild, restart, with the rebuild time logged; anything else: after +# 10 s); Ctrl+C stops everything and prints a summary. +# +# Miner log lines this script reads (vendor/igneum-node/igneum/miner/src/main.rs, mine_worker): +# . ACCEPTED block nonce=0x... (gpu worker, cpu re-check ok) +# . STATUS '