Skip to content
Snippets Groups Projects
Unverified Commit 4b20d0b7 authored by fireice-uk's avatar fireice-uk Committed by GitHub
Browse files

Merge pull request #2213 from psychocrypt/topic-disableCPUMiningAutoConfigForCNGPU

cn_gpu: disable auto suggestion for CPU
parents 2a5e6dd6 74d69508
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,14 @@ public:
std::string conf;
// if cryptonight_gpu is used we will disable cpu mining but provide a inactive config
bool useCryptonight_gpu = ::jconf::inst()->GetCurrentCoinSelection().GetDescription(1).GetMiningAlgo() == cryptonight_gpu;
if(useCryptonight_gpu)
{
printer::inst()->print_msg(L0, "WARNING: CPU mining will be disabled because cryptonight_gpu is not suitable for CPU mining. You can uncomment the auto generated config in %s to enable CPU mining.", params::inst().configFileCPU.c_str());
conf += "/*\n//CPU config is disabled by default because cryptonight_gpu is not suitable for CPU mining.\n";
}
if(!detectL3Size() || L3KB_size < halfHashMemSizeKB || L3KB_size > (halfHashMemSizeKB * 2048u))
{
if(L3KB_size < halfHashMemSizeKB || L3KB_size > (halfHashMemSizeKB * 2048))
......@@ -100,6 +107,9 @@ public:
}
}
if(useCryptonight_gpu)
conf += "*/\n";
configTpl.replace("CPUCONFIG",conf);
configTpl.write(params::inst().configFileCPU);
printer::inst()->print_msg(L0, "CPU configuration stored in file '%s'", params::inst().configFileCPU.c_str());
......
......@@ -53,6 +53,15 @@ public:
;
configTpl.set( std::string(tpl) );
// if cryptonight_gpu is used we will disable cpu mining but provide a inactive config
bool useCryptonight_gpu = ::jconf::inst()->GetCurrentCoinSelection().GetDescription(1).GetMiningAlgo() == cryptonight_gpu;
if(useCryptonight_gpu)
{
printer::inst()->print_msg(L0, "WARNING: CPU mining will be disabled because cryptonight_gpu is not suitable for CPU mining. You can uncomment the auto generated config in %s to enable CPU mining.", params::inst().configFileCPU.c_str());
conf += "/*\n//CPU config is disabled by default because cryptonight_gpu is not suitable for CPU mining.\n";
}
try
{
std::vector<hwloc_obj_t> tlcs;
......@@ -85,6 +94,9 @@ public:
printer::inst()->print_msg(L0, "Autoconf FAILED: %s. Create config for a single thread.", err.what());
}
if(useCryptonight_gpu)
conf += "*/\n";
configTpl.replace("CPUCONFIG",conf);
configTpl.write(params::inst().configFileCPU);
printer::inst()->print_msg(L0, "CPU configuration stored in file '%s'", params::inst().configFileCPU.c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment