Commit Graph
73 Commits
Author SHA1 Message Date
rob thijssen b4e9bf0c42 Add FoundOrigin enum to track candidate source in engine results 2025-09-16 23:09:25 +08:00
rob thijssen a0a7712493 Add found-origin metrics and logging for CUDA engine candidates
- Track candidate origin (cpu, gpu-g1, gpu-g2) in metrics with counters
and gauges - Log detailed info on candidate discovery per origin in CUDA
engine - Emit per-job found-origin gauge in miner-service with actual
job_id - Cleanup origin metrics on
2025-09-16 22:49:47 +08:00
rob thijssen a824148b68 Lower CUDA log level from debug to trace for finer-grained output 2025-09-16 21:47:44 +08:00
rob thijssen cdf197cd15 Add extensive debug and info logging to CUDA engine initialization and
kernel launches

Include detailed logs for device info, context creation, buffer
allocations, kernel resolution and launch parameters, and data transfers
to help diagnose CUDA behavior and failures. Also add fallback and error
logging enhancements.
2025-09-16 21:02:32 +08:00
rob thijssen b108ccefbe simplify sha3 digest handling in qpow kernel
add optional cuda sampler parity logging for debugging false positives
2025-09-15 08:44:34 +08:00
rob thijssen 2480d7828b Cache CUDA context and module in CudaEngine for reuse
Initialize CUDA context and load module once per engine instance,
storing them in a mutex-protected cache to avoid repeated setups. Use
cached context/module for kernel launches, creating a fresh stream each
call. Adjust grid dimension calculation to consider multiprocessor
count.
2025-09-14 18:49:19 +03:00
rob thijssen 2596e62003 Limit counted CUDA attempts to covered nonces for accuracy 2025-09-14 16:03:34 +03:00
rob thijssen 0d81f3a346 Autotune CUDA desired_iters and improve logging
Add dynamic tuning of desired_iters based on coverage and thread count.
Enhance info logs with attempts and utilization metrics. Update example
config.
2025-09-14 15:43:36 +03:00
rob thijssen f37e70e1b1 Fix nonce advancement logic and update CUDA miner env settings 2025-09-14 15:31:46 +03:00
rob thijssen 737de2113a Add debug option to force GPU winner for early exit
Introduce C_DEBUG_FORCE_WIN device constant to force a winner on GPU at
tid=0,j=0. Enable control via MINER_CUDA_FORCE_WIN environment variable
in Rust to trigger early exit and aid debugging.
2025-09-14 15:06:22 +03:00
rob thijssen 456742e425 fix kernel indexing and use correct digest bytes in qpow CUDA kernel
enable sampler in miner config and increase verify iterations to 2048
2025-09-14 14:47:44 +03:00
rob thijssen c3fa990402 optional host-side verification for CUDA G2 batches
support for verifying first W candidates on the host when
MINER_CUDA_VERIFY is set, logging any missed winners.

add a metric for missed winners and info logging for found flags.
2025-09-14 14:29:28 +03:00
rob thijssen 531eb7df99 refine mining metrics to reduce redundancy and improve cleanup
remove redundant estimated rate gauges and ensure all related job and
thread metrics are cleaned up on job cancellation and completion.

update GPU CUDA metrics to use backend-specific estimated rate.
2025-09-14 13:08:42 +03:00
rob thijssen ca9f97a265 adjust active thread count based on desired iterations in CUDA kernel
launch
2025-09-14 12:18:43 +03:00
rob thijssen d2842cf7ed refactor CUDA G2 batching to allocate inputs and outputs per batch 2025-09-14 11:58:40 +03:00
rob thijssen 8399bd6f7d early-exit detection and per-batch base nonce logic to CUDA miner
early-exit checks for found solutions within each batch by copying and
validating device results. Rebuild per-batch base nonces and initial
states for kernel launches using effective iters instead of
iters_per_thread. Log false positives with debug info for easier
diagnosis.
2025-09-14 11:22:44 +03:00
rob thijssen e57e91bec9 Refactor CUDA engine bounds calculation for clarity 2025-09-14 10:38:53 +03:00
rob thijssen 8288d21423 CUDA kernel batching and estimated attempt rate metrics
Support multiple batches per launch controlled by MINER_CUDA_BATCHES.
Report estimated device attempt rate (nonces/sec) to metrics per batch.
2025-09-14 10:35:51 +03:00
rob thijssen b58e54eacd Fix nonce coverage calculation to use actual covered count 2025-09-14 10:11:52 +03:00
rob thijssen 4c5fe8b36d Adjust CUDA iterations per thread based on remaining nonce range
Calculate effective iterations to avoid exceeding coverage and update
all relevant uses from configured iterations to this dynamic value.
2025-09-14 09:57:44 +03:00
rob thijssen 928f2fe4c2 Add detailed debug logs for CUDA G1 and G2 coverage prefixes 2025-09-14 09:42:15 +03:00
rob thijssen b0eedef3e5 Improve full-precision bound checks for CUDA G2 coverage and hashing 2025-09-14 09:11:55 +03:00
rob thijssen 05bb5d885f Increase CUDA kernel ABI version and add coverage bounds check
Limit per-thread iterations to prevent hashing beyond assigned coverage
range in the kernel and update kernel launch parameters accordingly.
2025-09-14 08:28:10 +03:00
rob thijssen 2a2bc1f60b debug and warn logs for CUDA G2 winner diagnostics
Update cuda-miner-3060-debug.env with optimized thread and iteration
settings
2025-09-14 05:46:26 +03:00
rob thijssen 060a851300 Bump CUDA ABI version to 2 and use sentinel values for winners
Use u32::MAX as invalid sentinel for winner coordinates to improve
result validation. Also update ABI version constant to reflect this
change.
2025-09-13 13:17:48 +03:00
rob thijssen 25fdbf6ed2 Add kernel ABI version constant and probe in CUDA engine
Probe device kernel ABI version if present for better compatibility and
add logging for fallback when winner coordinates readback fails.
2025-09-13 13:01:30 +03:00
rob thijssen fa9b90ef28 report winner thread and iteration via output buffers for nonce
reconstruction
2025-09-13 12:44:27 +03:00
rob thijssen 9739f7c08a record winner thread and iteration on device for accurate nonce
reconstruction
2025-09-13 12:33:49 +03:00
rob thijssen fbd143f1cc Fix nonce calculation by tracking per-thread base nonces 2025-09-13 12:17:15 +03:00
rob thijssen d8c96df8ba Add alternative nonce mappings to diagnose CUDA false positives 2025-09-13 12:02:40 +03:00
rob thijssen 8dada4cb61 Add additional host distance check for false positive logs 2025-09-13 11:45:24 +03:00
rob thijssen 24ba4b0aa4 Fix qpow kernel to use h_le instead of digest_be in XOR and assignments 2025-09-13 11:31:23 +03:00
rob thijssen fd048d4923 Fix big-endian byte order handling in qpow kernel 2025-09-13 11:19:20 +03:00
rob thijssen 17eb8e473c Fix byte order in qpow kernel to use big-endian reversal 2025-09-13 11:04:29 +03:00
rob thijssen 39d68b989c Fix digest big-endian conversion to preserve lane order 2025-09-13 10:54:00 +03:00
rob thijssen ff477754d2 Use big-endian bytes consistently in qpow kernelSHA3 digest and
comparisons
2025-09-13 10:36:23 +03:00
rob thijssen 860503792c Adjust qpow kernel to use lane-LE byte order for target and threshold
Convert constants and inputs from big-endian to lane-LE byte order to
match SHA3 output layout, enabling correct XOR and comparison operations
with SHA3 digests stored in lane-LE format.
2025-09-13 10:26:34 +03:00
rob thijssen 03d3225478 Clarify sha3_512_64bytes_le input interpretation 2025-09-13 10:15:38 +03:00
rob thijssen 57483a0050 Refactor GPU kernel for G2 SHA3-512 with threshold check
- Clean up and unify endian conversion and load/store helpers -
Implement device-side SHA3-512 with correct lane ordering - Add bytewise
big-endian XOR distance calculation and comparison - Optimize early-exit
with atomic flag and optional debug outputs - Remove duplicate/unused
code and improve readability
2025-09-13 09:57:45 +03:00
rob thijssen b72be05386 Fix Keccak state indexing in keccak_f1600 kernel for CUDA 2025-09-13 09:19:02 +03:00
rob thijssen 7a3c40d8e8 Unroll Keccak-f1600 rounds for better performance 2025-09-13 09:06:33 +03:00
rob thijssen 642b596fad rewrite distance and comparison logic to use big-endian byte arrays
instead of uint64 limbs
2025-09-13 08:51:47 +03:00
rob thijssen 6048d08664 optimize big-endian distance calculation in qpow kernel 2025-09-13 08:38:45 +03:00
rob thijssen f62eff6be1 use little-endian output and byte-wise XOR in qpow kernel 2025-09-13 08:20:09 +03:00
rob thijssen 734b4fbb74 richer diagnostics for cuda false positive logging 2025-09-13 07:56:47 +03:00
rob thijssen 5fe204349f Add debug output buffers to CUDA G2 kernel and log on false positive
rejection
2025-09-13 07:43:18 +03:00
rob thijssen 16057a8e20 Add optional CUDA sampler readback and parity check
Enable sampler debugging via MINER_CUDA_SAMPLER env var to verify
host/device parity of sampler outputs, logging warnings on mismatch

Add example env file for RTX 3060 debug configuration
2025-09-13 06:24:28 +03:00
rob thijssen 8db0496b88 sampling logic for debugging decisions 2025-09-13 04:52:01 +03:00
rob thijssen 0aaacdf85d Add optional CUDA sampler support and big-endian SHA3 output
- Introduce constant memory variables and device buffers for sampler -
Initialize sampler in CudaEngine when MINER_CUDA_SAMPLER=1 - Change SHA3
kernel to output digest bytes in big-endian format - Add sample mismatch
metric counter
2025-09-13 04:02:06 +03:00
rob thijssen 191cc799b7 fix: cuda metrics and initialize estimated rate gauge 2025-09-13 02:42:48 +03:00