diff --git a/ethminer/main.cpp b/ethminer/main.cpp index f1aec3d5b..9d5981054 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -344,6 +344,9 @@ class MinerCLI app.add_option("--cuda-streams,--cu-streams", m_CUSettings.streams, "", true) ->check(CLI::Range(1, 99)); + app.add_option("--cuda-usleep,--cu-usleep", m_CUSettings.usleep, "", true) + ->check(CLI::Range(-1, 1000000)); + #endif #if ETH_ETHASHCPU diff --git a/libethash-cuda/CUDAMiner.cpp b/libethash-cuda/CUDAMiner.cpp index b47d689b4..07fbe569b 100644 --- a/libethash-cuda/CUDAMiner.cpp +++ b/libethash-cuda/CUDAMiner.cpp @@ -402,8 +402,13 @@ void CUDAMiner::search( // restart the stream on the next batch of nonces // unless we are done for this round. if (!done) + { + if (m_settings.usleep >= 0) { + usleep(m_settings.usleep); + } run_ethash_search( m_settings.gridSize, m_settings.blockSize, stream, &buffer, start_nonce); + } if (found_count) { diff --git a/libethcore/Miner.h b/libethcore/Miner.h index 2f3b98f21..4f5820dc7 100644 --- a/libethcore/Miner.h +++ b/libethcore/Miner.h @@ -101,6 +101,7 @@ struct CUSettings : public MinerSettings unsigned schedule = 4; unsigned gridSize = 8192; unsigned blockSize = 128; + int usleep = -1; }; // Holds settings for OpenCL Miner