From c66e8622b39846301643ac2e5dba4dd1a974438b Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 7 Feb 2017 06:25:29 +0100 Subject: [PATCH] api: report per thread cpu hash checks (ACC/REJ) + update all algos for that... --- Algo256/blake256.cu | 2 ++ Algo256/blake2s.cu | 6 ++++-- Algo256/bmw.cu | 2 ++ Algo256/decred.cu | 6 +++++- Algo256/keccak256.cu | 2 ++ Algo256/vanilla.cu | 4 +++- JHA/jackpotcoin.cu | 4 +++- api.cpp | 10 +++------- ccminer.cpp | 4 ++++ crypto/cryptolight.cu | 6 ++++-- crypto/cryptonight.cu | 6 +++++- crypto/wildkeccak.cu | 4 ++++ groestlcoin.cpp | 17 ++++++++++------- heavy/heavy.cu | 4 +++- lbry/lbry.cu | 2 ++ lyra2/lyra2RE.cu | 2 ++ lyra2/lyra2REv2.cu | 2 ++ miner.h | 7 ++++--- myriadgroestl.cpp | 4 +++- neoscrypt/neoscrypt.cpp | 2 ++ pentablake.cu | 2 ++ quark/nist5.cu | 2 ++ quark/quarkcoin.cu | 2 ++ qubit/deep.cu | 2 ++ qubit/luffa.cu | 2 ++ qubit/qubit.cu | 2 ++ sia/sia.cu | 4 ++++ skein.cu | 4 +++- skein2.cpp | 4 +++- util.cpp | 6 ++++++ x11/c11.cu | 2 ++ x11/fresh.cu | 2 ++ x11/s3.cu | 2 ++ x11/sib.cu | 1 + x11/veltor.cu | 1 + x11/x11.cu | 2 ++ x11/x11evo.cu | 2 ++ x13/x13.cu | 2 ++ x15/whirlpool.cu | 2 ++ x15/x14.cu | 2 ++ x15/x15.cu | 2 ++ x17/x17.cu | 2 ++ zr5.cu | 4 +++- 43 files changed, 122 insertions(+), 30 deletions(-) diff --git a/Algo256/blake256.cu b/Algo256/blake256.cu index 6458664..6a0a78e 100644 --- a/Algo256/blake256.cu +++ b/Algo256/blake256.cu @@ -561,6 +561,8 @@ extern "C" int scanhash_blake256(int thr_id, struct work* work, uint32_t max_non return work->valid_nonces; } else if (vhashcpu[6] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/Algo256/blake2s.cu b/Algo256/blake2s.cu index 41a2f06..3162f8e 100644 --- a/Algo256/blake2s.cu +++ b/Algo256/blake2s.cu @@ -529,8 +529,10 @@ extern "C" int scanhash_blake2s(int thr_id, struct work *work, uint32_t max_nonc } pdata[19] = max(work->nonces[0], work->nonces[1]); // next scan start return rc; - } else if (vhashcpu[7] > ptarget[7]) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", resNonces[0]); + } else if (vhashcpu[6] > ptarget[6]) { + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", resNonces[0]); } } diff --git a/Algo256/bmw.cu b/Algo256/bmw.cu index fd12f02..c2e4be6 100644 --- a/Algo256/bmw.cu +++ b/Algo256/bmw.cu @@ -100,6 +100,8 @@ extern "C" int scanhash_bmw(int thr_id, struct work* work, uint32_t max_nonce, u return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/Algo256/decred.cu b/Algo256/decred.cu index ff5bc36..e773b39 100644 --- a/Algo256/decred.cu +++ b/Algo256/decred.cu @@ -435,13 +435,17 @@ extern "C" int scanhash_decred(int thr_id, struct work* work, uint32_t max_nonce work->nonces[0], work->sharediff[0], n, work->nonces[1], work->sharediff[1]); } else if (vhash[6] > ptarget[6]) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result %u for %08x does not validate on CPU!", n, resNonces[n]); } } return work->valid_nonces; } else if (vhash[6] > ptarget[6]) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", resNonces[1]); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", resNonces[1]); } } *pnonce += throughput; diff --git a/Algo256/keccak256.cu b/Algo256/keccak256.cu index 1885d4e..0d5fc13 100644 --- a/Algo256/keccak256.cu +++ b/Algo256/keccak256.cu @@ -91,6 +91,8 @@ extern "C" int scanhash_keccak256(int thr_id, struct work* work, uint32_t max_no return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/Algo256/vanilla.cu b/Algo256/vanilla.cu index f3c4388..1928088 100644 --- a/Algo256/vanilla.cu +++ b/Algo256/vanilla.cu @@ -451,7 +451,9 @@ extern "C" int scanhash_vanilla(int thr_id, struct work* work, uint32_t max_nonc return work->valid_nonces; } else if (vhashcpu[6] > Htarg) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", h_resNonce[thr_id][0]); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", h_resNonce[thr_id][0]); pdata[19] = work->nonces[0] + 1; continue; } diff --git a/JHA/jackpotcoin.cu b/JHA/jackpotcoin.cu index a65fcc5..f13a7e8 100644 --- a/JHA/jackpotcoin.cu +++ b/JHA/jackpotcoin.cu @@ -245,7 +245,9 @@ extern "C" int scanhash_jackpot(int thr_id, struct work *work, uint32_t max_nonc return work->valid_nonces; } else if (vhash[7] > Htarg) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; } diff --git a/api.cpp b/api.cpp index 6a29c42..074f4db 100644 --- a/api.cpp +++ b/api.cpp @@ -129,11 +129,6 @@ static void gpustatus(int thr_id) cgpu->gpu_power = gpu_power(cgpu); // mWatts cgpu->gpu_plimit = gpu_plimit(cgpu); // mW or % #endif - - // todo: per gpu - cgpu->accepted = p->accepted_count; - cgpu->rejected = p->rejected_count; - cgpu->khashes = stats_get_speed(thr_id, 0.0) / 1000.0; if (cgpu->monitor.gpu_power) { cgpu->gpu_power = cgpu->monitor.gpu_power; @@ -148,13 +143,14 @@ static void gpustatus(int thr_id) "POWER=%u;FAN=%hu;RPM=%hu;" "FREQ=%u;MEMFREQ=%u;GPUF=%u;MEMF=%u;" "KHS=%.2f;KHW=%.5f;PLIM=%u;" - "HWF=%d;I=%.1f;THR=%u|", + "ACC=%u;REJ=%u;HWF=%u;I=%.1f;THR=%u|", gpuid, cgpu->gpu_bus, card, cgpu->gpu_temp, cgpu->gpu_power, cgpu->gpu_fan, cgpu->gpu_fan_rpm, cgpu->gpu_clock/1000, cgpu->gpu_memclock/1000, // base freqs in MHz cgpu->monitor.gpu_clock, cgpu->monitor.gpu_memclock, // current cgpu->khashes, khashes_per_watt, cgpu->gpu_plimit, - cgpu->hw_errors, cgpu->intensity, cgpu->throughput); + cgpu->accepted, (unsigned) cgpu->rejected, (unsigned) cgpu->hw_errors, + cgpu->intensity, cgpu->throughput); // append to buffer for multi gpus strcat(buffer, buf); diff --git a/ccminer.cpp b/ccminer.cpp index 0bbe003..776476a 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -2183,6 +2183,8 @@ static void *miner_thread(void *userdata) if (err != cudaSuccess && !opt_quiet) gpulog(LOG_WARNING, thr_id, "%s", cudaGetErrorString(err)); + work.valid_nonces = 0; + /* scan nonces for a proof-of-work hash */ switch (opt_algo) { @@ -2447,6 +2449,8 @@ static void *miner_thread(void *userdata) if (firstwork_time == 0) firstwork_time = time(NULL); + if (cgpu) cgpu->accepted += work.valid_nonces; + /* if nonce found, submit work */ if (rc > 0 && !opt_benchmark) { uint32_t curnonce = nonceptr[0]; // current scan position diff --git a/crypto/cryptolight.cu b/crypto/cryptolight.cu index 0b8deea..c8ab8ea 100644 --- a/crypto/cryptolight.cu +++ b/crypto/cryptolight.cu @@ -119,12 +119,14 @@ extern "C" int scanhash_cryptolight(int thr_id, struct work* work, uint32_t max_ res++; work->nonces[1] = resNonces[1]; } else if (vhash[7] > Htarg) { - gpulog(LOG_WARNING, thr_id, "result for second nonce %08x does not validate on CPU!", resNonces[1]); + gpu_increment_reject(thr_id); } } goto done; } else if (vhash[7] > Htarg) { - gpulog(LOG_WARNING, thr_id, "result for nonce %08x does not validate on CPU!", resNonces[0]); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for nonce %08x does not validate on CPU!", resNonces[0]); } } diff --git a/crypto/cryptonight.cu b/crypto/cryptonight.cu index 2e3141c..0214ce4 100644 --- a/crypto/cryptonight.cu +++ b/crypto/cryptonight.cu @@ -135,11 +135,15 @@ extern "C" int scanhash_cryptonight(int thr_id, struct work* work, uint32_t max_ if(vhash[7] <= Htarg && fulltest(vhash, ptarget)) { res++; work->nonces[1] = resNonces[1]; + } else { + gpu_increment_reject(thr_id); } } goto done; } else if (vhash[7] > Htarg) { - gpulog(LOG_WARNING, thr_id, "result for nonce %08x does not validate on CPU!", resNonces[0]); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for nonce %08x does not validate on CPU!", resNonces[0]); } } diff --git a/crypto/wildkeccak.cu b/crypto/wildkeccak.cu index a237715..b4ac04b 100644 --- a/crypto/wildkeccak.cu +++ b/crypto/wildkeccak.cu @@ -318,6 +318,10 @@ extern "C" int scanhash_wildkeccak(int thr_id, struct work* work, uint32_t max_n } work->valid_nonces = 1; return 1; + } else if (vhash[7] > ptarget[7]) { + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for nonce %08x does not validate on CPU!", h_retnonce[0]); } } diff --git a/groestlcoin.cpp b/groestlcoin.cpp index a1b5136..453bd4c 100644 --- a/groestlcoin.cpp +++ b/groestlcoin.cpp @@ -61,25 +61,28 @@ int scanhash_groestlcoin(int thr_id, struct work *work, uint32_t max_nonce, unsi groestlcoin_cpu_setBlock(thr_id, endiandata, (void*)ptarget); do { - uint32_t foundNounce = UINT32_MAX; + memset(work->nonces, 0xff, sizeof(work->nonces)); *hashes_done = pdata[19] - start_nonce + throughput; // GPU hash - groestlcoin_cpu_hash(thr_id, throughput, pdata[19], &foundNounce); + groestlcoin_cpu_hash(thr_id, throughput, pdata[19], &work->nonces[0]); - if (foundNounce < UINT32_MAX && bench_algo < 0) + if (work->nonces[0] < UINT32_MAX && bench_algo < 0) { uint32_t _ALIGN(64) vhash[8]; - endiandata[19] = swab32(foundNounce); + endiandata[19] = swab32(work->nonces[0]); groestlhash(vhash, endiandata); if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { + work->valid_nonces = 1; work_set_target_ratio(work, vhash); - pdata[19] = foundNounce; - return true; + pdata[19] = work->nonces[0] + 1; // cursor + return work->valid_nonces; } else if (vhash[7] > ptarget[7]) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", foundNounce); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); } } diff --git a/heavy/heavy.cu b/heavy/heavy.cu index b22401f..4e52fa4 100644 --- a/heavy/heavy.cu +++ b/heavy/heavy.cu @@ -296,7 +296,9 @@ int scanhash_heavy(int thr_id, struct work *work, uint32_t max_nonce, unsigned l pdata[19] += nonce - pdata[19]; heavycoin_hash((uchar*)vhash, (uchar*)pdata, blocklen); if (memcmp(vhash, foundhash, 32)) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", nonce); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", nonce); } else { work_set_target_ratio(work, vhash); rc = 1; diff --git a/lbry/lbry.cu b/lbry/lbry.cu index 0efd99e..38dd513 100644 --- a/lbry/lbry.cu +++ b/lbry/lbry.cu @@ -201,6 +201,8 @@ extern "C" int scanhash_lbry(int thr_id, struct work *work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", resNonces[0]); cudaMemset(d_resNonce[thr_id], 0xFF, 2 * sizeof(uint32_t)); } diff --git a/lyra2/lyra2RE.cu b/lyra2/lyra2RE.cu index e25aba4..ac7ed97 100644 --- a/lyra2/lyra2RE.cu +++ b/lyra2/lyra2RE.cu @@ -155,6 +155,8 @@ extern "C" int scanhash_lyra2(int thr_id, struct work* work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/lyra2/lyra2REv2.cu b/lyra2/lyra2REv2.cu index 15ca59d..6693221 100644 --- a/lyra2/lyra2REv2.cu +++ b/lyra2/lyra2REv2.cu @@ -162,6 +162,8 @@ extern "C" int scanhash_lyra2v2(int thr_id, struct work* work, uint32_t max_nonc return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/miner.h b/miner.h index a555175..a51e079 100644 --- a/miner.h +++ b/miner.h @@ -360,6 +360,7 @@ extern void free_scrypt_jane(int thr_id); /* api related */ void *api_thread(void *userdata); void api_set_throughput(int thr_id, uint32_t throughput); +void gpu_increment_reject(int thr_id); struct monitor_info { uint32_t gpu_temp; @@ -377,9 +378,9 @@ struct monitor_info { struct cgpu_info { uint8_t gpu_id; uint8_t thr_id; - int accepted; - int rejected; - int hw_errors; + uint16_t hw_errors; + unsigned accepted; + uint32_t rejected; double khashes; int has_monitoring; float gpu_temp; diff --git a/myriadgroestl.cpp b/myriadgroestl.cpp index 9e1803a..77ac593 100644 --- a/myriadgroestl.cpp +++ b/myriadgroestl.cpp @@ -94,7 +94,9 @@ int scanhash_myriad(int thr_id, struct work *work, uint32_t max_nonce, unsigned return work->valid_nonces; } else if (vhash[7] > ptarget[7]) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; } diff --git a/neoscrypt/neoscrypt.cpp b/neoscrypt/neoscrypt.cpp index 2a14117..22cfbd6 100644 --- a/neoscrypt/neoscrypt.cpp +++ b/neoscrypt/neoscrypt.cpp @@ -86,6 +86,8 @@ int scanhash_neoscrypt(int thr_id, struct work* work, uint32_t max_nonce, unsign return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "nonce %08x does not validate on CPU!", work->nonces[0]); } } diff --git a/pentablake.cu b/pentablake.cu index 37808d5..5c63d4a 100644 --- a/pentablake.cu +++ b/pentablake.cu @@ -123,6 +123,8 @@ extern "C" int scanhash_pentablake(int thr_id, struct work *work, uint32_t max_n return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/quark/nist5.cu b/quark/nist5.cu index 9ae26c9..25aff74 100644 --- a/quark/nist5.cu +++ b/quark/nist5.cu @@ -138,6 +138,8 @@ extern "C" int scanhash_nist5(int thr_id, struct work *work, uint32_t max_nonce, goto out; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/quark/quarkcoin.cu b/quark/quarkcoin.cu index 21fde2f..445b1cf 100644 --- a/quark/quarkcoin.cu +++ b/quark/quarkcoin.cu @@ -289,6 +289,8 @@ extern "C" int scanhash_quark(int thr_id, struct work* work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > ptarget[7]) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/qubit/deep.cu b/qubit/deep.cu index b400757..0de2a9c 100644 --- a/qubit/deep.cu +++ b/qubit/deep.cu @@ -120,6 +120,8 @@ extern "C" int scanhash_deep(int thr_id, struct work* work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/qubit/luffa.cu b/qubit/luffa.cu index a619c25..057dbad 100644 --- a/qubit/luffa.cu +++ b/qubit/luffa.cu @@ -96,6 +96,8 @@ extern "C" int scanhash_luffa(int thr_id, struct work* work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/qubit/qubit.cu b/qubit/qubit.cu index a0a5f03..9520ea3 100644 --- a/qubit/qubit.cu +++ b/qubit/qubit.cu @@ -136,6 +136,8 @@ extern "C" int scanhash_qubit(int thr_id, struct work* work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/sia/sia.cu b/sia/sia.cu index b233cc1..8e4f483 100644 --- a/sia/sia.cu +++ b/sia/sia.cu @@ -244,6 +244,8 @@ int scanhash_sia(int thr_id, struct work *work, uint32_t max_nonce, unsigned lon work->valid_nonces++; pdata[8] = work->nonces[0] + 1; } + } else { + gpu_increment_reject(thr_id); } if (work->nonces[1] != UINT32_MAX) { @@ -263,6 +265,8 @@ int scanhash_sia(int thr_id, struct work *work, uint32_t max_nonce, unsigned lon work->valid_nonces++; pdata[8] = work->nonces[1] + 1; } + } else { + gpu_increment_reject(thr_id); } } if (work->valid_nonces) { diff --git a/skein.cu b/skein.cu index 066540f..234f7a0 100644 --- a/skein.cu +++ b/skein.cu @@ -439,7 +439,9 @@ extern "C" int scanhash_skeincoin(int thr_id, struct work* work, uint32_t max_no return work->valid_nonces; } else if (vhash[7] > ptarget[7]) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; } diff --git a/skein2.cpp b/skein2.cpp index ba9bef4..2d57f2d 100644 --- a/skein2.cpp +++ b/skein2.cpp @@ -110,7 +110,9 @@ int scanhash_skein2(int thr_id, struct work* work, uint32_t max_nonce, unsigned return work->valid_nonces; } else if (vhash[7] > ptarget[7]) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; } diff --git a/util.cpp b/util.cpp index 88d6436..1ee3aa3 100644 --- a/util.cpp +++ b/util.cpp @@ -1628,6 +1628,12 @@ static bool stratum_get_algo(struct stratum_ctx *sctx, json_t *id, json_t *param extern char driver_version[32]; extern int cuda_arch[MAX_GPUS]; +void gpu_increment_reject(int thr_id) +{ + struct cgpu_info *gpu = &thr_info[thr_id].gpu; + if (gpu) gpu->rejected++; +} + static bool json_object_set_error(json_t *result, int code, const char *msg) { json_t *val = json_object(); diff --git a/x11/c11.cu b/x11/c11.cu index 72274a0..5dee174 100644 --- a/x11/c11.cu +++ b/x11/c11.cu @@ -204,6 +204,8 @@ extern "C" int scanhash_c11(int thr_id, struct work* work, uint32_t max_nonce, u return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/x11/fresh.cu b/x11/fresh.cu index d81d6e7..f67a54e 100644 --- a/x11/fresh.cu +++ b/x11/fresh.cu @@ -149,6 +149,8 @@ extern "C" int scanhash_fresh(int thr_id, struct work* work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); } } diff --git a/x11/s3.cu b/x11/s3.cu index cea6760..85eaaa6 100644 --- a/x11/s3.cu +++ b/x11/s3.cu @@ -142,6 +142,8 @@ extern "C" int scanhash_s3(int thr_id, struct work* work, uint32_t max_nonce, un return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/x11/sib.cu b/x11/sib.cu index 6ccddbb..158f85e 100644 --- a/x11/sib.cu +++ b/x11/sib.cu @@ -202,6 +202,7 @@ extern "C" int scanhash_sib(int thr_id, struct work* work, uint32_t max_nonce, u return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; diff --git a/x11/veltor.cu b/x11/veltor.cu index 43450bf..d422349 100644 --- a/x11/veltor.cu +++ b/x11/veltor.cu @@ -143,6 +143,7 @@ extern "C" int scanhash_veltor(int thr_id, struct work* work, uint32_t max_nonce return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", h_resNonce[0]); cudaMemset(d_resNonce[thr_id], 0xff, NBN*sizeof(uint32_t)); diff --git a/x11/x11.cu b/x11/x11.cu index 81eddc7..a7f1b60 100644 --- a/x11/x11.cu +++ b/x11/x11.cu @@ -192,6 +192,8 @@ extern "C" int scanhash_x11(int thr_id, struct work* work, uint32_t max_nonce, u } return work->valid_nonces; } else { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/x11/x11evo.cu b/x11/x11evo.cu index 1b16e58..53799f9 100644 --- a/x11/x11evo.cu +++ b/x11/x11evo.cu @@ -373,6 +373,8 @@ extern "C" int scanhash_x11evo(int thr_id, struct work* work, uint32_t max_nonce } return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/x13/x13.cu b/x13/x13.cu index 2fdf5f4..0f5d88c 100644 --- a/x13/x13.cu +++ b/x13/x13.cu @@ -208,6 +208,8 @@ extern "C" int scanhash_x13(int thr_id, struct work* work, uint32_t max_nonce, u return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/x15/whirlpool.cu b/x15/whirlpool.cu index f275299..9e9bda6 100644 --- a/x15/whirlpool.cu +++ b/x15/whirlpool.cu @@ -127,6 +127,8 @@ extern "C" int scanhash_whirl(int thr_id, struct work* work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/x15/x14.cu b/x15/x14.cu index 3a43429..4232c69 100644 --- a/x15/x14.cu +++ b/x15/x14.cu @@ -224,6 +224,8 @@ extern "C" int scanhash_x14(int thr_id, struct work* work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/x15/x15.cu b/x15/x15.cu index c5362ce..cdfbd81 100644 --- a/x15/x15.cu +++ b/x15/x15.cu @@ -230,6 +230,8 @@ extern "C" int scanhash_x15(int thr_id, struct work* work, uint32_t max_nonce, return work->valid_nonces; } else if (vhash[7] > Htarg) { + gpu_increment_reject(thr_id); + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[19] = work->nonces[0] + 1; continue; diff --git a/x17/x17.cu b/x17/x17.cu index 1dfc125..b329b65 100644 --- a/x17/x17.cu +++ b/x17/x17.cu @@ -255,11 +255,13 @@ extern "C" int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, u } else if (vhash[7] > Htarg) { // x11+ coins could do some random error, but not on retry + gpu_increment_reject(thr_id); if (!warn) { warn++; pdata[19] = work->nonces[0] + 1; continue; } else { + if (!opt_quiet) gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); warn = 0; } diff --git a/zr5.cu b/zr5.cu index cbca488..11140b0 100644 --- a/zr5.cu +++ b/zr5.cu @@ -468,7 +468,9 @@ extern "C" int scanhash_zr5(int thr_id, struct work *work, return work->valid_nonces; } else if (vhash[7] > ptarget[7]) { - gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); + gpu_increment_reject(thr_id); + if (!opt_quiet) + gpulog(LOG_WARNING, thr_id, "result for %08x does not validate on CPU!", work->nonces[0]); pdata[0] = oldp0; } } else