Skip to content

Commit

Permalink
v3.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
JayDDee committed Nov 21, 2017
1 parent ab39e88 commit 6d1361c
Show file tree
Hide file tree
Showing 46 changed files with 6,312 additions and 139 deletions.
34 changes: 23 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,31 @@
# ex: docker run -it --rm cpuminer-opt:latest -a cryptonight -o cryptonight.eu.nicehash.com:3355 -u 1MiningDW2GKzf4VQfmp4q2XoUvR6iy6PD.worker1 -p x -t 3
#

FROM ubuntu:16.04
RUN BUILD_DEPS="build-essential \
libssl-dev \
libgmp-dev \
libcurl4-openssl-dev \
libjansson-dev \
automake" && \
# Build
FROM ubuntu:16.04 as builder

apt-get update && \
apt-get install -y ${BUILD_DEPS}
RUN apt-get update \
&& apt-get install -y \
build-essential \
libssl-dev \
libgmp-dev \
libcurl4-openssl-dev \
libjansson-dev \
automake \
&& rm -rf /var/lib/apt/lists/*

COPY . /app/
RUN cd /app/ && ./build.sh
RUN cd /app/ && ./build.sh

# App
FROM ubuntu:16.04

RUN apt-get update \
&& apt-get install -y \
libcurl3 \
libjansson4 \
&& rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["/app/cpuminer"]
COPY --from=builder /app/cpuminer .
ENTRYPOINT ["./cpuminer"]
CMD ["-h"]
27 changes: 20 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,18 @@ cpuminer_SOURCES = \
sysinfos.c \
algo-gate-api.c\
algo/groestl/sph_groestl.c \
algo/skein/sph_skein.c \
algo/bmw/sph_bmw.c \
algo/shavite/sph_shavite.c \
algo/shavite/shavite.c \
algo/echo/sph_echo.c \
algo/blake/sph_blake.c \
algo/blake/sph_blake2b.c \
algo/heavy/sph_hefty1.c \
algo/blake/mod_blakecoin.c \
algo/luffa/sph_luffa.c \
algo/cubehash/sph_cubehash.c \
algo/simd/sph_simd.c \
algo/hamsi/sph_hamsi.c \
algo/fugue/sph_fugue.c \
algo/gost/sph_gost.c \
algo/jh/sph_jh.c \
algo/keccak/sph_keccak.c \
algo/keccak/keccak.c\
algo/sha/sph_sha2.c \
algo/sha/sph_sha2big.c \
algo/shabal/sph_shabal.c \
Expand All @@ -63,9 +57,15 @@ cpuminer_SOURCES = \
algo/argon2/ar2/ar2-scrypt-jane.c \
algo/argon2/ar2/blake2b.c \
algo/axiom.c \
algo/blake/sph_blake.c \
algo/blake/blake-hash-4way.c \
algo/blake/blake-gate.c \
algo/blake/blake.c \
algo/blake/blake-4way.c \
algo/blake/sph_blake2b.c \
algo/blake/blake2b.c \
algo/blake/blake2s.c \
algo/blake/mod_blakecoin.c \
algo/blake/blakecoin.c \
algo/blake/decred.c \
algo/blake/pentablake.c \
Expand All @@ -92,6 +92,12 @@ cpuminer_SOURCES = \
algo/hodl/sha512_avx.c \
algo/hodl/sha512_avx2.c \
algo/jh/jha.c \
algo/keccak/sph_keccak.c \
algo/keccak/keccak.c\
algo/keccak/keccak-hash-4way.c \
algo/keccak/keccak-4way.c\
algo/keccak/keccak-gate.c \
algo/keccak/sse2/keccak.c \
algo/lbry.c \
algo/luffa/luffa.c \
algo/luffa/sse2/luffa_for_sse2.c \
Expand All @@ -101,11 +107,12 @@ cpuminer_SOURCES = \
algo/lyra2/lyra2re.c \
algo/lyra2/zcoin.c \
algo/lyra2/lyra2z330.c \
algo/keccak/sse2/keccak.c \
algo/m7m.c \
algo/neoscrypt.c \
algo/nist5.c \
algo/pluck.c \
algo/polytimos/polytimos-gate.c \
algo/polytimos/polytimos.c \
algo/quark/quark.c \
algo/qubit/qubit.c \
algo/qubit/deep.c \
Expand All @@ -116,8 +123,14 @@ cpuminer_SOURCES = \
algo/sha/sha256t.c \
algo/simd/sse2/nist.c \
algo/simd/sse2/vector.c \
algo/skein/sph_skein.c \
algo/skein/skein-hash-4way.c \
algo/skein/skein.c \
algo/skein/skein-4way.c \
algo/skein/skein-gate.c \
algo/skein/skein2.c \
algo/skein/skein2-4way.c \
algo/skein/skein2-gate.c \
algo/skunk.c \
algo/tiger/sph_tiger.c \
algo/timetravel.c \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Supported Algorithms
pentablake Pentablake
phi1612 phi, LUX coin
pluck Pluck:128 (Supcoin)
polytimos
quark Quark
qubit Qubit
scrypt scrypt(1024, 1, 1) (default)
Expand Down
6 changes: 5 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ optimum speed using all the available features.

Architecture names and compile options used are only provided for Intel
Core series. Pentium and Celeron often have fewer features.
AMD is YMMV, see previous paragraph.

AMD CPUs older than Piledriver, including Athlon x2 and Phenom II x4, are not
supported by cpuminer-opt due to an incompatible implementation of SSE2 on
these CPUs. Some algos may crash the miner with an invalid instruction.
Users are recommended to use an unoptimized miner such as cpuminer-multi.

Exe name Compile opts Arch name

Expand Down
25 changes: 25 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ Run ./build.sh to build on Linux or execute the following commands.
CFLAGS="-O3 -march=native -Wall" CXXFLAGS="$CFLAGS -std=gnu++11" ./configure --with-curl
make

Additional optional compile flags, add the following to CFLAGS to activate:

-DUSE_SPH_SHA

SPH may give slightly better performance on algos that use sha256 when using
openssl 1.0.1 or older. Openssl 1.0.2 adds AVX2 and 1.1 adds SHA and perform
better than SPH.

-DFOUR_WAY

4 way will give much better performance on supported algos with CPUs
that have AVX2 and should only be used on CPUs with AVX2. 4 way algo
support will be added incrementally, see change log below for supported algos.

Start mining.

./cpuminer -a algo -o url -u username -p password
Expand Down Expand Up @@ -140,6 +154,17 @@ Support for even older x86_64 without AES_NI or SSE2 is not availble.
Change Log
----------

v3.7.3

Added polytimos algo.

Introducing 4-way AVX2 optimization giving up to 4x performance inprovement
on many compute bound algos. First supported algos: skein, skein2, blake &
keccak. This feature is only available when compiled from source. See above
for instcuctions how to enable 4-way during compilation.

Updated Dockerfile.

v3.7.2

Fixed yescryptr16
Expand Down
1 change: 1 addition & 0 deletions algo-gate-api.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ bool register_algo_gate( int algo, algo_gate_t *gate )
case ALGO_PENTABLAKE: register_pentablake_algo ( gate ); break;
case ALGO_PHI1612: register_phi1612_algo ( gate ); break;
case ALGO_PLUCK: register_pluck_algo ( gate ); break;
case ALGO_POLYTIMOS: register_polytimos_algo ( gate ); break;
case ALGO_QUARK: register_quark_algo ( gate ); break;
case ALGO_QUBIT: register_qubit_algo ( gate ); break;
case ALGO_SCRYPT: register_scrypt_algo ( gate ); break;
Expand Down
115 changes: 115 additions & 0 deletions algo/blake/blake-4way.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#include "algo-gate-api.h"
#include "sph_blake.h"
#include "blake-hash-4way.h"
#include <string.h>
#include <stdint.h>
#include <memory.h>

#if defined (__AVX__)

void blakehash_4way(void *state, const void *input)
{
uint32_t hash0[16] __attribute__ ((aligned (64)));
uint32_t hash1[16] __attribute__ ((aligned (64)));
uint32_t hash2[16] __attribute__ ((aligned (64)));
uint32_t hash3[16] __attribute__ ((aligned (64)));
uint32_t vhash[16*4] __attribute__ ((aligned (64)));
blake256_4way_context ctx;

blake256_4way_init( &ctx );
blake256_4way( &ctx, input, 16 );
blake256_4way_close( &ctx, vhash );

m128_deinterleave_4x32( hash0, hash1, hash2, hash3, vhash, 512 );

memcpy( state, hash0, 32 );
memcpy( state+32, hash1, 32 );
memcpy( state+64, hash1, 32 );
memcpy( state+96, hash1, 32 );
}

int scanhash_blake_4way( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done )
{
uint32_t vdata[20*4] __attribute__ ((aligned (64)));
uint32_t hash[4*8] __attribute__ ((aligned (64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
const uint32_t first_nonce = pdata[19];
// uint32_t HTarget = ptarget[7];
uint32_t _ALIGN(32) endiandata[20];
uint32_t n = first_nonce;
uint32_t *nonces = work->nonces;
bool *found = work->nfound;
int num_found;

// if (opt_benchmark)
// HTarget = 0x7f;

// we need big endian data...
swab32_array( endiandata, pdata, 20 );

m128_interleave_4x32( vdata, endiandata, endiandata, endiandata,
endiandata, 640 );

uint32_t *noncep = vdata + 76; // 19*4
do {
found[0] = found[1] = found[2] = found[3] = false;
num_found = 0;
be32enc( noncep, n );
be32enc( noncep +2, n+1 );
be32enc( noncep +4, n+2 );
be32enc( noncep +6, n+3 );

blakehash_4way( hash, vdata );

if ( hash[7] == 0 )
{
if ( fulltest( hash, ptarget ) )
{
found[0] = true;
num_found++;
nonces[0] = n;
pdata[19] = n;
}
}
if ( (hash+8)[7] == 0 )
{
if ( fulltest( hash, ptarget ) )
{
found[1] = true;
num_found++;
nonces[1] = n+1;
}
}
if ( (hash+16)[7] == 0 )
{
if ( fulltest( hash, ptarget ) )
{
found[2] = true;
num_found++;
nonces[2] = n+2;
}
}
if ( (hash+24)[7] == 0 )
{
if ( fulltest( hash, ptarget ) )
{
found[3] = true;
num_found++;
nonces[3] = n+3;
}
}

n += 4;
*hashes_done = n - first_nonce + 1;

} while ( (num_found == 0) && (n < max_nonce)
&& !work_restart[thr_id].restart );

*hashes_done = n - first_nonce + 1;
return num_found;
}

#endif

26 changes: 26 additions & 0 deletions algo/blake/blake-gate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "blake-gate.h"

int64_t blake_get_max64 ()
{
return 0x7ffffLL;
}

bool register_blake_algo( algo_gate_t* gate )
{
gate->get_max64 = (void*)&blake_get_max64;
#if defined (__AVX2__) && defined (FOUR_WAY)
// gate->optimizations = SSE2_OPT | AVX_OPT | AVX2_OPT;
// gate->scanhash = (void*)&scanhash_blake_8way;
// gate->hash = (void*)&blakehash_8way;
#elif defined(__AVX__) && defined (FOUR_WAY)
gate->optimizations = SSE2_OPT | AVX_OPT;
gate->scanhash = (void*)&scanhash_blake_4way;
gate->hash = (void*)&blakehash_4way;
#else
gate->optimizations = SSE2_OPT;
gate->scanhash = (void*)&scanhash_blake;
gate->hash = (void*)&blakehash;
#endif
return true;
}

23 changes: 23 additions & 0 deletions algo/blake/blake-gate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef __BLAKE_GATE_H__
#define __BLAKE_GATE_H__

#include "algo-gate-api.h"
#include <stdint.h>

#if defined (__AVX2__)
//void blakehash_84way(void *state, const void *input);
//int scanhash_blake_8way( int thr_id, struct work *work, uint32_t max_nonce,
// uint64_t *hashes_done );
#endif

#if defined (__AVX__)
void blakehash_4way(void *state, const void *input);
int scanhash_blake_4way( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done );
#endif

void blakehash( void *state, const void *input );
int scanhash_blake( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done );

#endif
Loading

0 comments on commit 6d1361c

Please sign in to comment.