Skip to content

Commit

Permalink
Merge pull request fireice-uk#1610 from fireice-uk/dev
Browse files Browse the repository at this point in the history
release 2.4.4
  • Loading branch information
fireice-uk authored May 30, 2018
2 parents 26a5d65 + 4f34bd1 commit c0ab173
Show file tree
Hide file tree
Showing 103 changed files with 1,436 additions and 1,079 deletions.
23 changes: 10 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,14 @@ if(CUDA_ENABLE)
# set flags to create device code for the given architectures
set(CLANG_BUILD_FLAGS "${CLANG_BUILD_FLAGS} --cuda-gpu-arch=sm_${CUDA_ARCH_ELEM}")
endforeach()

elseif(CUDA_COMPILER STREQUAL "nvcc")
# add c++11 for cuda
if(NOT CMAKE_CXX_FLAGS MATCHES "-std=c\\+\\+11")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")
endif()

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

Expand Down Expand Up @@ -180,14 +179,14 @@ if(CUDA_ENABLE)
if(CUDA_KEEP_FILES)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" --keep --keep-dir "${PROJECT_BINARY_DIR}")
endif(CUDA_KEEP_FILES)

if(CUDA_VERSION VERSION_LESS 8.0)
# for CUDA 7.5 fix compile error: https://github.com/fireice-uk/xmr-stak/issues/34
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}" "-D_MWAITXINTRIN_H_INCLUDED")
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND
(CUDA_VERSION VERSION_EQUAL 9.0 OR CUDA_VERSION VERSION_EQUAL 9.1)
(CUDA_VERSION VERSION_EQUAL 9.0 OR CUDA_VERSION VERSION_EQUAL 9.1 OR CUDA_VERSION VERSION_EQUAL 9.2)
)
# workaround find_package(CUDA) is using the wrong path to the CXX host compiler
# overwrite the CUDA host compiler variable with the used CXX MSVC
Expand Down Expand Up @@ -232,7 +231,7 @@ if(OpenCL_ENABLE)
"AMD APP/include")

find_library(OpenCL_LIBRARY
NAMES
NAMES
OpenCL
OpenCL.lib
NO_DEFAULT_PATH
Expand Down Expand Up @@ -284,7 +283,7 @@ endif()
# Find microhttpd
################################################################################

option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http deamon)" ON)
option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http daemon)" ON)
if(MICROHTTPD_ENABLE)
find_path(MTHD_INCLUDE_DIR
NAMES
Expand All @@ -307,7 +306,7 @@ if(MICROHTTPD_ENABLE)
PATH_SUFFIXES
lib)
if(MHTD STREQUAL "MHTD-NOTFOUND")
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support")
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http daemon support")
else()
set(LIBS ${LIBS} ${MHTD})
include_directories(AFTER ${MTHD_INCLUDE_DIR})
Expand Down Expand Up @@ -399,10 +398,10 @@ execute_process(
)

if(NOT GIT_COMMIT_HASH STREQUAL "")
add_definitions("-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}")
add_definitions("-DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}")
endif()
if(NOT GIT_BRANCH STREQUAL "")
add_definitions("-DGIT_BRANCH=${GIT_BRANCH}")
add_definitions("-DGIT_BRANCH=${GIT_BRANCH}")
endif()

# generate backend string
Expand All @@ -426,7 +425,6 @@ else()
# activate sse2 and aes-ni
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -maes")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -maes")

endif()

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

# compile CUDA backend
if(CUDA_FOUND)
file(GLOB CUDASRCFILES
file(GLOB CUDASRCFILES
"xmrstak/backend/nvidia/nvcc_code/*.cu"
"xmrstak/backend/nvidia/*.cpp")

Expand Down Expand Up @@ -506,7 +504,7 @@ endif()

# compile AMD backend
if(OpenCL_FOUND)
file(GLOB OPENCLSRCFILES
file(GLOB OPENCLSRCFILES
"xmrstak/backend/amd/amd_gpu/*.cpp"
"xmrstak/backend/amd/*.cpp")
add_library(xmrstak_opencl_backend
Expand Down Expand Up @@ -536,7 +534,6 @@ target_link_libraries(xmr-stak ${LIBS} xmr-stak-c xmr-stak-backend)
# Install
################################################################################


# do not install the binary if the project and install are equal
if( NOT CMAKE_INSTALL_PREFIX STREQUAL PROJECT_BINARY_DIR )
install(TARGETS xmr-stak
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###### fireice-uk's and psychocrypt's
# XMR-Stak - Monero/Aeon All-in-One Mining Software

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

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.

Expand Down Expand Up @@ -48,8 +48,11 @@ Besides [Monero](https://getmonero.org), following coins can be mined using this
- [Graft](https://www.graft.network)
- [Haven](https://havenprotocol.com)
- [Intense](https://intensecoin.com)
- [IPBC](https://ipbc.io)
- [Karbo](https://karbo.io)
- [Masari](https://getmasari.org)
- [Sumokoin](https://www.sumokoin.org)
- [TurtleCoin](https://turtlecoin.lol)

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

Expand Down
9 changes: 8 additions & 1 deletion THIRD-PARTY-LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This application bundles the following third-party software in accordance with t
Package: Original NVidia mining code
Authors: tsiv and KlausT
License: GNU GPLv3
Notes: Improvements are (c) of Xmr-Stak team
Notes: Improvements are (c) of Xmr-Stak team and are covered by GNU GPLv3

-------------------------------------------------------------------------

Expand All @@ -27,3 +27,10 @@ Authors: okdshin
License: MIT License

-------------------------------------------------------------------------

Package: cpputil
Authors: Will Zhang
Source: https://github.com/willzhang4a58/cpputil
License: MIT License

-------------------------------------------------------------------------
6 changes: 3 additions & 3 deletions doc/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ Download and install this [runtime package](https://go.microsoft.com/fwlink/?Lin

## Error: MEMORY ALLOC FAILED: mmap failed

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

To set large page support, add the following lines to /etc/sysctl.conf:

vm.nr_hugepages=128

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

* soft memlock 262144
* hard memlock 262144

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).
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).

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

Expand Down
2 changes: 1 addition & 1 deletion doc/compile_FreeBSD.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

From the root shell, run the following commands:

pkg install git libmicrohttpd hwloc cmake
pkg install git libmicrohttpd hwloc cmake

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

Expand Down
7 changes: 4 additions & 3 deletions doc/compile_Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

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

- 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/)
- 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
(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)

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

Expand Down Expand Up @@ -64,7 +65,7 @@
cd xmr-stak/build
cmake ..
make install
# TinyCore Linux 8.x
# TinyCore is 32-bit only, but there is an x86-64 port, known as "Pure 64,"
# hosted on the TinyCore home page, and it works well.
Expand Down Expand Up @@ -94,7 +95,7 @@
make install
```

- g++ version 5.1 or higher is required for full C++11 support.
- g++ version 5.1 or higher is required for full C++11 support.
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).

- 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.
Expand Down
19 changes: 10 additions & 9 deletions doc/compile_Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- During install choose following components:
- `Desktop development with C++` (left side)
- `VC++ 2015.3 v140 toolset for desktop` (right side - **NOT** needed for CUDA 9 or AMD GPU)
- 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
- 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

### CMake for Win64

Expand All @@ -32,7 +32,8 @@

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

- Download and install the latest version from http://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/
- 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
(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)

### Dependencies OpenSSL/Hwloc and Microhttpd
- For CUDA 8*:
Expand Down Expand Up @@ -82,17 +83,17 @@
- Go to extracted source code directory (e.g. `cd C:\Users\USERNAME\xmr-stak-<version>`)
- Execute the following commands (NOTE: path to Visual Studio Community 2017 can be different)
```
# Execute next line only if compiling for Cuda 9.1 and using Visual Studio 2017 >= 15.5 (released 12/04/17)
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11
# Execute next line only if compiling for Cuda 9.x and using Visual Studio 2017 >= 15.5 (released 12/04/17)
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"
```
- 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:
```
mkdir build
cd build
set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl
```

Expand All @@ -104,9 +105,9 @@
- Then execute
```
cmake --build . --config Release --target install
cd bin\Release
copy C:\xmr-stak-dep\openssl\bin\* .
```
- Miner is by default compiled for NVIDIA GPUs (if CUDA is installed), AMD GPUs (if the AMD APP SDK is installed) and CPUs.
4 changes: 2 additions & 2 deletions doc/tuning.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ If you are unsure of either GPU or platform index value, you can use `clinfo` to
```
"gpu_threads_conf" :
[
{ "index" : 0, "intensity" : 1000, "worksize" : 8, "affine_to_cpu" : false,
{ "index" : 0, "intensity" : 1000, "worksize" : 8, "affine_to_cpu" : false,
"strided_index" : true, "mem_chunk" : 2, "comp_mode" : true
},
{ "index" : 1, "intensity" : 1000, "worksize" : 8, "affine_to_cpu" : false,
{ "index" : 1, "intensity" : 1000, "worksize" : 8, "affine_to_cpu" : false,
"strided_index" : true, "mem_chunk" : 2, "comp_mode" : true
},
],
Expand Down
24 changes: 12 additions & 12 deletions xmrstak/backend/amd/amd_gpu/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <algorithm>
#include <regex>
#include <cassert>
#include <algorithm>
#include <algorithm>

#include <fstream>
#include <sstream>
Expand Down Expand Up @@ -397,7 +397,7 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
* used data:
* - source code
* - device name
* - compile paramater
* - compile parameter
*/
std::string src_str(source_code);
src_str += options;
Expand Down Expand Up @@ -476,14 +476,14 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
}
while(status == CL_BUILD_IN_PROGRESS);

std::vector<size_t> binary_sizes(num_devices);
clGetProgramInfo (ctx->Program[ii], CL_PROGRAM_BINARY_SIZES, sizeof(size_t) * binary_sizes.size(), binary_sizes.data(), NULL);

std::vector<char*> all_programs(num_devices);
std::vector<std::vector<char>> program_storage;

if(xmrstak::params::inst().AMDCache)
{
std::vector<size_t> binary_sizes(num_devices);
clGetProgramInfo (ctx->Program[ii], CL_PROGRAM_BINARY_SIZES, sizeof(size_t) * binary_sizes.size(), binary_sizes.data(), NULL);

std::vector<char*> all_programs(num_devices);
std::vector<std::vector<char>> program_storage;

int p_id = 0;
size_t mem_size = 0;
// create memory structure to query all OpenCL program binaries
Expand Down Expand Up @@ -935,7 +935,7 @@ size_t InitOpenCL(GpuContext* ctx, size_t num_gpus, size_t platform_idx)

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

cl_int ret;
Expand Down Expand Up @@ -1004,12 +1004,12 @@ size_t XMRSetJob(GpuContext* ctx, uint8_t* input, size_t input_len, uint64_t tar
return(ERR_OCL_API);
}

if(miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon )
if(miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon || miner_algo == cryptonight_ipbc || miner_algo == cryptonight_stellite)
{
// Input
if ((ret = clSetKernelArg(ctx->Kernels[kernel_storage][1], 3, sizeof(cl_mem), &ctx->InputBuffer)) != CL_SUCCESS)
{
printer::inst()->print_msg(L1, "Error %s when calling clSetKernelArg for kernel 1, arugment 4(input buffer).", err_to_str(ret));
printer::inst()->print_msg(L1, "Error %s when calling clSetKernelArg for kernel 1, argument 4(input buffer).", err_to_str(ret));
return ERR_OCL_API;
}
}
Expand Down Expand Up @@ -1102,7 +1102,7 @@ size_t XMRRunJob(GpuContext* ctx, cl_uint* HashOutput, xmrstak_algo miner_algo)
{
// switch to the kernel storage
int kernel_storage = miner_algo == ::jconf::inst()->GetCurrentCoinSelection().GetDescription(1).GetMiningAlgo() ? 0 : 1;

cl_int ret;
cl_uint zero = 0;
size_t BranchNonces[4];
Expand Down
Loading

0 comments on commit c0ab173

Please sign in to comment.