From 07bf22c881ffc42e40d4e563c939e6b59745e72e Mon Sep 17 00:00:00 2001 From: Yeastplume Date: Fri, 29 Sep 2017 17:58:43 +0100 Subject: [PATCH] cuckoo miner update (#145) * update cuckoo-miner tag * not mining by default * update to mean parameter * update to mining param * final update to compatible mean miner --- grin.toml | 18 ++++++++++++------ grin/src/miner.rs | 3 +++ pow/Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/grin.toml b/grin.toml index da0b8a87d..9f37578f8 100644 --- a/grin.toml +++ b/grin.toml @@ -54,7 +54,7 @@ port = 13414 #flag whether mining is enabled -enable_mining = true +enable_mining = false #Whether to use cuckoo-miner, and related parameters @@ -62,9 +62,7 @@ use_cuckoo_miner = true #Whether to use async mode for cuckoo miner, if the plugin supports it. #this allows for many searches to be run in parallel, e.g. if the system -#has multiple GPUs. This creates overhead, especially on faster test miners, -#so in a post-release world this should only be used if you really want -#to run cards in parallel +#has multiple GPUs, or if you want to mine using multiple plugins cuckoo_miner_async_mode = false @@ -108,10 +106,18 @@ burn_reward = true # single GPU and single CPU plugin in parallel #The fastest cpu algorithm, but consumes the most memory +#Also requires instructions that aren't available on +#older processors. In this case, use mean_compat_cpu +#instead +#[[mining.cuckoo_miner_plugin_config]] +#type_filter = "mean_cpu" +#parameter_list = {NUM_THREADS=4, NUM_TRIMS=68} +#Same as above, but for older processors. Will be slightly +#slower. [[mining.cuckoo_miner_plugin_config]] -type_filter = "mean_cpu" -parameter_list = {NUM_THREADS=4, NUM_TRIMS=64} +type_filter = "mean_compat_cpu" +parameter_list = {NUM_THREADS=4, NUM_TRIMS=68} #note lean_cpu currently has a bug which prevents it from #working with threads > 1 diff --git a/grin/src/miner.rs b/grin/src/miner.rs index f38b28336..595e8be00 100644 --- a/grin/src/miner.rs +++ b/grin/src/miner.rs @@ -231,6 +231,9 @@ impl Miner { next_stat_output = time::get_time().sec + stat_output_interval; } } + //avoid busy wait + let sleep_dur = std::time::Duration::from_millis(100); + thread::sleep(sleep_dur); } if sol == None { debug!( diff --git a/pow/Cargo.toml b/pow/Cargo.toml index 8e1b37e88..d48628a23 100644 --- a/pow/Cargo.toml +++ b/pow/Cargo.toml @@ -18,7 +18,7 @@ grin_core = { path = "../core" } [dependencies.cuckoo_miner] git = "https://github.com/mimblewimble/cuckoo-miner" -tag="grin_integration_9" +tag="grin_integration_12" #path = "../../cuckoo-miner" #uncomment this feature to turn off plugin builds #features=["no-plugin-build"]