Skip to content

Commit

Permalink
Cuckarooz (#249)
Browse files Browse the repository at this point in the history
* support CUDA C32 mining

* add nearly 2x faster cuda mean cuckaroom solver

* update cuckoo

* update cuckoo again

* add old plugin

* update to latest cuckoo using only 2 arg version of static_assert

* add cuckarooz

* v4 featuring CUDA Cuckarooz

* Fix version and cargo update

* fix config line

Co-authored-by: Quentin Le Sceller <q.lesceller@gmail.com>
  • Loading branch information
tromp and quentinlesceller committed Jul 16, 2020
1 parent 038c77d commit e78aec6
Show file tree
Hide file tree
Showing 11 changed files with 403 additions and 362 deletions.
675 changes: 340 additions & 335 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grin_miner"
version = "3.0.0-beta.1"
version = "4.0.0"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Mining software for Grin, supports CPU and CUDA GPUs."
build = "src/build/build.rs"
Expand Down Expand Up @@ -32,12 +32,12 @@ slog = { version = "2", features = ["max_level_trace", "release_max_level_trace"
term = "0.6"
time = "0.1"

grin_miner_util = { path = "./util", version = "3.0.0-beta.1" }
grin_miner_plugin = { path = "./plugin", version = "3.0.0-beta.1" }
grin_miner_config = { path = "./config", version = "3.0.0-beta.1" }
cuckoo_miner = { path = "./cuckoo-miner", version = "3.0.0-beta.1" }
grin_miner_util = { path = "./util", version = "4.0.0" }
grin_miner_plugin = { path = "./plugin", version = "4.0.0" }
grin_miner_config = { path = "./config", version = "4.0.0" }
#cuckoo_miner = { path = "./cuckoo-miner", version = "4.0.0" }
#use this alternative inclusion below to build cuda plugins
#cuckoo_miner = { path = "./cuckoo-miner", version = "3.0.0-beta.1", features = ["build-cuda-plugins"]}
cuckoo_miner = { path = "./cuckoo-miner", version = "4.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
6 changes: 3 additions & 3 deletions config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "grin_miner_config"
version = "3.0.0-beta.1"
version = "4.0.0"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Configuration handling for the grin miner"
license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin-miner"
workspace = ".."

[dependencies]
cuckoo_miner = { path = "../cuckoo-miner", version = "3.0.0-beta.1" }
cuckoo_miner = { path = "../cuckoo-miner", version = "4.0.0" }
dirs = "2"
grin_miner_util = { path = "../util", version = "3.0.0-beta.1" }
grin_miner_util = { path = "../util", version = "4.0.0" }
serde = "1"
serde_derive = "1"
slog = { version = "2", features = ["max_level_trace", "release_max_level_trace"] }
Expand Down
6 changes: 3 additions & 3 deletions cuckoo-miner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cuckoo_miner"
version = "3.0.0-beta.1"
version = "4.0.0"
authors = ["yeastplume"]
license = "MIT/Apache-2.0/BSD-3-Clause"
description = "Rust bindings to John Tromp's Cuckoo Cycle Implementations"
Expand All @@ -21,8 +21,8 @@ build-cuda-plugins = []
byteorder = "1"
blake2-rfc = "0.2"
glob = "0.3"
grin_miner_util = { path = "../util", version = "3.0.0-beta.1" }
grin_miner_plugin = { path = "../plugin", version = "3.0.0-beta.1" }
grin_miner_util = { path = "../util", version = "4.0.0" }
grin_miner_plugin = { path = "../plugin", version = "4.0.0" }
libc = "0.2"
libloading = "0.6"
serde = "1"
Expand Down
38 changes: 37 additions & 1 deletion cuckoo-miner/src/cuckoo_sys/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ set (SKIP_CUCKATOO_GPU $ENV{SKIP_CUCKATOO_GPU})
set (SKIP_CUCKAROO_GPU $ENV{SKIP_CUCKAROO_GPU})
set (SKIP_CUCKAROOD_GPU $ENV{SKIP_CUCKAROOD_GPU})
set (SKIP_CUCKAROOM_CPU "1")
set (SKIP_CUCKAROOM_GPU $ENV{SKIP_CUCKAROOD_GPU})
set (SKIP_CUCKAROOM_GPU $ENV{SKIP_CUCKAROOM_GPU})
set (SKIP_CUCKAROOZ_CPU "1")
set (SKIP_CUCKAROOZ_GPU $ENV{SKIP_CUCKAROOZ_GPU})

#blake2b prerequisite
set (BLAKE_2B "cuckoo/src/crypto/blake2b-ref.c")
Expand Down Expand Up @@ -207,3 +209,37 @@ if (NOT SKIP_CUCKAROOM_GPU)
build_cuda_target("${AR2_CUDA_SRC2}" cuckaroom_old_cuda_29 "-DEDGEBITS=29")
build_cuda_target("${AR2_CUDA_SRC2}" cuckaroom_cuda_19 "-DXBITS=1 -DEPS_A=4 -DEPS_B=3 -DIDXSHIFT=8 -DEDGEBITS=19")
endif()

##################################################################################
### CUCKAROOZ (Asic Resistant) ##################################################
##################################################################################

### AR CPU BUILDING #########################################

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

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

if (NOT SKIP_CUCKAROOZ_CPU)
build_cpu_target("${AR2_CPU_SRC}" cuckarooz_cpu_compat_19 "-mno-avx2 -DXBITS=2 -DNSIPHASH=4 -DEDGEBITS=19 -DSAVEEDGES")
build_cpu_target("${AR2_CPU_SRC}" cuckarooz_cpu_avx2_19 "-mavx2 -DXBITS=2 -DNSIPHASH=8 -DEDGEBITS=19 -DSAVEEDGES")
build_cpu_target("${AR2_CPU_SRC}" cuckarooz_cpu_compat_29 "-mno-avx2 -DNSIPHASH=4 -DEDGEBITS=29 -DSAVEEDGES")
build_cpu_target("${AR2_CPU_SRC}" cuckarooz_cpu_avx2_29 "-mavx2 -DNSIPHASH=8 -DEDGEBITS=29 -DSAVEEDGES")
endif()

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

set (AR2_CUDA_SRC cuckoo/src/cuckarooz/mean.cu ${BLAKE_2B} )

if (NOT SKIP_CUCKAROOZ_GPU)
build_cuda_target("${AR2_CUDA_SRC}" cuckarooz_cuda_29 "-DEDGEBITS=29")
endif()
18 changes: 9 additions & 9 deletions grin-miner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ stratum_server_tls_enabled = false

# cpu mean algorithm for processors supporting sse2

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

# As above, but for processors supporting avx2

Expand All @@ -102,10 +102,10 @@ nthreads = 4
#

# currently requires 6GB GPU memory
#[[mining.miner_plugin_config]]
#plugin_name = "cuckaroom_cuda_29"
#[mining.miner_plugin_config.parameters]
#device = 0
[[mining.miner_plugin_config]]
plugin_name = "cuckarooz_cuda_29"
[mining.miner_plugin_config.parameters]
device = 0
#cpuload = 1
#ntrims = 15
#genablocks = 1024
Expand All @@ -115,7 +115,7 @@ nthreads = 4
# e.g. To enable multiple devices (copy params from above as needed)

#[[mining.miner_plugin_config]]
#plugin_name = "cuckarood_cuda_29"
#plugin_name = "cuckarooz_cuda_29"
#[mining.miner_plugin_config.parameters]
#device = 1

Expand Down
2 changes: 1 addition & 1 deletion ocl_cuckaroo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ profile = []
[dependencies]
blake2-rfc = "0.2"
byteorder = "1"
grin_miner_plugin = { path = "../plugin", version = "3.0.0-beta.1" }
grin_miner_plugin = { path = "../plugin", version = "4.0.0" }
libc = "0.2"
hashbrown = "0.7"
ocl = "0.19"
Expand Down
2 changes: 1 addition & 1 deletion ocl_cuckatoo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ workspace = ".."
[dependencies]
blake2-rfc = "0.2"
byteorder = "1"
grin_miner_plugin = { path = "../plugin", version = "3.0.0-beta.1" }
grin_miner_plugin = { path = "../plugin", version = "4.0.0" }
libc = "0.2"
ocl = "0.19"
hashbrown = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grin_miner_plugin"
version = "3.0.0-beta.1"
version = "4.0.0"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
repository = "https://github.com/mimblewimble/grin-miner"
description = "Device specific plugins for the grin miner"
Expand Down
2 changes: 1 addition & 1 deletion util/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grin_miner_util"
version = "3.0.0-beta.1"
version = "4.0.0"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Utilities for the grin miner"
repository = "https://github.com/mimblewimble/grin-miner"
Expand Down

0 comments on commit e78aec6

Please sign in to comment.