Skip to content

Commit c0ab173

Browse files
authored
Merge pull request #1610 from fireice-uk/dev
release 2.4.4
2 parents 26a5d65 + 4f34bd1 commit c0ab173

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1436
-1079
lines changed

CMakeLists.txt

+10-13
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,14 @@ if(CUDA_ENABLE)
141141
# set flags to create device code for the given architectures
142142
set(CLANG_BUILD_FLAGS "${CLANG_BUILD_FLAGS} --cuda-gpu-arch=sm_${CUDA_ARCH_ELEM}")
143143
endforeach()
144-
145144
elseif(CUDA_COMPILER STREQUAL "nvcc")
146145
# add c++11 for cuda
147146
if(NOT CMAKE_CXX_FLAGS MATCHES "-std=c\\+\\+11")
148147
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")
149148
endif()
150149

151150
# avoid that nvcc in CUDA 8 complains about sm_20 pending removal
152-
if(CUDA_VERSION VERSION_EQUAL 8.0)
151+
if(CUDA_VERSION VERSION_EQUAL 8.0)
153152
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Wno-deprecated-gpu-targets")
154153
endif()
155154

@@ -180,14 +179,14 @@ if(CUDA_ENABLE)
180179
if(CUDA_KEEP_FILES)
181180
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" --keep --keep-dir "${PROJECT_BINARY_DIR}")
182181
endif(CUDA_KEEP_FILES)
183-
182+
184183
if(CUDA_VERSION VERSION_LESS 8.0)
185184
# for CUDA 7.5 fix compile error: https://github.com/fireice-uk/xmr-stak/issues/34
186185
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "-D_MWAITXINTRIN_H_INCLUDED")
187186
endif()
188187

189188
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND
190-
(CUDA_VERSION VERSION_EQUAL 9.0 OR CUDA_VERSION VERSION_EQUAL 9.1)
189+
(CUDA_VERSION VERSION_EQUAL 9.0 OR CUDA_VERSION VERSION_EQUAL 9.1 OR CUDA_VERSION VERSION_EQUAL 9.2)
191190
)
192191
# workaround find_package(CUDA) is using the wrong path to the CXX host compiler
193192
# overwrite the CUDA host compiler variable with the used CXX MSVC
@@ -232,7 +231,7 @@ if(OpenCL_ENABLE)
232231
"AMD APP/include")
233232

234233
find_library(OpenCL_LIBRARY
235-
NAMES
234+
NAMES
236235
OpenCL
237236
OpenCL.lib
238237
NO_DEFAULT_PATH
@@ -284,7 +283,7 @@ endif()
284283
# Find microhttpd
285284
################################################################################
286285

287-
option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http deamon)" ON)
286+
option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http daemon)" ON)
288287
if(MICROHTTPD_ENABLE)
289288
find_path(MTHD_INCLUDE_DIR
290289
NAMES
@@ -307,7 +306,7 @@ if(MICROHTTPD_ENABLE)
307306
PATH_SUFFIXES
308307
lib)
309308
if(MHTD STREQUAL "MHTD-NOTFOUND")
310-
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support")
309+
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http daemon support")
311310
else()
312311
set(LIBS ${LIBS} ${MHTD})
313312
include_directories(AFTER ${MTHD_INCLUDE_DIR})
@@ -399,10 +398,10 @@ execute_process(
399398
)
400399

401400
if(NOT GIT_COMMIT_HASH STREQUAL "")
402-
add_definitions("-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}")
401+
add_definitions("-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}")
403402
endif()
404403
if(NOT GIT_BRANCH STREQUAL "")
405-
add_definitions("-DGIT_BRANCH=${GIT_BRANCH}")
404+
add_definitions("-DGIT_BRANCH=${GIT_BRANCH}")
406405
endif()
407406

408407
# generate backend string
@@ -426,7 +425,6 @@ else()
426425
# activate sse2 and aes-ni
427426
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -maes")
428427
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -maes")
429-
430428
endif()
431429

432430
# add -Wall for debug builds with gcc
@@ -478,7 +476,7 @@ target_link_libraries(xmr-stak-backend xmr-stak-c ${CMAKE_DL_LIBS})
478476

479477
# compile CUDA backend
480478
if(CUDA_FOUND)
481-
file(GLOB CUDASRCFILES
479+
file(GLOB CUDASRCFILES
482480
"xmrstak/backend/nvidia/nvcc_code/*.cu"
483481
"xmrstak/backend/nvidia/*.cpp")
484482

@@ -506,7 +504,7 @@ endif()
506504

507505
# compile AMD backend
508506
if(OpenCL_FOUND)
509-
file(GLOB OPENCLSRCFILES
507+
file(GLOB OPENCLSRCFILES
510508
"xmrstak/backend/amd/amd_gpu/*.cpp"
511509
"xmrstak/backend/amd/*.cpp")
512510
add_library(xmrstak_opencl_backend
@@ -536,7 +534,6 @@ target_link_libraries(xmr-stak ${LIBS} xmr-stak-c xmr-stak-backend)
536534
# Install
537535
################################################################################
538536

539-
540537
# do not install the binary if the project and install are equal
541538
if( NOT CMAKE_INSTALL_PREFIX STREQUAL PROJECT_BINARY_DIR )
542539
install(TARGETS xmr-stak

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
###### fireice-uk's and psychocrypt's
22
# XMR-Stak - Monero/Aeon All-in-One Mining Software
33

4-
**XMR-Stak is ready for the POW change of Monero-v7, Aeon-v7 and Sumukoin-v3**
4+
**XMR-Stak is ready for the POW change of Monero-v7, Aeon-v7, stellite-v4 and Sumukoin-v3**
55

66
XMR-Stak is a universal Stratum pool miner. This miner supports CPUs, AMD and NVIDIA gpus and can be used to mine the crypto currency Monero and Aeon.
77

@@ -48,8 +48,11 @@ Besides [Monero](https://getmonero.org), following coins can be mined using this
4848
- [Graft](https://www.graft.network)
4949
- [Haven](https://havenprotocol.com)
5050
- [Intense](https://intensecoin.com)
51+
- [IPBC](https://ipbc.io)
5152
- [Karbo](https://karbo.io)
53+
- [Masari](https://getmasari.org)
5254
- [Sumokoin](https://www.sumokoin.org)
55+
- [TurtleCoin](https://turtlecoin.lol)
5356

5457
If your prefered coin is not listed, you can chose one of the following algorithms:
5558

THIRD-PARTY-LICENSES

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This application bundles the following third-party software in accordance with t
55
Package: Original NVidia mining code
66
Authors: tsiv and KlausT
77
License: GNU GPLv3
8-
Notes: Improvements are (c) of Xmr-Stak team
8+
Notes: Improvements are (c) of Xmr-Stak team and are covered by GNU GPLv3
99

1010
-------------------------------------------------------------------------
1111

@@ -27,3 +27,10 @@ Authors: okdshin
2727
License: MIT License
2828

2929
-------------------------------------------------------------------------
30+
31+
Package: cpputil
32+
Authors: Will Zhang
33+
Source: https://github.com/willzhang4a58/cpputil
34+
License: MIT License
35+
36+
-------------------------------------------------------------------------

doc/FAQ.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ Download and install this [runtime package](https://go.microsoft.com/fwlink/?Lin
4444

4545
## Error: MEMORY ALLOC FAILED: mmap failed
4646

47-
On Linux you will need to configure large page support and increase your ulimit -l.
47+
On Linux you will need to configure large page support and increase your ulimit -l.
4848

4949
To set large page support, add the following lines to /etc/sysctl.conf:
50-
50+
5151
vm.nr_hugepages=128
5252

5353
To increase the ulimit, add following lines to /etc/security/limits.conf:
5454

5555
* soft memlock 262144
5656
* hard memlock 262144
5757

58-
You WILL need to log out and log back in for these settings to take affect on your user (no need to reboot, just relogin in your session).
58+
You WILL need to log out and log back in for these settings to take effect on your user (no need to reboot, just relogin in your session).
5959

6060
You can also do it Windows-style and simply run-as-root, but this is NOT recommended for security reasons.
6161

doc/compile_FreeBSD.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
From the root shell, run the following commands:
88

9-
pkg install git libmicrohttpd hwloc cmake
9+
pkg install git libmicrohttpd hwloc cmake
1010

1111
Type 'y' and hit enter to proceed with installing the packages.
1212

doc/compile_Linux.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
### AMD APP SDK 3.0 (only needed to use AMD GPUs)
66

7-
- download and install the latest version from [http://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/](http://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/)
7+
- download and install the latest version from https://www.dropbox.com/sh/mpg882ekirnsfa7/AADWz5X-TgVdsmWt0QwMgTWLa/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2?dl=0
8+
(do not wonder why it is a link to a dropbox but AMD has removed the SDK downloads, see https://community.amd.com/thread/228059)
89

910
### Cuda 8.0+ (only needed to use NVIDIA GPUs)
1011

@@ -64,7 +65,7 @@
6465
cd xmr-stak/build
6566
cmake ..
6667
make install
67-
68+
6869
# TinyCore Linux 8.x
6970
# TinyCore is 32-bit only, but there is an x86-64 port, known as "Pure 64,"
7071
# hosted on the TinyCore home page, and it works well.
@@ -94,7 +95,7 @@
9495
make install
9596
```
9697

97-
- g++ version 5.1 or higher is required for full C++11 support.
98+
- g++ version 5.1 or higher is required for full C++11 support.
9899
If you want to compile the binary without installing libraries / compiler or just compile binary for some other distribution, please check the [build_xmr-stak_docker.sh script](scripts/build_xmr-stak_docker/build_xmr-stak_docker.sh).
99100

100101
- Some newer gcc versions are not supported by CUDA (e.g. Ubuntu 17.10). It will require installing gcc 5 but you can avoid changing defaults.

doc/compile_Windows.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- During install choose following components:
1414
- `Desktop development with C++` (left side)
1515
- `VC++ 2015.3 v140 toolset for desktop` (right side - **NOT** needed for CUDA 9 or AMD GPU)
16-
- Since release of VS2017 15.5 (12/04/17), require `VC++ 2017 version 15.4 v14.11 toolset` (under tab `Individual Components`, section `Compilers, build tools, and runtimes`), as CUDA 9.1 is not compatible with compiler 14.12.X
16+
- Since release of VS2017 15.5 (12/04/17), require `VC++ 2017 version 15.4 v14.11 toolset` (under tab `Individual Components`, section `Compilers, build tools, and runtimes`), as CUDA 9.x is not compatible with compiler 14.12.X
1717

1818
### CMake for Win64
1919

@@ -32,7 +32,8 @@
3232

3333
### AMD APP SDK 3.0 (only needed for AMD GPUs)
3434

35-
- Download and install the latest version from http://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/
35+
- Download and install the latest version from https://www.dropbox.com/s/gq8vqhelq0m6gj4/AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x64.exe
36+
(do not wonder why it is a link to a dropbox but AMD has removed the SDK downloads, see https://community.amd.com/thread/222855)
3637

3738
### Dependencies OpenSSL/Hwloc and Microhttpd
3839
- For CUDA 8*:
@@ -82,17 +83,17 @@
8283
- Go to extracted source code directory (e.g. `cd C:\Users\USERNAME\xmr-stak-<version>`)
8384
- Execute the following commands (NOTE: path to Visual Studio Community 2017 can be different)
8485
```
85-
# Execute next line only if compiling for Cuda 9.1 and using Visual Studio 2017 >= 15.5 (released 12/04/17)
86-
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11
87-
86+
# Execute next line only if compiling for Cuda 9.x and using Visual Studio 2017 >= 15.5 (released 12/04/17)
87+
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11
88+
8889
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"
8990
```
9091
- Sometimes Windows will change the directory to `C:\Users\USERNAME\source\` instead of `C:\Users\USERNAME\xmr-stak-<version>\`. If that's the case execute `cd C:\Users\USERNAME\xmr-stak-<version>` followed by:
9192
```
9293
mkdir build
93-
94+
9495
cd build
95-
96+
9697
set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl
9798
```
9899

@@ -104,9 +105,9 @@
104105
- Then execute
105106
```
106107
cmake --build . --config Release --target install
107-
108+
108109
cd bin\Release
109-
110+
110111
copy C:\xmr-stak-dep\openssl\bin\* .
111112
```
112113
- Miner is by default compiled for NVIDIA GPUs (if CUDA is installed), AMD GPUs (if the AMD APP SDK is installed) and CPUs.

doc/tuning.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ If you are unsure of either GPU or platform index value, you can use `clinfo` to
8282
```
8383
"gpu_threads_conf" :
8484
[
85-
{ "index" : 0, "intensity" : 1000, "worksize" : 8, "affine_to_cpu" : false,
85+
{ "index" : 0, "intensity" : 1000, "worksize" : 8, "affine_to_cpu" : false,
8686
"strided_index" : true, "mem_chunk" : 2, "comp_mode" : true
8787
},
88-
{ "index" : 1, "intensity" : 1000, "worksize" : 8, "affine_to_cpu" : false,
88+
{ "index" : 1, "intensity" : 1000, "worksize" : 8, "affine_to_cpu" : false,
8989
"strided_index" : true, "mem_chunk" : 2, "comp_mode" : true
9090
},
9191
],

xmrstak/backend/amd/amd_gpu/gpu.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <algorithm>
2727
#include <regex>
2828
#include <cassert>
29-
#include <algorithm>
29+
#include <algorithm>
3030

3131
#include <fstream>
3232
#include <sstream>
@@ -397,7 +397,7 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
397397
* used data:
398398
* - source code
399399
* - device name
400-
* - compile paramater
400+
* - compile parameter
401401
*/
402402
std::string src_str(source_code);
403403
src_str += options;
@@ -476,14 +476,14 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
476476
}
477477
while(status == CL_BUILD_IN_PROGRESS);
478478

479-
std::vector<size_t> binary_sizes(num_devices);
480-
clGetProgramInfo (ctx->Program[ii], CL_PROGRAM_BINARY_SIZES, sizeof(size_t) * binary_sizes.size(), binary_sizes.data(), NULL);
481-
482-
std::vector<char*> all_programs(num_devices);
483-
std::vector<std::vector<char>> program_storage;
484-
485479
if(xmrstak::params::inst().AMDCache)
486480
{
481+
std::vector<size_t> binary_sizes(num_devices);
482+
clGetProgramInfo (ctx->Program[ii], CL_PROGRAM_BINARY_SIZES, sizeof(size_t) * binary_sizes.size(), binary_sizes.data(), NULL);
483+
484+
std::vector<char*> all_programs(num_devices);
485+
std::vector<std::vector<char>> program_storage;
486+
487487
int p_id = 0;
488488
size_t mem_size = 0;
489489
// create memory structure to query all OpenCL program binaries
@@ -935,7 +935,7 @@ size_t InitOpenCL(GpuContext* ctx, size_t num_gpus, size_t platform_idx)
935935

936936
size_t XMRSetJob(GpuContext* ctx, uint8_t* input, size_t input_len, uint64_t target, xmrstak_algo miner_algo)
937937
{
938-
// switch to the kernel storage
938+
// switch to the kernel storage
939939
int kernel_storage = miner_algo == ::jconf::inst()->GetCurrentCoinSelection().GetDescription(1).GetMiningAlgo() ? 0 : 1;
940940

941941
cl_int ret;
@@ -1004,12 +1004,12 @@ size_t XMRSetJob(GpuContext* ctx, uint8_t* input, size_t input_len, uint64_t tar
10041004
return(ERR_OCL_API);
10051005
}
10061006

1007-
if(miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon )
1007+
if(miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon || miner_algo == cryptonight_ipbc || miner_algo == cryptonight_stellite)
10081008
{
10091009
// Input
10101010
if ((ret = clSetKernelArg(ctx->Kernels[kernel_storage][1], 3, sizeof(cl_mem), &ctx->InputBuffer)) != CL_SUCCESS)
10111011
{
1012-
printer::inst()->print_msg(L1, "Error %s when calling clSetKernelArg for kernel 1, arugment 4(input buffer).", err_to_str(ret));
1012+
printer::inst()->print_msg(L1, "Error %s when calling clSetKernelArg for kernel 1, argument 4(input buffer).", err_to_str(ret));
10131013
return ERR_OCL_API;
10141014
}
10151015
}
@@ -1102,7 +1102,7 @@ size_t XMRRunJob(GpuContext* ctx, cl_uint* HashOutput, xmrstak_algo miner_algo)
11021102
{
11031103
// switch to the kernel storage
11041104
int kernel_storage = miner_algo == ::jconf::inst()->GetCurrentCoinSelection().GetDescription(1).GetMiningAlgo() ? 0 : 1;
1105-
1105+
11061106
cl_int ret;
11071107
cl_uint zero = 0;
11081108
size_t BranchNonces[4];

0 commit comments

Comments
 (0)