Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] PoW HardFork #214

Merged
merged 2 commits into from Jun 23, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -14,6 +14,9 @@ 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
set (BLAKE_2B "cuckoo/src/crypto/blake2b-ref.c")
@@ -129,5 +132,41 @@ build_cpu_target("${AR_CPU_SRC}" cuckaroo_cpu_avx2_29 "-mavx2 -DNSIPHASH=8 -DEDG

set (AR_CUDA_SRC cuckoo/src/cuckaroo/mean.cu ${BLAKE_2B} )

build_cuda_target("${AR_CUDA_SRC}" cuckaroo_cuda_19 "-DEPS_A=4 -DEPS_B=3 -DIDXSHIFT=2 -DEDGEBITS=19")
build_cuda_target("${AR_CUDA_SRC}" cuckaroo_cuda_29 "-DEDGEBITS=29")
if (NOT SKIP_CUCKAROO_GPU)
build_cuda_target("${AR_CUDA_SRC}" cuckaroo_cuda_19 "-DEPS_A=4 -DEPS_B=3 -DIDXSHIFT=2 -DEDGEBITS=19")
build_cuda_target("${AR_CUDA_SRC}" cuckaroo_cuda_29 "-DEDGEBITS=29")
endif()

##################################################################################
### CUCKAROOD (Asic Resistant) ##################################################
##################################################################################

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

set (AR2_CPU_SRC
cuckoo/src/cuckarood/cuckaroo.hpp
cuckoo/src/cuckarood/bitmap.hpp
cuckoo/src/cuckarood/graph.hpp
cuckoo/src/threads/barrier.hpp
cuckoo/src/crypto/siphash.hpp
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()

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

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

if (NOT SKIP_CUCKAROOD_GPU)
build_cuda_target("${AR2_CUDA_SRC}" cuckarood_cuda_19 "-DEPS_A=4 -DEPS_B=3 -DIDXSHIFT=2 -DEDGEBITS=19")
build_cuda_target("${AR2_CUDA_SRC}" cuckarood_cuda_29 "-DEDGEBITS=29")
endif()
@@ -1,4 +1,4 @@
// Copyright 2017 The Grin Developers
// Copyright 2017-2019 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -162,3 +162,10 @@ fn mine_cuckaroo_cuda_29() {
let config = PluginConfig::new(mining_plugin_dir_for_tests(), "cuckaroo_cuda_29").unwrap();
mine_async_for_duration(&vec![config], 20);
}

#[cfg(feature = "build-cuda-plugins")]
#[test]
fn mine_cuckarood_cuda_29() {
let config = PluginConfig::new(mining_plugin_dir_for_tests(), "cuckarood_cuda_29").unwrap();
mine_async_for_duration(&vec![config], 20);
}
@@ -1,4 +1,4 @@
// Copyright 2017 The Grin Developers
// Copyright 2017-2019 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -47,7 +47,10 @@ const TEST_PLUGIN_LIBS_CORE: [&str; 6] = [
"cuckaroo_cpu_compat_29",
];

const TEST_PLUGIN_LIBS_OPTIONAL: [&str; 1] = ["cuckaroo_mean_cuda_29"];
const TEST_PLUGIN_LIBS_OPTIONAL: [&str; 2] = [
"cuckaroo_mean_cuda_29",
"cuckarood_mean_cuda_29",
];

//Helper to convert from hex string
fn from_hex_string(in_str: &str) -> Vec<u8> {
@@ -58,7 +58,7 @@ stratum_server_tls_enabled = false
#miner_plugin_dir = "target/debug/plugins"

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

# Multiple plugins can be specified, (e.g. a cpu
@@ -88,7 +88,7 @@ nthreads = 4
#[mining.miner_plugin_config.parameters]
#nthreads = 4

# CUCKAROO CUDA SOLVER
# CUCKAROO(D) CUDA SOLVER
#
# CUDA plugins are not built by default. To build:
#1) Ensure the latest cuda toolkit is installed
@@ -104,6 +104,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"
#[mining.miner_plugin_config.parameters]
#device = 0
#cpuload = 1
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.