@ -325,6 +325,18 @@ public:
else if ( arg = = " --cuda-streams " & & i + 1 < argc )
m_numStreams = stol ( argv [ + + i ] ) ;
# endif
else if ( ( arg = = " -L " | | arg = = " --dag-load-mode " ) & & i + 1 < argc )
{
string mode = argv [ + + i ] ;
if ( mode = = " parallel " ) m_dagLoadMode = DAG_LOAD_MODE_PARALLEL ;
else if ( mode = = " sequential " ) m_dagLoadMode = DAG_LOAD_MODE_SEQUENTIAL ;
else
{
cerr < < " Bad " < < arg < < " option: " < < argv [ i ] < < endl ;
BOOST_THROW_EXCEPTION ( BadArgument ( ) ) ;
}
}
/*
else if ( arg = = " --phone-home " & & i + 1 < argc )
{
string m = argv [ + + i ] ;
@ -338,6 +350,7 @@ public:
BOOST_THROW_EXCEPTION ( BadArgument ( ) ) ;
}
}
*/
else if ( arg = = " --benchmark-warmup " & & i + 1 < argc )
try {
m_benchmarkWarmup = stol ( argv [ + + i ] ) ;
@ -378,6 +391,7 @@ public:
{
m_minerType = MinerType : : Mixed ;
}
/*
else if ( arg = = " --current-block " & & i + 1 < argc )
m_currentBlock = stol ( argv [ + + i ] ) ;
else if ( ( arg = = " -w " | | arg = = " --check-pow " ) & & i + 4 < argc )
@ -417,6 +431,7 @@ public:
BOOST_THROW_EXCEPTION ( BadArgument ( ) ) ;
}
}
*/
else if ( arg = = " -M " | | arg = = " --benchmark " )
{
mode = OperationMode : : Benchmark ;
@ -495,7 +510,10 @@ public:
}
if ( m_minerType = = MinerType : : CPU )
EthashCPUMiner : : setNumInstances ( m_miningThreads ) ;
{
cout < < " CPU mining is no longer supported in this miner. Use -G (opencl) or -U (cuda) flag to select GPU platform. " < < endl ;
exit ( 0 ) ;
}
else if ( m_minerType = = MinerType : : CL | | m_minerType = = MinerType : : Mixed )
{
# if ETH_ETHASHCL || !ETH_TRUE
@ -512,7 +530,8 @@ public:
m_openclDevice ,
m_clAllowCPU ,
m_extraGPUMemory ,
m_currentBlock
0 ,
m_dagLoadMode
) )
exit ( 1 ) ;
EthashGPUMiner : : setNumInstances ( m_miningThreads ) ;
@ -537,7 +556,8 @@ public:
m_numStreams ,
m_extraGPUMemory ,
m_cudaSchedule ,
m_currentBlock
0 ,
m_dagLoadMode
) )
exit ( 1 ) ;
# else
@ -545,9 +565,7 @@ public:
exit ( 1 ) ;
# endif
}
if ( mode = = OperationMode : : DAGInit )
doInitDAG ( m_initDAG ) ;
else if ( mode = = OperationMode : : Benchmark )
if ( mode = = OperationMode : : Benchmark )
doBenchmark ( m_minerType , m_phoneHome , m_benchmarkWarmup , m_benchmarkTrial , m_benchmarkTrials ) ;
else if ( mode = = OperationMode : : Farm )
doFarm ( m_minerType , m_activeFarmURL , m_farmRecheckPeriod ) ;
@ -574,14 +592,11 @@ public:
< < " -O, --userpass <username.workername:password> Stratum login credentials " < < endl
< < " -FO, --failover-userpass <username.workername:password> Failover stratum login credentials (optional, will use normal credentials when omitted) " < < endl
< < " --work-timeout <n> reconnect/failover after n seconds of working on the same (stratum) job. Defaults to 180. Don't set lower than max. avg. block time " < < endl
< < " -SV, --stratum-version <n> Stratum client version. Defaults to 1 (async client). Use 2 to test new synchronous client. "
< < " -SV, --stratum-version <n> Stratum client version. Defaults to 1 (async client). Use 2 to test new synchronous client. "
# endif
# if ETH_JSONRPC || ETH_STRATUM || !ETH_TRUE
< < " --farm-recheck <n> Leave n ms between checks for changed work (default: 500). When using stratum, use a high value (i.e. 2000) to get more stable hashrate output " < < endl
< < " --no-precompute Don't precompute the next epoch's DAG. " < < endl
# endif
< < " Ethash verify mode: " < < endl
< < " -w,--check-pow <headerHash> <seedHash> <difficulty> <nonce> Check PoW credentials for validity. " < < endl
< < endl
< < " Benchmarking mode: " < < endl
< < " -M [<n>],--benchmark [<n>] Benchmark for mining and exit; Optionally specify block number to benchmark against specific DAG. " < < endl
@ -590,20 +605,19 @@ public:
< < " --benchmark-trials <n> Set the duration of warmup for the benchmark tests (default: 5). " < < endl
< < " Simulation mode: " < < endl
< < " -Z [<n>],--simulation [<n>] Mining test mode. Used to validate kernel optimizations. Optionally specify block number. " < < endl
# if ETH_JSONRPC || !ETH_TRUE
< < " --phone-home <on/off> When benchmarking, publish results (default: off) " < < endl
# endif
< < " Mining configuration: " < < endl
< < " -C,--cpu When mining, use the CPU. " < < endl
< < " -G,--opencl When mining use the GPU via OpenCL. " < < endl
< < " -U,--cuda When mining use the GPU via CUDA. " < < endl
< < " -X,--cuda-opencl Use OpenCL + CUDA in a system with mixed AMD/Nvidia cards. May require setting --opencl-platform 1 " < < endl
< < " --opencl-platform <n> When mining using -G/--opencl use OpenCL platform n (default: 0). " < < endl
< < " --opencl-device <n> When mining using -G/--opencl use OpenCL device n (default: 0). " < < endl
< < " --opencl-devices <0 1 ..n> Select which OpenCL devices to mine on. Default is to use all " < < endl
< < " -t, --mining-threads <n> Limit number of CPU/GPU miners to n (default: use everything available on selected platform) " < < endl
< < " --allow-opencl-cpu Allows CPU to be considered as an OpenCL device if the OpenCL platform supports it. " < < endl
< < " --list-devices List the detected OpenCL/CUDA devices and exit. Should be combined with -G or -U flag " < < endl
< < " --current-block Let the miner know the current block number at configuration time. Will help determine DAG size and required GPU memory. " < < endl
< < " -L, --dag-load-mode <mode> DAG generation mode. " < < endl
< < " parallel - load DAG on all GPUs at the same time (default) " < < endl
< < " sequential - load DAG on GPUs one after another. Use this when the miner crashes during DAG generation " < < endl
# if ETH_ETHASHCL || !ETH_TRUE
< < " --cl-extragpu-mem Set the memory (in MB) you believe your GPU requires for stuff other than mining. default: 0 " < < endl
< < " --cl-local-work Set the OpenCL local work size. Default is " < < toString ( ethash_cl_miner : : c_defaultLocalWorkSize ) < < endl
@ -625,7 +639,6 @@ public:
}
MinerType minerType ( ) const { return m_minerType ; }
bool shouldPrecompute ( ) const { return m_precompute ; }
private :
void doInitDAG ( unsigned _n )
@ -979,7 +992,7 @@ private:
// this is very ugly, but if Stratum Client V2 tunrs out to be a success, V1 will be completely removed anyway
if ( m_stratumClientVersion = = 1 ) {
EthStratumClient client ( & f , m_minerType , m_farmURL , m_port , m_user , m_pass , m_maxFarmRetries , m_worktimeout , m_precompute ) ;
EthStratumClient client ( & f , m_minerType , m_farmURL , m_port , m_user , m_pass , m_maxFarmRetries , m_worktimeout ) ;
if ( m_farmFailOverURL ! = " " )
{
if ( m_fuser ! = " " )
@ -1054,7 +1067,6 @@ private:
/// Operating mode.
OperationMode mode ;
DAGEraseMode m_eraseMode = DAGEraseMode : : None ;
/// Mining options
bool m_running = true ;
@ -1080,14 +1092,9 @@ private:
unsigned m_numStreams = ethash_cuda_miner : : c_defaultNumStreams ;
unsigned m_cudaSchedule = 4 ; // sync
# endif
uint64_t m_currentBlock = 0 ;
static char s_dagDir [ 256 ] ;
// default value was 350MB of GPU memory for other stuff (windows system rendering, e.t.c.)
unsigned m_extraGPUMemory = 0 ; // 350000000; don't assume miners run desktops...
/// DAG initialisation param.
unsigned m_initDAG = 0 ;
unsigned m_dagLoadMode = 0 ; // parallel
/// Benchmarking params
bool m_phoneHome = false ;
unsigned m_benchmarkWarmup = 15 ;
@ -1106,7 +1113,6 @@ private:
unsigned m_defaultStratumFarmRecheckPeriod = 2000 ;
bool m_farmRecheckSet = false ;
int m_worktimeout = 180 ;
bool m_precompute = true ;
# if ETH_STRATUM || !ETH_TRUE
int m_stratumClientVersion = 1 ;
@ -1118,5 +1124,3 @@ private:
# endif
string m_fport = " " ;
} ;
char MinerCLI : : s_dagDir [ 256 ] = " " ;