Skip to content

Commit

Permalink
2017-10-10--UPSTREAM: merge changes as of Oct 10, 2017
Browse files Browse the repository at this point in the history
  • Loading branch information
nimbosa committed Nov 1, 2017
2 parents 8affcb9 + 6c7fa7c commit 2b081c0
Show file tree
Hide file tree
Showing 35 changed files with 2,400 additions and 341 deletions.
174 changes: 97 additions & 77 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,77 +1,97 @@

You can use ./build.sh to configure and build with default options.

It is advised to run ./autogen.sh before ./configure (autoconf and automake
need to be installed on your system for autogen.sh to work)

./configure has an option named --with-cuda that allows you to specify
where your CUDA 6.5 toolkit is installed (usually /usr/local/cuda,
but some distros may have a different default location)


** How to compile on Fedora 25 **

Note: You may find an alternative method via rpms :
see https://negativo17.org/nvidia-driver/ and https://negativo17.org/repos/multimedia/


# Step 1: gcc and dependencies
dnf install gcc gcc-c++ autoconf automake
dnf install jansson-devel openssl-devel libcurl-devel zlib-devel

# Step 2: nvidia drivers (Download common linux drivers from nvidia site)
dnf install kernel-devel
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf check-update
dnf install xorg-x11-drv-nvidia-cuda kmod-nvidia
ln -s libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so

# Step 3: CUDA SDK (Download from nvidia the generic ".run" archive)
# --override is required to ignore "too recent" gcc 6.3
# --silent is required to install only the toolkit (no kmod)
./cuda_8.0.61_375.26_linux.run --toolkit --silent --override
nvcc --version

# add the nvcc binary path to the system
ln -s /usr/local/cuda-8.0 /usr/local/cuda # (if not already made)
echo 'export PATH=$PATH:/usr/local/cuda/bin' > /etc/profile.d/cuda.sh

# add the cudart library path to the system
echo /usr/local/cuda/lib64 > /etc/ld.so.conf.d/cuda.conf
ldconfig

# Step 4: Fix the toolkit incompatibility with gcc 6

# You need to build yourself an older GCC/G++ version, i recommend the 5.4
# see https://gcc.gnu.org/mirrors.html
# Note: this manual method will override the default gcc, it could be better to use a custom toolchain prefix

wget ftp://ftp.lip6.fr/pub/gcc/releases/gcc-5.4.0/gcc-5.4.0.tar.bz2
dnf install libmpc-devel mpfr-devel gmp-devel
./configure --prefix=/usr/local --enable-languages=c,c++,lto --disable-multilib
make -j 8 && make install
(while this step, you have the time to cook something :p)

# or, for previous fedora versions, edit the file /usr/local/cuda/include/host_config.h
# and comment/delete the line 121 : #error -- unsupported GNU version! gcc versions later than 5 are not supported!

./build.sh

./ccminer -n


** How to compile on macOS **

# Step 1: download and install CUDA Toolkit 8 or more recent
# https://developer.nvidia.com/cuda-toolkit-archive

# Step 2: install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Step 3: dependencies
brew install pkg-config autoconf automake curl openssl llvm

./build.sh

./ccminer -n


You can use ./build.sh to configure and build with default options.

It is advised to run ./autogen.sh before ./configure (autoconf and automake
need to be installed on your system for autogen.sh to work)

./configure has an option named --with-cuda that allows you to specify
where your CUDA 6.5 toolkit is installed (usually /usr/local/cuda,
but some distros may have a different default location)


** How to compile on Ubuntu (16.04 LTS)

First, install Cuda toolkit and nVidia Driver, and type `nvidia-smi` to check if your card is detected.

Install dependencies
```sudo apt-get install libcurl4-openssl-dev libssl-dev libjansson-dev automake autotools-dev build-essential```

Ubuntu is now shipped with gcc 6 or 7 so please install gcc/g++ 5 and make it the default (required by the cuda toolkit)
```
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1
```

Then use the helper ./build.sh in ccminer source folder, edit configure.sh and the Makefile.am if required.
```
./build.sh
./ccminer --version
```


** How to compile on Fedora 25 **

Note: You may find an alternative method via rpms :
see https://negativo17.org/nvidia-driver/ and https://negativo17.org/repos/multimedia/


# Step 1: gcc and dependencies
dnf install gcc gcc-c++ autoconf automake
dnf install jansson-devel openssl-devel libcurl-devel zlib-devel

# Step 2: nvidia drivers (Download common linux drivers from nvidia site)
dnf install kernel-devel
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf check-update
dnf install xorg-x11-drv-nvidia-cuda kmod-nvidia
ln -s libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so

# Step 3: CUDA SDK (Download from nvidia the generic ".run" archive)
# --override is required to ignore "too recent" gcc 6.3
# --silent is required to install only the toolkit (no kmod)
./cuda_8.0.61_375.26_linux.run --toolkit --silent --override
nvcc --version

# add the nvcc binary path to the system
ln -s /usr/local/cuda-8.0 /usr/local/cuda # (if not already made)
echo 'export PATH=$PATH:/usr/local/cuda/bin' > /etc/profile.d/cuda.sh

# add the cudart library path to the system
echo /usr/local/cuda/lib64 > /etc/ld.so.conf.d/cuda.conf
ldconfig

# Step 4: Fix the toolkit incompatibility with gcc 6

# You need to build yourself an older GCC/G++ version, i recommend the 5.4
# see https://gcc.gnu.org/mirrors.html
# Note: this manual method will override the default gcc, it could be better to use a custom toolchain prefix

wget ftp://ftp.lip6.fr/pub/gcc/releases/gcc-5.4.0/gcc-5.4.0.tar.bz2
dnf install libmpc-devel mpfr-devel gmp-devel
./configure --prefix=/usr/local --enable-languages=c,c++,lto --disable-multilib
make -j 8 && make install
(while this step, you have the time to cook something :p)

# or, for previous fedora versions, edit the file /usr/local/cuda/include/host_config.h
# and comment/delete the line 121 : #error -- unsupported GNU version! gcc versions later than 5 are not supported!

./build.sh

./ccminer -n


** How to compile on macOS **

# Step 1: download and install CUDA Toolkit 8 or more recent
# https://developer.nvidia.com/cuda-toolkit-archive

# Step 2: install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Step 3: dependencies
brew install pkg-config autoconf automake curl openssl llvm

./build.sh

./ccminer -n

3 changes: 3 additions & 0 deletions JHA/jha.cu
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ extern "C" int scanhash_jha(int thr_id, struct work *work, uint32_t max_nonce, u
CUDA_LOG_ERROR();
}
cuda_get_arch(thr_id);
if (cuda_arch[dev_id] >= 500) {
applog(LOG_WARNING, "You are not using the optimal algo, please try -a jackpot");
}
gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput);

CUDA_SAFE_CALL(cudaMalloc(&d_hash[thr_id], (size_t) 64 * throughput));
Expand Down
4 changes: 3 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ ccminer_SOURCES = elist.h miner.h compat.h \
sph/ripemd.c sph/sph_sha2.c \
lbry/lbry.cu lbry/cuda_sha256_lbry.cu lbry/cuda_sha512_lbry.cu lbry/cuda_lbry_merged.cu \
qubit/qubit.cu qubit/qubit_luffa512.cu qubit/deep.cu qubit/luffa.cu \
tribus.cu \
tribus/tribus.cu tribus/cuda_echo512_final.cu \
x11/x11.cu x11/fresh.cu x11/cuda_x11_luffa512.cu x11/cuda_x11_cubehash512.cu \
x11/cuda_x11_shavite512.cu x11/cuda_x11_simd512.cu x11/cuda_x11_echo.cu \
x11/cuda_x11_luffa512_Cubehash.cu x11/x11evo.cu x11/timetravel.cu x11/bitcore.cu \
x13/x13.cu x13/cuda_x13_hamsi512.cu x13/cuda_x13_fugue512.cu \
x13/hsr.cu x13/cuda_hsr_sm3.cu x13/sm3.c \
x15/x14.cu x15/x15.cu x15/cuda_x14_shabal512.cu x15/cuda_x15_whirlpool.cu \
x15/whirlpool.cu x15/cuda_x15_whirlpool_sm3.cu \
x17/x17.cu x17/hmq17.cu x17/cuda_x17_haval256.cu x17/cuda_x17_sha512.cu \
x11/phi.cu x11/cuda_streebog_maxwell.cu \
x11/c11.cu x11/s3.cu x11/sib.cu x11/veltor.cu x11/cuda_streebog.cu

# scrypt
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ccminer
=======
# ccminer

Based on Christian Buchner's & Christian H.'s CUDA project, no more active on github since 2014.

Expand All @@ -10,7 +9,7 @@ BTC donation address: 1AJdfCpLWPNoAMDfHF1wD5y8VgKSSTHxPo (tpruvot)
A part of the recent algos were originally written by [djm34](https://github.com/djm34) and [alexis78](https://github.com/alexis78)

This variant was tested and built on Linux (ubuntu server 14.04, 16.04, Fedora 22 to 25)
It is also built for Windows 7 to 10 with VStudio 2013, to stay compatible with Windows Vista.
It is also built for Windows 7 to 10 with VStudio 2013, to stay compatible with Windows 7 and Vista.

Note that the x86 releases are generally faster than x64 ones on Windows, but that tend to change with the recent drivers.

Expand All @@ -22,15 +21,16 @@ About source code dependencies
This project requires some libraries to be built :

- OpenSSL (prebuilt for win)

- Curl (prebuilt for win)

- pthreads (prebuilt for win)

The tree now contains recent prebuilt openssl and curl .lib for both x86 and x64 platforms (windows).

To rebuild them, you need to clone this repository and its submodules :
git clone https://github.com/peters/curl-for-windows.git compat/curl-for-windows

On Linux, you can use the helper ./build.sh (edit configure.sh and the Makefile.am if required)

Compile on Linux
----------------

Please see [INSTALL](https://github.com/tpruvot/ccminer/blob/linux/INSTALL) file or [project Wiki](https://github.com/tpruvot/ccminer/wiki/Compatibility)
17 changes: 15 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

ccminer 2.2 (August 2017) "Equihash, tribus and optimized skunk"
ccminer 2.2.2 (Oct. 2017) "phi and hsr algos"
---------------------------------------------------------------

***************************************************************
Expand Down Expand Up @@ -90,7 +90,8 @@ its command line interface and options.
fugue256 use to mine Fuguecoin
groestl use to mine Groestlcoin
heavy use to mine Heavycoin
jha use to mine JackpotCoin
hsr use to mine Hshare
jackpot use to mine Sweepcoin
keccak use to mine Maxcoin
lbry use to mine LBRY Credits
luffa use to mine Joincoin
Expand All @@ -102,6 +103,7 @@ its command line interface and options.
neoscrypt use to mine FeatherCoin
nist5 use to mine TalkCoin
penta use to mine Joincoin / Pentablake
phi use to mine LUXCoin
quark use to mine Quarkcoin
qubit use to mine Qubit
scrypt use to mine Scrypt coins
Expand Down Expand Up @@ -155,6 +157,7 @@ its command line interface and options.
-T, --timeout=N network timeout, in seconds (default: 300)
-s, --scantime=N upper bound on time spent scanning current work when
long polling is unavailable, in seconds (default: 5)
--submit-stale ignore stale job checks, may create more rejected shares
-n, --ndevs list cuda devices
-N, --statsavg number of samples used to display hashrate (default: 30)
--no-gbt disable getblocktemplate support (height check in solo)
Expand Down Expand Up @@ -277,6 +280,16 @@ so we can more efficiently implement new algorithms using the latest hardware
features.

>>> RELEASE HISTORY <<<
Oct. 09th 2017 v2.2.2
Import and clean the hsr algo (x13 + custom hash)
Import and optimise phi algo from LuxCoin repository
Improve sib algo too for maxwell and pascal cards
Small fix to handle more than 9 cards on linux (-d 10+)
Attempt to free equihash memory "properly"
--submit-stale parameter for supernova pool (which change diff too fast)

Sep. 01st 2017 v2.2.1
Improve tribus algo on recent cards (up to +10%)

Aug. 13th 2017 v2.2
New skunk algo, using the heavy streebog algorithm
Expand Down
8 changes: 8 additions & 0 deletions algos.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum sha_algos {
ALGO_GROESTL,
ALGO_HEAVY, /* Heavycoin hash */
ALGO_HMQ1725,
ALGO_HSR,
ALGO_KECCAK,
ALGO_JACKPOT,
ALGO_JHA,
Expand All @@ -35,6 +36,7 @@ enum sha_algos {
ALGO_NEOSCRYPT,
ALGO_NIST5,
ALGO_PENTABLAKE,
ALGO_PHI,
ALGO_QUARK,
ALGO_QUBIT,
ALGO_SCRYPT,
Expand Down Expand Up @@ -87,6 +89,7 @@ static const char *algo_names[] = {
"groestl",
"heavy",
"hmq1725",
"hsr",
"keccak",
"jackpot",
"jha",
Expand All @@ -100,6 +103,7 @@ static const char *algo_names[] = {
"neoscrypt",
"nist5",
"penta",
"phi",
"quark",
"qubit",
"scrypt",
Expand Down Expand Up @@ -161,12 +165,16 @@ static inline int algo_to_int(char* arg)
i = ALGO_LUFFA;
else if (!strcasecmp("hmq17", arg))
i = ALGO_HMQ1725;
else if (!strcasecmp("hshare", arg))
i = ALGO_HSR;
//else if (!strcasecmp("jackpot", arg))
// i = ALGO_JHA;
else if (!strcasecmp("lyra2re", arg))
i = ALGO_LYRA2;
else if (!strcasecmp("lyra2rev2", arg))
i = ALGO_LYRA2v2;
else if (!strcasecmp("phi1612", arg))
i = ALGO_PHI;
else if (!strcasecmp("bitcoin", arg))
i = ALGO_SHA256D;
else if (!strcasecmp("sha256", arg))
Expand Down
3 changes: 3 additions & 0 deletions bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ void algo_free_all(int thr_id)
free_cryptonight(thr_id);
free_decred(thr_id);
free_deep(thr_id);
free_equihash(thr_id);
free_keccak256(thr_id);
free_fresh(thr_id);
free_fugue256(thr_id);
free_groestlcoin(thr_id);
free_heavy(thr_id);
free_hmq17(thr_id);
free_hsr(thr_id);
free_jackpot(thr_id);
free_jha(thr_id);
free_lbry(thr_id);
Expand All @@ -76,6 +78,7 @@ void algo_free_all(int thr_id)
free_neoscrypt(thr_id);
free_nist5(thr_id);
free_pentablake(thr_id);
free_phi(thr_id);
free_quark(thr_id);
free_qubit(thr_id);
free_skeincoin(thr_id);
Expand Down
Loading

0 comments on commit 2b081c0

Please sign in to comment.