Skip to content

Commit

Permalink
Merge pull request #16 from bogdanadnan/alpha
Browse files Browse the repository at this point in the history
Alpha
  • Loading branch information
bogdanadnan authored May 15, 2019
2 parents 5de8b3e + 7b9890f commit 038736a
Show file tree
Hide file tree
Showing 206 changed files with 633,119 additions and 591,480 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
/win32/ariominer/x64
.idea
cmake-build-debug
proxy/reporting/package-lock.json
proxy/reporting/node_modules

29 changes: 23 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(SOURCE
http/http.cpp http/http.h
http/client.cpp http/client.h
http/server.cpp http/server.h
http/civetweb/civetweb.c http/civetweb/CivetServer.cpp
http/simplejson/json.h
miner/miner.cpp miner/miner.h
proxy/proxy.cpp proxy/proxy.h
Expand All @@ -23,9 +23,10 @@ set(SOURCE
miner/mini-gmp/mini-gmp.h miner/mini-gmp/mini-gmp.c
autotune/autotune.cpp autotune/autotune.h
app/runner.h
)
miner/miner_api.cpp miner/miner_api.h http/pool_settings_provider.cpp http/pool_settings_provider.h http/simplejson/json.cpp proxy/proxy_server.cpp proxy/proxy_server.h http/node_api.cpp http/node_api.h)
set(SOURCE_COMMON app/arguments.cpp app/arguments.h common/common.h common/common.cpp common/dllimport.h common/dllexport.h
crypt/sha512.cpp crypt/sha512.h crypt/base64.cpp crypt/base64.h crypt/random_generator.cpp crypt/random_generator.h)
crypt/sha512.cpp crypt/sha512.h crypt/base64.cpp crypt/base64.h crypt/random_generator.cpp crypt/random_generator.h
common/cfgpath.h)
set(SOURCE_HASHER hash/hasher.cpp hash/hasher.h hash/argon2/argon2.cpp hash/argon2/argon2.h
hash/argon2/defs.h hash/argon2/blake2/blake2b.c hash/argon2/blake2/blake2.h hash/argon2/blake2/blake2b-round.h
hash/argon2/blake2/blake2b-load-sse41.h hash/argon2/blake2/blake2b-load-sse2.h hash/argon2/blake2/blake2-config.h
Expand Down Expand Up @@ -101,6 +102,9 @@ if(NOT WITHOUT_CUDA)
LIBRARY_OUTPUT_DIRECTORY modules
)
target_link_libraries(cuda_hasher hasher)
if(NOT WIN32)
add_definitions(-DPARALLEL_CUDA)
endif()
add_dependencies(ariominer cuda_hasher)
endif()

Expand Down Expand Up @@ -142,6 +146,9 @@ target_link_libraries(ariominer common hasher)
if(WIN32)
target_link_libraries(ariominer ws2_32.lib)
endif()
if(APPLE)
set_target_properties(ariominer PROPERTIES LINK_FLAGS "-framework CoreServices")
endif()

add_library(argon2_fill_blocks_REF MODULE ${ARGON2_FILL_BLOCKS_SRC})
set_target_properties(argon2_fill_blocks_REF
Expand Down Expand Up @@ -173,17 +180,23 @@ if(ARCH STREQUAL "x86_64")
add_dependencies(ariominer argon2_fill_blocks_SSE2 argon2_fill_blocks_SSSE3 argon2_fill_blocks_AVX argon2_fill_blocks_AVX2 argon2_fill_blocks_AVX512F)
endif(ARCH STREQUAL "x86_64")

if(ARCH STREQUAL "arm")
if(ARCH STREQUAL "arm" OR ARCH STREQUAL "aarch64")
add_library(argon2_fill_blocks_NEON MODULE ${ARGON2_FILL_BLOCKS_SRC})
set_target_properties(argon2_fill_blocks_NEON
PROPERTIES
PREFIX ""
SUFFIX ".opt"
LIBRARY_OUTPUT_DIRECTORY modules
)
target_compile_options(argon2_fill_blocks_NEON PRIVATE -D__NEON__ -mfpu=neon -funsafe-math-optimizations)
target_compile_options(common PRIVATE -D__NEON__)
if(ARCH STREQUAL "arm")
target_compile_options(argon2_fill_blocks_NEON PRIVATE -D__NEON__ -mfpu=neon -funsafe-math-optimizations)
else()
target_compile_options(argon2_fill_blocks_NEON PRIVATE -D__NEON__)
endif(ARCH STREQUAL "arm")

add_dependencies(ariominer argon2_fill_blocks_NEON)
endif(ARCH STREQUAL "arm")
endif(ARCH STREQUAL "arm" OR ARCH STREQUAL "aarch64")

if(WIN32)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /D_CRT_SECURE_NO_WARNINGS=1")
Expand All @@ -192,3 +205,7 @@ if(WIN32)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /D_CRT_SECURE_NO_WARNINGS=1")
endif()

add_custom_target(copy-reporting-files ALL
COMMAND cmake -E copy_directory "${CMAKE_SOURCE_DIR}/proxy/reporting/dist" "${CMAKE_BINARY_DIR}/reporting")

add_dependencies(ariominer copy-reporting-files)
66 changes: 36 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@
### Arionum miner for CPU and GPU

## Dev Fee
In order to support development, this miner has 1% dev fee included - 1 minute from 100 minutes it will mine for developer.
In order to support development, this miner has 1% dev fee included - 1 minute from 100 minutes it will mine for developer. Mining settings are downloaded from http://coinfee.changeling.biz/index.json each time it switches to developer mining mode.

## Features
- optimized argon2 hashing library - both in speed and in memory usage; everything not related to arionum mining was stripped down, indexing calculation was replaced with precalculated versions (improvements in the range of 10% - 50% compared to existing miners)
- support for both CPU and GPU mining
- support for autodetecting the best version of the CPU hasher for your machine (SSE2/SSSE3/AVX2/AVX512F)
- optimized argon2 hashing library - both in speed and in memory usage; everything not related to arionum mining was stripped down, indexing calculation was replaced with precalculated versions
- support for both CPU and GPU mining using multiple engines perfectly adapted to your hardware
- support for autodetecting the best version of the CPU hasher for your machine (SSE2/SSSE3/AVX/AVX2/AVX512F)
- support for autotuning mode to get best settings for GPU mining
- [TODO] support for proxy mode, to act as an aggregator for multiple small miners
- support for proxy mode, to act as an aggregator for multiple small miners and providing a nice UI dashboard for an overall view of your farm

## Releases
There are binaries compiled for Windows 10, Ubuntu 16.04 & 18.04, Debian 9, CentOS 7 and HiveOS. Just pick the one that best suits you and skip to usage information. If for some reason the binaries don't work for you or you want the cutting edge version of this software you can try building it yourself using below instructions (build instructions are only provided for Ubuntu, you will need to adapt them accordingly for other distribution).
You can get the binaries from here:
https://github.com/bogdanadnan/ariominer/releases

## Instructions
## Build it yourself
What you need:
- for Windows download binary version from releases page and skip to Usage
- recent Linux distribution (Ubuntu recommended - 16.04 or higher) or Mac OS X
- OpenCL libraries and headers (for Ubuntu install **ocl-icd-opencl-dev** package, for Mac OS X it should be included in XCode SDK) - even if you don't plan to use GPU (will add a switch later on to be configurable)
- Recent Linux distribution (recommended - Ubuntu 16.04 or higher)
- Git client
- CMake 3
- GCC & G++
- GCC & G++ version 7 or higher or LLVM/Clang 7 or higher. Provided binaries are compiled with Clang 7, it seems to give a slightly higher hashrate for CPU mining.
- CUDA developer toolkit 9 or higher. Provided binaries are compiled with CUDA 10.1. Follow instructions from NVidia site to get the latest version up and running: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html (be careful that CUDA might have specific requirements for compiler version as well)
- OpenCL libraries and headers

Instructions:
- run the following snippet:
Expand All @@ -30,13 +32,11 @@ $ git clone http://github.com/bogdanadnan/ariominer.git
$ cd ariominer
$ mkdir build
$ cd build
$ cmake ..
$ cmake .. -DCMAKE_BUILD_TYPE=Release
$ make
```
Additional informations:
https://forum.arionum.com/viewtopic.php?f=15&t=369

Usage:
## Basic usage:
**!!! In some cases (mostly on Windows) the miner doesn't properly detect AVX2 optimization for CPU. If AVX2 doesn't appear in optimization features list for CPU at miner startup, please verify on google if your CPU model has it. If it does have AVX2 support, please run it with "--force-cpu-optimization AVX2" option. This will give a serious boost to hash rate speed so it does worth the effort to check. !!!**

- starting in miner mode:
Expand All @@ -45,7 +45,7 @@ Usage:
```
- starting in autotune mode:
```sh
ariominer --mode autotune --block-type GPU --intensity-start <intensity> --intensity-stop <intensity> --intensity-step <intensity>
ariominer --mode autotune --block-type GPU --autotune-start <intensity> --autotune-stop <intensity> --autotune-step <intensity>
```
- starting in proxy mode:
```sh
Expand All @@ -55,26 +55,32 @@ Usage:
Parameters:
--help: show this help text
--verbose: print more informative text during run
--mode <mode>: start in specific mode - arguments: miner / proxy
- miner: this instance will mine for arionum
- autotune: for finding best intensity for GPU mining
- proxy: this instance will act as a hub for multiple miners; useful to aggregate multiple miners into a single instance reducing the load on the pool [TODO]

--mode <mode>: start in specific mode - arguments: miner / autotune / proxy
* miner: this instance will mine for arionum
* autotune: for finding best intensity for GPU mining
* proxy: this instance will act as a hub for multiple miners, useful to aggregate multiple miners into a single instance reducing the load on the pool
--pool <pool address>: pool/proxy address to connect to (eg. http://aropool.com:80)
--wallet <wallet address>: wallet address; this is optional if in miner mode and you are connecting to a proxy
--name <worker identifier>: worker identifier this is optional if in miner mode and you are connecting to a proxy
--port <proxy port>: proxy specific option, port on which to listen for clients this is optional, defaults to 8088
--name <worker identifier>: worker identifier; this is optional, will be autogenerated if is not provided
--port <proxy port>: proxy specific option, port on which to listen for clients; this is optional, defaults to 8088
--enable-api-port <api port>: miner specific option, port on which to listen for api requests; if enabled, you can get reports in json format at http://localhost:port/status; this is optional, defaults to disabled (value 0)
--cpu-intensity: miner specific option, mining intensity on CPU; value from 0 (disabled) to 100 (full load); this is optional, defaults to 100 (\*)
--gpu-intensity-cblocks: miner specific option, mining intensity on GPU; value from 0 (disabled) to 100 (full load); this is optional, defaults to 100 (\*); you can add more entries separated by comma for each GPU
--gpu-intensity-gblocks: miner specific option, mining intensity on GPU; value from 0 (disabled) to 100 (full load); this is optional, defaults to 100 (\*); you can add more entries separated by comma for each GPU
--gpu-filter: miner specific option, filter string for device selection; it will select only devices that have in description the specified string; this is optional, defaults to ""; you can add more entries separated by comma
--force-cpu-optimization: miner specific option, what type of CPU optimization to use; values: REF, SSE2, SSSE3, AVX2, AVX512F; this is optional, defaults to autodetect, change only if autodetected one crashes
--block-type: miner specific option, override block type sent by pool; useful for tuning intensity; values: CPU, GPU; don't use for regular mining, shares submitted during opposite block type will be rejected
--gpu-intensity-cblocks: miner specific option, mining intensity on GPU; value from 0 (disabled) to 100 (full load); this is optional, defaults to 100 (\*); you can add more entries separated by comma for each GPU; in this case you need to add entries for all cards displayed, even if card is disabled by gpu-filter - use 0 for those
--gpu-intensity-gblocks: miner specific option, mining intensity on GPU; value from 0 (disabled) to 100 (full load); this is optional, defaults to 100 (\*); you can add more entries separated by comma for each GPU; in this case you need to add entries for all cards displayed, even if card is disabled by gpu-filter - use 0 for those
--gpu-filter: miner specific option, filter string for device selection; it will select only devices that have in description the specified string; this is optional, defaults to ""; you can add more entries separated by comma; if using multiple gpu hashers you can select specific filters for each like this: --gpu-filter CUDA:[1],CUDA:[2],OPENCL:AMD where [1], [2] and AMD are filters for cards
--force-cpu-optimization: miner specific option, what type of CPU optimization to use; values: REF, SSE2, SSSE3, AVX, AVX2, AVX512F; this is optional, defaults to autodetect, change only if autodetected one crashes
--force-gpu-optimization: what type of GPU optimization/hasher to use; values: OPENCL, CUDA, AMDGCN; this is optional, defaults to autodetect; you can add more entries separated by comma
--chs-threshold: miner specific option, cblocks hashrate value under which miner will exit - it will trigger after 5 displays in report in order to allow warmup after block changes (default is disabled)
--ghs-threshold: miner specific option, gblocks hashrate value under which miner will exit - it will trigger after 5 displays in report in order to allow warmup after block changes (default is disabled)
--block-type: miner specific option, override block type sent by pool; useful for tunning intensity; values: CPU, GPU; don't use for regular mining, shares submitted during opposite block type will be rejected
--update-interval: how often should we update mining settings from pool, in seconds; increasing it will lower the load on pool but will increase rejection rate; this is optional, defaults to 2 sec and can't be set lower than that
--hash-report-interval: how often should we send hashrate to pool, in minutes; this is optional, defaults to 10 min and can't be set lower than 1 min
--report-interval: how often should we display mining reports, in seconds; this is optional, defaults to 10 sec
--intensity-start: autotune specific option, start intensity for autotuning (default 1)
--intensity-stop: autotune specific option, stop intensity for autotuning (default 100)
--intensity-step: autotune specific option, intensity steps for autotuning (default 1)
--show-pool-requests: miner specific option, show full requests sent to pool, debug purpose only
--autotune-start: autotune specific option, start intensity for autotuning (default 1)
--autotune-stop: autotune specific option, stop intensity for autotuning (default 100)
--autotune-step: autotune specific option, intensity steps for autotuning (default 1)
--autotune-step-time: autotune specific option, how much time should wait in a step before measuring h/s, in seconds (minimum 10, default 20)

(\*) Mining intensity depends on the number of CPU/GPU cores and available memory. Full load (100) is dynamically calculated by the application. You can use fractional numbers for better tuning.
Expand Down
2 changes: 2 additions & 0 deletions TargetArch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
set(archdetect_c_code "
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
#error cmake_ARCH arm
#elif defined(__aarch64__)
#error cmake_ARCH aarch64
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error cmake_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
Expand Down
Loading

0 comments on commit 038736a

Please sign in to comment.