Commit Graph
89 Commits
Author SHA1 Message Date
illuzen a47db3d1a2 Fix windows again (#72)
* handle lost device correctly

* Update lib.rs

* allow-integrated flag otherwise exclude

* DeviceLost is a status

* Integrated GPU skipped when discrete init fails

* nits
2026-06-30 16:30:11 +08:00
Nikolaus Hegerandilluzen d99be29a64 Select GPU adapters by backend to fix multi-backend OOM (#67)
On Windows wgpu enumerates each physical GPU once per backend (Vulkan +
DX12) plus a CPU-emulated fallback ("Microsoft Basic Render Driver").
Building a mining context for every entry causes VRAM contention and
OOMs the process during benchmark/serve startup (#61).

Instead of deduplicating by (vendor, device) PCI IDs - which would
collapse rigs with multiple identical cards into a single context - drop
CPU-emulated adapters and keep all adapters from the highest-ranked
backend present (Vulkan/Metal, then DX12). Within a single backend each
physical GPU appears exactly once, so identical cards are preserved by
construction and no physical-ID matching is needed.

Selected adapters are ordered discrete-first so `--gpu-devices 1` picks
the discrete card on hybrid laptops. Skipped adapters are logged at info
level; if nothing usable remains, init fails with an explicit error.

Selection logic is a pure index-based function unit-tested against the
exact enumeration reported in #61, identical multi-GPU rigs, DX12-only
machines, and software-only environments.

Co-authored-by: illuzen <illuzen@users.noreply.github.com>
2026-06-30 13:13:45 +08:00
illuzen 7296c003bb Improve Windows gpu support (#70)
* support AMD GPUs on windows

* add support for more GPUs

* remove shader dump from logs

* handle gpu initialization failure better

* fmt

* re-order matching to avoid mobile / desktop false positives

* harden gpu matching

* add tests to engine-gpu module

* handle dead device and failed mapping correctly

* handle timeout properly with tokio

* nits

* fix benchmarks

* fmt
2026-06-30 12:55:35 +08:00
illuzen 157aa6fb5c Address v12 issues (#65)
* don't accept zero difficulty jobs

* bound job queue

* synchronous emit_payload

* cleaner gpu_batch_size type

* remove build script

* distance_threshold -> difficulty

* enable pq-cert checking with miner

* clearer logs

* Revert "enable pq-cert checking with miner"

This reverts commit 7a7f5394352b60d8c946f547f77a057504b29c44.

* update versions of relevant deps, including rand
2026-06-12 10:48:01 +08:00
illuzen 5ce62b3e12 add gpu-throttle arg (#64)
* add gpu-throttle arg

* smarter sleep logic

* document cli args
2026-05-22 23:31:54 +08:00
illuzen d7bf27854f GPU fixes (#58)
* improve logging

* don't let the queue spill, just drain it

* move cancellation out of the shader, since it doesn't work

* simplify batch size mechanism, improve logs

* fmt

* address review items
2026-04-22 13:42:01 +08:00
illuzenandNikolaus Heger 417a3efd86 Single hash, new poseidon (#50)
* single hash, new poseidon

* fix build

* new poseidon api

* fmt

* fix race condition with stale jobs being reported

* fmt

* fix deps

* format toml

remove stale comments

---------

Co-authored-by: Nikolaus Heger <nheger@gmail.com>
2026-04-02 14:06:54 +08:00
illuzen 443f0f9f89 QUIC miner (#49)
* implement quic

* simpler names

* simplify worker logic

* simplify gpu configuration logic

* miner initiates and picks random start nonce

* remove mining service

* clean up logs and remove unused engines

* clean up metrics

* metrics fix

* shared worker pool, cpu driven cancellation

just 10x the gpu thru-put, no more batch-size on gpu

* fmt

* non-local git

* taplo derp

* fix the benches

* handle stale results correctly in gpu

* more accurate gpu hashrate

* fmt

* remove unused

* handle duplicate solutions, cli controls gpu cancel frequency

* put plonky2 back

* demote noisy log
2026-02-02 16:38:21 +08:00
Nikolaus Heger ad46f200c0 fmt 2026-01-05 17:47:47 +08:00
Nikolaus Heger d14ebdf65c fix tests 2026-01-05 17:47:38 +08:00
Nikolaus Heger af5564796b dynamic batch size for GPU 2026-01-05 17:15:10 +08:00
Nikolaus Heger ffc5b8f83c GPU batch size automatically adjusts to target duration 2026-01-05 15:53:14 +08:00
Nikolaus Heger 3b5f759fbd refactored and unified gpu devices number logic
use all GPUs by default, handle the parameter, disallow more GPU devices than available
2025-12-27 11:40:03 +08:00
Nikolaus Heger a548f74f7d fmt 2025-12-26 12:47:42 +08:00
Nikolaus Heger 97ec1350de Fix for #39
Fix GPU worker crash, enable GPU default, and improve benchmark output
2025-12-26 12:46:57 +08:00
Nikolaus Heger ac87758996 Fix GPU contention, benchmarking 2025-12-26 10:53:00 +08:00
Nikolaus Heger 6ae4658209 add benchmark command
so we can easily compare CPU and GPU without having to run cargo bench.
2025-12-19 15:22:24 +08:00
Nikolaus Heger f7209be81b fixed some logs 2025-12-19 14:42:02 +08:00
illuzen b4999ab448 unused 2025-12-13 17:45:05 +08:00
illuzen 1eaea91909 clippy 2025-12-13 17:42:43 +08:00
illuzen 52318aeaad support multiple gpus 2025-12-13 17:38:24 +08:00
illuzen 22fecf183e clippy 2025-12-13 17:07:24 +08:00
illuzen 0978d3bebd fmt 2025-12-13 16:21:28 +08:00
illuzen 8e073c110a almost par with cpu now 2025-12-11 15:55:50 +08:00
illuzen c13b0027f3 optimized mds 2025-12-11 14:55:14 +08:00
illuzen 3cb91c4798 simplify 2025-12-11 14:42:13 +08:00
illuzen 43e857dfba simplify 2025-12-11 04:01:31 +08:00
illuzen 83e0c9edce a bit faster 2025-12-11 00:39:23 +08:00
illuzen 1509e2283b clean up documentation 2025-12-09 23:07:57 +08:00
illuzen d423b5c1b1 faster 2025-12-09 22:40:41 +08:00
illuzen 6c7835f348 faster 2025-12-09 22:36:56 +08:00
illuzen 46202989df faster 2025-12-09 22:31:10 +08:00
illuzen 09b63783e0 more benching 2025-12-09 20:49:48 +08:00
illuzen e8e0d6acf4 dynamic thread allocation and work coarsening 2025-12-09 20:31:17 +08:00
illuzen 14022a367f a bit faster 2025-12-09 17:59:42 +08:00
illuzen 587303b480 slight simplification 2025-12-09 17:33:20 +08:00
illuzen 9c88ac7aff a bit simpler 2025-12-09 17:14:25 +08:00
illuzen ffe58596d4 further simplification 2025-12-09 16:58:52 +08:00
illuzen 0ab3049703 simplified gpu code 2025-12-09 15:53:19 +08:00
illuzen 30c3b3f1a7 fix benches 2025-12-08 15:46:15 +08:00
illuzen ccca629c49 improved logging 2025-12-08 14:55:47 +08:00
illuzen 5705d7fb1a a bit faster now 2025-12-03 18:30:41 +08:00
illuzen 9bb8c3cb3c fix benches 2025-12-03 18:15:41 +08:00
illuzen 44e62ce2f4 tests pass and it mines now 2025-12-03 17:48:52 +08:00
illuzen ded099d8bd double hash matches 2025-12-03 17:28:49 +08:00
illuzen 0ebb6c4058 double hash failures 2025-12-03 17:15:11 +08:00
illuzen d8ab215b94 fix verify_nonce 2025-12-03 15:53:03 +08:00
illuzen 0850cb9c92 send target to gpu not difficulty 2025-12-03 15:26:41 +08:00
illuzen 0bbeee332d lock workers to gpu 2025-12-03 14:32:44 +08:00
illuzen 57814d50df better logging 2025-12-03 11:45:34 +08:00