Skip to content

Commit

Permalink
Add cuckarood cpu mean miners (#223)
Browse files Browse the repository at this point in the history
* update cuckoo submodule to latest

* add cuckarood cpu mean miner
  • Loading branch information
tromp authored and yeastplume committed Jul 27, 2019
1 parent 9101e58 commit d28bd91
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ time = "0.1"
grin_miner_util = { path = "./util", version = "2.0.0" }
grin_miner_plugin = { path = "./plugin", version = "2.0.0" }
grin_miner_config = { path = "./config", version = "2.0.0" }
#cuckoo_miner = { path = "./cuckoo-miner", version = "1.0.2" }
cuckoo_miner = { path = "./cuckoo-miner", version = "2.0.0" }
#use this alternative inclusion below to build cuda plugins
cuckoo_miner = { path = "./cuckoo-miner", version = "2.0.0", features = ["build-cuda-plugins"]}
#cuckoo_miner = { path = "./cuckoo-miner", version = "2.0.0", features = ["build-cuda-plugins"]}
ocl_cuckatoo = { path = "./ocl_cuckatoo", version = "1.0.2", optional = true}
ocl_cuckaroo = { path = "./ocl_cuckaroo", version = "1.0.2", optional = true}

Expand Down
14 changes: 6 additions & 8 deletions cuckoo-miner/src/cuckoo_sys/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ set (GCC_FLAGS "-m64 -std=gnu11 ${CFLAGS}")
set (CUDA_HOST_COMPILER_OVERRIDE $ENV{CUDA_HOST_COMPILER})
set (SKIP_CUCKATOO_GPU $ENV{SKIP_CUCKATOO_GPU})
set (SKIP_CUCKAROO_GPU $ENV{SKIP_CUCKAROO_GPU})
set (SKIP_CUCKAROOD_CPU "1")
set (SKIP_CUCKAROOD_GPU $ENV{SKIP_CUCKAROOD_GPU})

#blake2b prerequisite
Expand Down Expand Up @@ -144,23 +143,22 @@ endif()
### AR CPU BUILDING #########################################

set (AR2_CPU_SRC
cuckoo/src/cuckarood/cuckaroo.hpp
cuckoo/src/cuckarood/cuckarood.hpp
cuckoo/src/cuckarood/bitmap.hpp
cuckoo/src/cuckarood/graph.hpp
cuckoo/src/threads/barrier.hpp
cuckoo/src/crypto/siphash.hpp
cuckoo/src/crypto/siphashxN.h
cuckoo/src/cuckarood/mean.hpp
cuckoo/src/cuckarood/mean.cpp
${BLAKE_2B})

### AR CPU TARGETS #########################################

if (NOT SKIP_CUCKAROOD_CPU)
build_cpu_target("${AR2_CPU_SRC}" cuckarood_cpu_compat_19 "-DXBITS=2 -DNSIPHASH=1 -DEDGEBITS=19 -DSAVEEDGES")
build_cpu_target("${AR2_CPU_SRC}" cuckarood_cpu_avx2_19 "-mavx2 -DXBITS=2 -DNSIPHASH=8 -DEDGEBITS=19 -DSAVEEDGES")
build_cpu_target("${AR2_CPU_SRC}" cuckarood_cpu_compat_29 "-mno-avx2 -DNSIPHASH=4 -DEDGEBITS=29 -DSAVEEDGES")
build_cpu_target("${AR2_CPU_SRC}" cuckarood_cpu_avx2_29 "-mavx2 -DNSIPHASH=8 -DEDGEBITS=29 -DSAVEEDGES")
endif()
build_cpu_target("${AR2_CPU_SRC}" cuckarood_cpu_compat_19 "-DXBITS=2 -DNSIPHASH=1 -DEDGEBITS=19 -DSAVEEDGES")
build_cpu_target("${AR2_CPU_SRC}" cuckarood_cpu_avx2_19 "-mavx2 -DXBITS=2 -DNSIPHASH=8 -DEDGEBITS=19 -DSAVEEDGES")
build_cpu_target("${AR2_CPU_SRC}" cuckarood_cpu_compat_29 "-mno-avx2 -DNSIPHASH=4 -DEDGEBITS=29 -DSAVEEDGES")
build_cpu_target("${AR2_CPU_SRC}" cuckarood_cpu_avx2_29 "-mavx2 -DNSIPHASH=8 -DEDGEBITS=29 -DSAVEEDGES")

### AR CUDA TARGETS #########################################

Expand Down
17 changes: 17 additions & 0 deletions cuckoo-miner/tests/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ fn mine_cuckaroo_mean_cpu_compat_29() {
mine_async_for_duration(&vec![config], 20);
}

#[test]
fn mine_cuckarood_mean_cpu_compat_29() {
let mut config =
PluginConfig::new(mining_plugin_dir_for_tests(), "cuckarood_cpu_compat_29").unwrap();
config.params.nthreads = 4;
mine_async_for_duration(&vec![config], 20);
}

#[cfg(feature = "test-avx2")]
#[test]
fn mine_cuckaroo_mean_cpu_avx2_29() {
Expand All @@ -156,6 +164,15 @@ fn mine_cuckaroo_mean_cpu_avx2_29() {
mine_async_for_duration(&vec![config], 20);
}

#[cfg(feature = "test-avx2")]
#[test]
fn mine_cuckarood_mean_cpu_avx2_29() {
let mut config =
PluginConfig::new(mining_plugin_dir_for_tests(), "cuckarood_cpu_avx_29").unwrap();
config.params.nthreads = 4;
mine_async_for_duration(&vec![config], 20);
}

#[cfg(feature = "build-cuda-plugins")]
#[test]
fn mine_cuckaroo_cuda_29() {
Expand Down
13 changes: 6 additions & 7 deletions grin-miner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ stratum_server_tls_enabled = false
#miner_plugin_dir = "target/debug/plugins"

###############################################################
### CUCKAROO(D) (i.e. GPU-Friendly) MINER PLUGIN CONFIGURATION ###
### CUCKAROOD (i.e. GPU-Friendly) MINER PLUGIN CONFIGURATION ###
###############################################################

# Multiple plugins can be specified, (e.g. a cpu
Expand All @@ -72,23 +72,23 @@ stratum_server_tls_enabled = false
# but in CUDA plugins the device number can be set
# corresponding to the device ID. (use nvidia-smi to find this)

### CUCKAROO CPU SOLVERS (Asic Resist, or GPU-Friendly)
### CUCKAROOD CPU SOLVERS (Asic Resist, or GPU-Friendly)

# The fastest cpu algorithm, but consumes the most memory

[[mining.miner_plugin_config]]
plugin_name = "cuckaroo_cpu_compat_29"
plugin_name = "cuckarood_cpu_compat_29"
[mining.miner_plugin_config.parameters]
nthreads = 4

# As above, but for processors supporting avx2

#[[mining.miner_plugin_config]]
#plugin_name = "cuckaroo_cpu_avx2_29"
#plugin_name = "cuckarood_cpu_avx2_29"
#[mining.miner_plugin_config.parameters]
#nthreads = 4

# CUCKAROO(D) CUDA SOLVER
# CUCKAROOD CUDA SOLVER
#
# CUDA plugins are not built by default. To build:
#1) Ensure the latest cuda toolkit is installed
Expand All @@ -103,8 +103,7 @@ nthreads = 4

# currently requires 5.5GB+ GPU memory
#[[mining.miner_plugin_config]]
#plugin_name = "cuckaroo_cuda_29"
# or, to mine at height >= 262080: plugin_name = "cuckarood_cuda_29"
#plugin_name = "cuckarood_cuda_29"
#[mining.miner_plugin_config.parameters]
#device = 0
#cpuload = 1
Expand Down
2 changes: 1 addition & 1 deletion src/bin/tui/mining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl TUIStatusListener for TUIMiningView {
mining_stats.block_height, 4, mining_stats.combined_gps()
),
format!(
"Cuck(at)oo - Target Share Difficulty {}",
"Cuckatoo/Cuckarood - Target Share Difficulty {}",
mining_stats.target_difficulty.to_string()
),
)
Expand Down

0 comments on commit d28bd91

Please sign in to comment.