veriumMiner for solomining and pools
Clone or download
Pull request Compare This branch is 80 commits ahead, 3 commits behind effectsToCause:main.
fireworm71 Merge pull request #25 from gnewtzie/main
added armbian temp monitoring without running as sudo
Latest commit cf76b5e Aug 21, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
algo ARM NEON / Arch64: fix ARM NEON detection (magnumripper/JohnTheRipper… Jan 18, 2018
api api: add support for websocket calls Dec 18, 2014
asm Merge pull request #7 from VeriumReserve/main Feb 2, 2018
compat small changes in --version output May 22, 2016
crypto removed unnecessary hash functions Sep 22, 2016
res Update cpuminer.rc Jan 16, 2018
.gitattributes Add skein support Apr 23, 2014
.gitignore rm temps Sep 22, 2016
.travis.yml switch application prefix from minerd to cpuminer Dec 7, 2014
AUTHORS add contributors Jan 10, 2018
Android.mk fix for x86 and arm (bionic) builds Aug 2, 2015
COPYING Initial commit Apr 23, 2014
Dockerfile Update Dockerfile Jan 11, 2018
LICENSE Initial commit Apr 23, 2014
Makefile.am Merge in darkwolf changes, but keep the docker file around Jan 11, 2018
README.md More updates for readme... Jan 8, 2018
api.c Fix up some stuff for miner monitor, based on wienerdog's setup Jan 4, 2018
autogen.sh windows: fix build with mingw64 Oct 30, 2014
build.sh Merge in darkwolf changes, but keep the docker file around Jan 11, 2018
compat.h Fix up some stuff for the windows build Dec 19, 2017
configure.ac Merge in darkwolf changes, but keep the docker file around Jan 11, 2018
cpu-miner.c ARM NEON / Arch64: fix ARM NEON detection (magnumripper/JohnTheRipper… Jan 18, 2018
cpuminer-conf.json default to fireworm71 donations Jan 10, 2018
cpuminer.1 switch application prefix from minerd to cpuminer Dec 7, 2014
cpuminer.nsi cleanup: remove extern, sort cputest + lowercase Mar 11, 2015
cpuminer.sln Add support for windows (VC2013) Oct 29, 2014
cpuminer.vcxproj Fixes for VS compile on windows, and add some missing libraries. Nov 22, 2017
cpuminer.vcxproj.filters Fixes for VS compile on windows, and add some missing libraries. Nov 22, 2017
elist.h debug: add -f option to test with reduced diff Oct 31, 2014
miner.h ARM NEON / Arch64: fix ARM NEON detection (magnumripper/JohnTheRipper… Jan 18, 2018
mingw64.sh Fix up some stuff for miner monitor, based on wienerdog's setup Jan 4, 2018
nomacro.pl clang: fix nomacro.pl path and chmod Nov 21, 2015
sysinfos.c added armbian temp monitoring without running as sudo Feb 21, 2018
uint256.cpp yescrypt algo (basic and simd) Dec 5, 2015
uint256.h Add sib algo and start the work on diff (part 1) Oct 1, 2015
util.c Fix up some stuff for miner monitor, based on wienerdog's setup Jan 4, 2018

README.md

veriumMiner

This is a multi-threaded CPU miner for Verium using scrypt², fork of tpruvot's cpuminer-multi (see AUTHORS for list of contributors).

Latest Binaries here

Table of contents

Overview

To use this miner, you can do one of the following:

  • Grab a precompiled exe here.
  • Build from source: Easy:
    [install dependencies for your os]
    git clone https://github.com/fireworm71/veriumMiner
    cd veriumMiner
    ./build.sh
    ./cpuminer ...
    
  • Build from source: Advanced:
    [install dependencies for your os]
    git clone https://github.com/fireworm71/veriumMiner
    cd veriumMiner
    ./autogen.sh
    perl nomacro.pl
    ./configure CFLAGS="-O2" --with-curl --with-crypto
    make clean && make
    ./cpuminer ...
    

Download

Dependencies

  • libcurl http://curl.haxx.se/libcurl/

  • jansson http://www.digip.org/jansson/ (jansson source is included in-tree)

  • openssl libcrypto https://www.openssl.org/

  • pthreads

  • zlib (for curl/ssl)

  • Ubuntu / Debian:

  • apt-get install automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev zlib1g-dev

  • FreeBSD:

  • pkg install automake autoconf git

  • Build libcurl by compiling and installing the curl port cd /usr/ports/ftp/curl; make install

Build

Basic *nix build instructions:

  • After dowloading dependencies: ./build.sh

If you are fancy,

  • ./autogen.sh # only needed if building from git repo
  • ./nomacro.pl # only needed if building on Mac OS X or with Clang
  • ./configure CFLAGS="-march=native" --with-crypto --with-curl
  • make

FreeBSD users:

   export C_INCLUDE_PATH=$INCLUDE_PATH:/usr/local/include
   export CPLUS_INCLUDE_PATH=$INCLUDE_PATH:/usr/local/include
   export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
   ./autogen.sh
   /usr/local/bin/perl ./nomacro.pl
   ./configure CFLAGS="-march=native" --with-crypto --with-curl
   make

Notes for AIX users:

  • To build a 64-bit binary, export OBJECT_MODE=64
  • GNU-style long options are not supported, but are accessible via configuration file

Basic Windows build instructions, using MinGW64:

  • Install MSYS 2 64bit
  • Open the MSYS2 64bit Shell
Pacman -Syu
  • Kill Terminal with taskmanager & reopen
pacman -Sy mingw-w64-x86_64-gcc
pacman -Sy make
pacman -Sy automake
pacman -Sy autoconf

pacman -Sy mingw-w64-x86_64-curl
pacman -Sy curl libcurl libcurl-devel mingw-w64-x86_64-curl mingw-w64-x86_64-libwinpthread-git libopenssl openssl openssl-devel
cd /veriumMiner-main
./mingw64.sh
  • If deploying to another computer, you will also need to copy: libeay32.dll, libjansson-4.dll, and libwinpthread-1.dll from the C:\msys64\mingw64\bin folder, as well as cpuminer.exe.

Architecture-specific notes:

  • ARMv8:
    • Neon is enabled by default, ./build.sh should work fine.
  • ARMv7:
    • No runtime CPU detection. The miner can take advantage of some instructions specific to ARMv5E and later processors, but the decision whether to use them is made at compile time, based on compiler-defined macros.
    • To use NEON instructions, add -mfpu=neon to CFLAGS.
  • x86:
    • The miner checks for SSE2 instructions support at runtime, and uses them if they are available.
  • x86-64:
    • The miner can take advantage of AVX, AVX2 and XOP instructions, but only if both the CPU and the operating system support them.
      • Linux supports AVX starting from kernel version 2.6.30.
      • FreeBSD supports AVX starting with 9.1-RELEASE.
      • Mac OS X added AVX support in the 10.6.8 update.
      • Windows supports AVX starting from Windows 7 SP1 and Windows Server 2008 R2 SP1.
    • The configure script outputs a warning if the assembler doesn't support some instruction sets. In that case, the miner can still be built, but unavailable optimizations are left off.

Usage instructions

Run "cpuminer --help" to see options.

HugePages

HugePages allow for faster memory lookups, which is very important for this miner. Enabling HugePages typically gets 10% or more performance.

HugePages (Linux)

To make matters complicated, there are two ways of doing this. One is transparent_hugepages one is preallocated. Even more complicated, one is sometimes faster than the other.

This miner will use transparent_hugepages by default.

To enable transparent_hugepages, (on Ubuntu 16.04): echo always | sudo tee /sys/kernel/mm/transparent_hugepage/enabled

To disable transparent_hugepages, (on Ubuntu 16.04): echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled

To verify the status of transparent_hugepages cat /sys/kernel/mm/transparent_hugepage/enabled ([] will show around the current status).

To enable preallocated hugepages (on Ubuntu 16.04), first check that you have /proc/sys/vm/nr_hugepages by doing ls /proc/sys/vm (you should see nr_hugepages in the print out). Then,

  1. sudo nano /etc/sysctl.conf,
  2. scroll to the bottom,
  3. type in vm.nr_hugepages=size
  4. Ctrl+O, then [Enter], then Ctrl+X.
  5. sudo sysctl -p

To disable:

  1. sudo nano /etc/sysctl.conf,
  2. scroll to the bottom,
  3. remove the line vm.nr_hugepages=size
  4. Ctrl+O, then [Enter], then Ctrl+X.
  5. sudo sysctl -p

Note that you can also reboot and this will cause HugePages to allocate / deallocate.

When enabling, you should see vm.nr_hugepages=size print out on the console. If not, check your distro. You may need to recompile your kernel to enable this. You can also verify that memory is allocated by running free and seeing that you now have a ton of memory allocated, but aren't running anything that's using it.

size = (the amount of memory each miner thread needs) / (2048 * 1024).

How much memory is be used per thread?

  • 1way : 128MB -> nr_hugepages = 65.
  • SSE4 (3way) : 384MB -> nr_hugepages = 193.
  • AVX (3way) : 384MB -> nr_hugepages = 193.
  • AVX2 (6way) : 768MB -> nr_hugepages = 386.
  • ARMv7 (3way) : 384MB -> nr_hugepages = 193.
  • ARMv8 (3way) : 384MB -> nr_hugepages = 193.

Multiply that number by the number of threads, and you will have the size needed. Note, you may not have enough RAM for this on ARM SoCs. The miner should still work, but it will not be as optimal.

For example, 4 threads on an SSE4, you'd type vm.nr_hugepages=772. Since 4 (threads) * 193 (hugepages per thread) = 772.

HugePages (Windows)

  • You need to run the miner with "Run As Administrator" on Windows.
  • You need to edit your system's group policies to enable locking large pages. Here are the steps from MSDN:
  1. On the Start menu, click Run. In the Open box, type gpedit.msc.
  2. On the Local Group Policy Editor console, expand Computer Configuration, and then expand Windows Settings.
  3. Expand Security Settings, and then expand Local Policies.
  4. Select the User Rights Assignment folder.
  5. The policies will be displayed in the details pane.
  6. In the pane, double-click Lock pages in memory.
  7. In the Local Security Setting – Lock pages in memory dialog box, click Add User or Group.
  8. In the Select Users, Service Accounts, or Groups dialog box, add an account that you will run the miner on
  9. Reboot for change to take effect.
  • Windows also tends to fragment memory a lot. If you are running on a system with 4-8GB of RAM you might need to switch off all the auto-start applications and reboot to have a large enough chunk of contiguous memory.

Oneways, cpu affinity.

You can now specify a number of 'oneway' threads to acompany your 'default way' threads. Default way is determined by your CPU instruction set.

'-1 n' will specify the number of oneway threads to spawn. You can also use --oneways n. Some folks (on arm especially) see perf gains due to the implementation. Additionally, there are new options to help control affinity for these threads and 'default' way threads too. --cpu-affinity-stride N, --cpu-affinity-default-index N, --cpu-affinity-oneway-index N, and --cpu-priority-oneway 0-5

Affinity stride works by saying how many cpus should be skipped before assigning the thread to it. So, if you have 8 cpu's and set 'stride' to 3, you will start with CPU (0 + 3 * 0), then CPU (0 + 3 * 1), then CPU (0 + 3 * 2), aka CPU's 0, 3, 6. 'default' index is the starting index ('0' in the example) for the number of -t threads. 'oneway-index' is the starting index for oneway -1 threads.

Play around with them, and pass -D to get some debug output.

e.g, 'Bind oneways to odd threads, 'defaults' to even threads: ./cpuminer ... -t 4 -1 4 --cpu-affinity-stride 2 --cpu-affinity-default-index 0 --cpu-affinity-oneway-index 1 e.g.2, 'Bind oneways to the last 4 cpu's after the defaults' ./cpuminer ... -t 4 -1 4 --cpu-affinity-stride 1 --cpu-affinity-default-index 0 --cpu-affinity-oneway-index 4 (edited)

RYZEN USERS pass --ryzen.

Ryzen's implementation of AVX2 is ... subpar. Please pass --ryzen on the commandline to default to the AVX implementation. Users reported ~25% gains.

Connecting through a proxy

Use the --proxy option.

To use a SOCKS proxy, add a socks4:// or socks5:// prefix to the proxy host
Protocols socks4a and socks5h, allowing remote name resolving, are also available since libcurl 7.18.0.

If no protocol is specified, the proxy is assumed to be a HTTP proxy.
When the --proxy option is not used, the program honors the http_proxy and all_proxy environment variables.

GCC

Some people have reported increases by using GCC 7.2. Please note, this will replace your existing GCC installation, which may become unrecoverable if any errors occur in the make process.

To build and install GCC 7.2 on Ubuntu do the following:

  • apt-get -y install unzip flex
  • wget https://github.com/gcc-mirror/gcc/archive/gcc-7_2_0-release.zip
  • unzip gcc-7_2_0-release.zip
  • cd gcc-gcc-7_2_0-release
  • sudo ./contrib/download_prerequisites
  • mkdir build && cd build
  • ../configure --enable-languages=c,c++ --disable-multilib
  • make -j 8
  • make install

Credits

CPUMiner-multi was forked from pooler's CPUMiner, and has been started by Lucas Jones.

  • tpruvot added all the recent features and newer algorythmns
  • Wolf9466 helped with Intel AES-NI support for CryptoNight
  • FireWorm71 helped with ARMv8 implementation, and memory optimizations.

Donations

This miner does not include any automatic donation code. Please donate if you find this code profitable. A suggestion is about 3.5 days of mining time per year (1%). If you prefer to mine on my behalf, please run your miner with the miner args below.

  • FireWorm71:
    • Mining Donations: ./cpuminer -o stratum+tcp://stratum.poolsloth.com:3333 -u fireworm.donations -p x
    • BTC: 1PPw16NEwMbGmobCcEyy9XhU5Uy7LTsRrZ
    • VRM: VB99zk5BGzAFsQvrrQeBBnZNGZYgmRfmSy
    • VRC: VYy4v95EfkJy7QnPSwfK7fhgWPM4RujbPf

License

GPLv2. See COPYING for details.