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

2016-11-11 MERGE: kost branch #1

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
713caad
Change submodule to point to our version of submodule
kost Oct 31, 2016
f684e91
Initial support for auto AVX
kost Oct 31, 2016
d392e09
External module update
kost Oct 31, 2016
7cafb9c
Provide new instructions for building
kost Oct 31, 2016
3d4101c
remove letter typo
kost Oct 31, 2016
b1b5b2a
Initial Mac OS X support for AVX1/AVX2
kost Nov 1, 2016
e96c859
Add more ifdefs
kost Nov 1, 2016
5fe8e2c
updated external submodule
kost Nov 1, 2016
601e6ef
Provide examples for xenon builds for Mac OS X
kost Nov 1, 2016
ac1050a
Provide instructions in big bold letters
kost Nov 1, 2016
56a903e
Initial mingw support
kost Nov 2, 2016
b50956c
Typo with # preprocessor
kost Nov 2, 2016
19ff31a
make it work with mingw c++
kost Nov 2, 2016
1dc3b52
Fix ugly errors on exit
kost Nov 2, 2016
d5a3e79
Add command line for overriding engine typey
kost Nov 2, 2016
6f9a4f8
Fixed support for mingw and xenon
kost Nov 2, 2016
ec75c3c
Provide example with mingw
kost Nov 2, 2016
1257639
VIsual studio is not well tested, move it to the bottom
kost Nov 2, 2016
ef33e02
Make correct agent string and version
kost Nov 2, 2016
027fc65
Provide cmake option MOPT to specify custom opts
kost Nov 2, 2016
fe390ee
Workaround credits and acknowledgements
kost Nov 2, 2016
67e2fcf
Put up donations page
kost Nov 2, 2016
925f546
Provide donate options
kost Nov 2, 2016
800e803
How releases are crafted
kost Nov 2, 2016
863b49b
make some space
kost Nov 2, 2016
b8dfe14
Add example toolchain cmake file from Fedora 22
kost Nov 2, 2016
77ea131
Add cmake toolchain example
kost Nov 2, 2016
5a97157
format yhelp as code
kost Nov 2, 2016
33d8621
Basic Dockerfile
Nov 2, 2016
b77f66e
Merge pull request #1 from faddat/patch-1
kost Nov 2, 2016
c24efa3
Use latest version of equihash-xenon from kost tree
kost Nov 3, 2016
896482f
Update Dockerfile
Nov 4, 2016
0b4e1b5
Merge pull request #2 from faddat/patch-2
kost Nov 4, 2016
c815d52
Smaller docker image
nyanloutre Nov 4, 2016
2cf331f
Merge pull request #3 from nyanloutre/patch-1
kost Nov 5, 2016
56318a2
Support for Non-Intel architectures
kost Nov 10, 2016
e939cd7
Add raspberry pi instructions
kost Nov 10, 2016
284d56f
No need for xenon=2, it will be automatically detected
kost Nov 10, 2016
1bd56df
Add host prereqs
kost Nov 10, 2016
81c7ef8
Make it work with Debian based distros
kost Nov 10, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "nheqminer/external/equihash-xenon"]
path = nheqminer/external/equihash-xenon
url = https://github.com/xenoncat/equihash-xenon
url = https://github.com/kost/equihash-xenon
branch = kost
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM alpine

RUN apk add --no-cache --virtual=build-dependencies git cmake make gcc g++ libc-dev boost-dev && \
git clone --recursive https://github.com/kost/nheqminer.git && \
cd /nheqminer/nheqminer && \
mkdir build && \
cd /nheqminer/nheqminer/build && \
cmake -DSTATIC_BUILD=1 -DXENON=2 -DMARCH="-m64" .. && \
make && \
apk del --purge build-dependencies

ENTRYPOINT ["/nheqminer/nheqminer/build/nheqminer"]
146 changes: 118 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@

Equihash/zcash/zec miner (can be used for pool mining)

**NOTE: Common mistake is to clone this repo without recursive, you need to use --recursive**

```
git clone --recursive https://github.com/kost/nheqminer
```

**Your build with XENON/XENONCAT will fail otherwise**

# Features

Major things:
- Implemented all fast implementations (tromp and xenoncati with AVX1/AVX2)
- Implemented all fast implementations (tromp and xenoncat with AVX1/AVX2)
- Better support for other platforms

Platforms:
- Linux (tromp, xenoncat support)
- Mac OS X (tromp so far)
- Mac OS X (tromp and xenoncat support)
- Windows (tromp, xenoncat but need tweaking)

# Usage
Expand Down Expand Up @@ -44,39 +52,33 @@ Add -DXENON to cmake to build with AVX/AVX2 support.

## Options to build Fastest miner

If you are building for Linux and your processor is i5 or i7 (supports AVX2), you can say something like:
If you are building for Linux and for your processor on local machine (with AVX1/AVX2 automatically detected) , you can say something like:

`cmake -DXENON=2 ..`
`cmake -DXENON=1 ..`

If you are building for Linux and your processor is i3 or xeon (supports AVX), you can say something like:
This will build -march=native by default.

`cmake -DXENON=1 ..`
If you need to transfer binaries to other machines and automatically detect AVX1/AVX2 or not, you can say something like:

`cmake -DXENON=1 -DMARCH="-m64" ..`

If you don't have AVX/AVX2 support, just build without any options:
If you don't want to compile with AVX/AVX2 support, just build without any options:

`cmake ..`

Note AVX/AVX2 binaries should automatically downgrade to tromp if nothing else found.

Full example:
```
sudo apt-get install cmake build-essential libboost-all-dev
git clone --recursive https://github.com/kost/nheqminer.git
cd nheqminer/nheqminer
mkdir build
cd build
cmake -DXENON=2 ..
cmake -DXENON=1 ..
make
```

## Windows:

Windows builds made by us are available here: https://github.com/kost/nheqminer/releases

Download and install:
- Visual Studio 2013 Community: https://www.visualstudio.com/en-us/news/releasenotes/vs2013-community-vs
- Visual C++ Compiler November 2013 CTP: https://www.microsoft.com/en-us/download/details.aspx?id=41151

Open **nheqminer.sln** under **nheqminer/nheqminer.sln** and build.

## Linux cmake **recommended** (Tested on Ubuntu Desktop 14.04 and 16.04 and Ubuntu server 14.04):
You should have **CMake** installed (2.8 minimal version), boost (install from the repositories or download boost manually build and install it manually), download the sources manually or via git.
Under Ubuntu open a terminal and run the following commands:
Expand All @@ -85,46 +87,116 @@ Under Ubuntu open a terminal and run the following commands:
- `cd nheqminer/nheqminer`
- `mkdir build`
- `cd build`
- `cmake -DXENON=2 ..`
- `cmake -DXENON=1 ..`
- `make`

Note: for the fastest miner, it is recommended to use `cmake -DXENON=2 ..`
Note: for the fastest miner, it is recommended to use `cmake -DXENON=1 ..`

## Windows cmake **recommended** (Tested on Fedora 23):
You should have **CMake** installed (2.8 minimal version), boost (install from the repositories or download boost manually build and install it manually), download the sources manually or via git.
Under Fedora open a terminal and run the following commands:
- `sudo dnf install mingw64-winpthreads-static mingw64-boost-static cmake make git`
- `git clone --recursive https://github.com/kost/nheqminer.git`
- `cd nheqminer/nheqminer`
- `mkdir build`
- `cd build`
- `cmake -DSTATIC_BUILD=1 -DXENON=1 -DMARCH="-m64" ..`
- `make`

## Full static Linux cmake **recommended** (Tested on Alpine 3.4):
## Full static Linux cmake **auto-AVX build recommended** (Tested on Alpine 3.4):
You should have **CMake** installed (2.8 minimal version), boost (install from the repositories or download boost manually build and install it manually), download the sources manually or via git.
Under Alpine open a terminal and run the following commands:
- `sudo apk add --update git cmake make gcc g++ libc-dev boost-dev`
- `git clone --recursive https://github.com/kost/nheqminer.git`
- `cd nheqminer/nheqminer`
- `mkdir build`
- `cd build`
- `cmake -DXENON=2 -DSTATIC_BUILD=1 ..`
- `cmake -DSTATIC_BUILD=1 -DXENON=1 -DMARCH="-m64" ..`
- `make`


## Mac OS X (currently only Tromp, no xenoncat):
## Mac OS X (Tromp and Xenoncat):
You need to have git, cmake, make and Mac OS X Developer stuff (compiler, etc).
Under Mac open a terminal and run the following commands:
- `git clone --recursive https://github.com/kost/nheqminer.git`
- `cd nheqminer/nheqminer`
- `mkdir build`
- `cd build`
- `cmake -DSTATIC_BUILD=1 ..`
- `cmake -DXENON=1 -DSTATIC_BUILD=1 ..`
- `make`

## Linux cmake on Raspberry PI (Tested on Raspberry PI 2):
You should have **CMake** installed (2.8 minimal version), boost (install from the repositories or download boost manually build and install it manually), download the sources manually or via git.
Under Raspbian open a terminal and run the following commands:
- `sudo apt-get install git cmake build-essential libboost-all-dev`
- `git clone --recursive https://github.com/kost/nheqminer.git`
- `cd nheqminer/nheqminer`
- `mkdir build`
- `cd build`
- `cmake -DNONINTEL=1 ..`
- `make`

## Linux cmake on Raspberry PI (Tested on Alpine on Raspberry PI):
You should have **CMake** installed (2.8 minimal version), boost (install from the repositories or download boost manually build and install it manually), download the sources manually or via git.
Under Alpine open a terminal and run the following commands:
- `sudo apk add --update git cmake make gcc g++ libc-dev boost-dev`
- `git clone --recursive https://github.com/kost/nheqminer.git`
- `cd nheqminer/nheqminer`
- `mkdir build`
- `cd build`
- `cmake -DNONINTEL=1 -DSTATIC_BUILD=1 ..`
- `make`

## Windows (Microsoft Visual Studio - needs tweaking):
Windows builds made by us are available here: https://github.com/kost/nheqminer/releases

Download and install:
- Visual Studio 2013 Community: https://www.visualstudio.com/en-us/news/releasenotes/vs2013-community-vs
- Visual C++ Compiler November 2013 CTP: https://www.microsoft.com/en-us/download/details.aspx?id=41151

Open **nheqminer.sln** under **nheqminer/nheqminer.sln** and build.

## Release builds

Linux on Alpine 3.4:
```
cmake -DXENON=1 -DSTATIC_BUILD=1 -DMARCH="-m64" ..
```

Mac OS X:
```
cmake -DXENON=1 -DSTATIC_BUILD=1 -DMARCH="-m64" ..
```

Windows (on Fedora 23 with MingW) (Docker: fedora:23):
```
cmake -DXENON=1 -DSTATIC_BUILD=1 -DMARCH="-m64" -DCMAKE_TOOLCHAIN_FILE=../toolchain-mingw64.cmake ..
```

Linux on Raspberry PI (Docker: kaffepanna/alpine-armv7-qemu):
```
Host: apt-get install qemu qemu-user-static binfmt-support
cmake -DNONINTEL=1 -DSTATIC_BUILD=1 -DMARCH="-Wall" ..
```


# Run instructions:

If run without parameters, miner will start mining with 75% of available virtual cores on NiceHash. Use parameter -h to learn about available parameters:
If run without parameters, miner will start mining with 75% of available virtual cores on flypool with developers account using best engine. Feel free to donate that way. Use parameter -h to learn about available parameters:

```
Parameters:
-h Print this help and quit
-l [location] Location (eu, usa, hk, jp)
-u [username] Username (bitcoinaddress)
-l [location] Stratum server:port
-u [username] Username (pool worker)
-x [enginenum] Engine (-1=auto,0=tromp,1=AVX1,2=AVX2)
-p [password] Password (default: x)
-t [num_thrds] Number of threads (default: number of sys cores)
-d [level] Debug print level (0 = print all, 5 = fatal only, default: 2)
-b [hashes] Run in benchmark mode (default: 100 hashes)
-a [port] Local API port (default: 0 = do not bind)

```

Example to run benchmark:

nheqminer_x64_AVX.exe -b
Expand All @@ -143,7 +215,25 @@ Example to mine with your own ZEC address and worker1 on EU server, using 6 thre

<i>Note: if you have a 4-core CPU with hyper threading enabled (total 8 threads) it is best to run with only 6 threads (experimental benchmarks shows that best results are achieved with 75% threads utilized)</i>




# Acknowledgments and credits

## Acknowledgements

This miner is based on Equihash Miner for NiceHash
Thanks to Zcash developers for providing most of the code
Special thanks to tromp for providing optimized CPU equihash solver
Special thanks to xenoncat for providing assembly optimized CPU equihash solver
Special thanks to [Zcash Community on Slack](https://zcashcommunity.slack.com)

## Credits

Author of this miner: Kost

## Donations

If you feel this project is useful to you. Feel free to donate.

BTC address: 1KHRiwNdFiL4uFUGFEpbG7t2F3pUcttLuX
Expand Down
Loading