Skip to content

Commit

Permalink
XMR-STAK 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
IndeedMiners committed Dec 9, 2017
1 parent 14e920d commit 4622fe0
Show file tree
Hide file tree
Showing 43 changed files with 1,224 additions and 392 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build_script:
- mkdir build
- cd build
- set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl;
- cmake -G "Visual Studio 14 2015 Win64" -T v140,host=x64 .. -DWIN_UAC=OFF -DCUDA_ARCH=30
- cmake -G "Visual Studio 14 2015 Win64" -T v140,host=x64 .. -DCUDA_ARCH=30
- cmake --build . --config Release --target install

test_script:
Expand Down
43 changes: 20 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project(xmr-stak)

cmake_minimum_required(VERSION 3.0.1)
cmake_minimum_required(VERSION 3.1.0)

# enforce C++11
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -42,23 +42,23 @@ set_property(CACHE XMR-STAK_CURRENCY PROPERTY STRINGS "all;monero;aeon")

set(XMR-STAK_COMPILE "native" CACHE STRING "select CPU compute architecture")
set_property(CACHE XMR-STAK_COMPILE PROPERTY STRINGS "native;generic")
if("${XMR-STAK_COMPILE}" STREQUAL "native")
if(XMR-STAK_COMPILE STREQUAL "native")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "-march=native -mtune=native ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-march=native -mtune=native ${CMAKE_C_FLAGS}")
endif()
elseif("${XMR-STAK_COMPILE}" STREQUAL "generic")
elseif(XMR-STAK_COMPILE STREQUAL "generic")
add_definitions("-DCONF_ENFORCE_OpenCL_1_2=1")
else()
message(FATAL_ERROR "XMR-STAK_COMPILE is set to an unknown value '${XMR-STAK_COMPILE}'")
endif()

if("${XMR-STAK_CURRENCY}" STREQUAL "all")
if(XMR-STAK_CURRENCY STREQUAL "all")
message(STATUS "Set miner currency to 'monero' and 'aeon'")
elseif("${XMR-STAK_CURRENCY}" STREQUAL "aeon")
elseif(XMR-STAK_CURRENCY STREQUAL "aeon")
message(STATUS "Set miner currency to 'aeon'")
add_definitions("-DCONF_NO_MONERO=1")
elseif("${XMR-STAK_CURRENCY}" STREQUAL "monero")
elseif(XMR-STAK_CURRENCY STREQUAL "monero")
message(STATUS "Set miner currency to 'monero'")
add_definitions("-DCONF_NO_AEON=1")
endif()
Expand Down Expand Up @@ -134,7 +134,7 @@ if(CUDA_ENABLE)
option(CUDA_SHOW_REGISTER "Show registers used for each kernel and compute architecture" OFF)
option(CUDA_KEEP_FILES "Keep all intermediate files that are generated during internal compilation steps" OFF)

if("${CUDA_COMPILER}" STREQUAL "clang")
if(CUDA_COMPILER STREQUAL "clang")
set(CLANG_BUILD_FLAGS "-O3 -x cuda --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
# activation usage of FMA
set(CLANG_BUILD_FLAGS "${CLANG_BUILD_FLAGS} -ffp-contract=fast")
Expand All @@ -152,9 +152,9 @@ if(CUDA_ENABLE)
set(CLANG_BUILD_FLAGS "${CLANG_BUILD_FLAGS} --cuda-gpu-arch=sm_${CUDA_ARCH_ELEM}")
endforeach()

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

Expand Down Expand Up @@ -307,7 +307,7 @@ if(MICROHTTPD_ENABLE)
ENV "MICROHTTPD_ROOT"
PATH_SUFFIXES
lib)
if("${MHTD}" STREQUAL "MHTD-NOTFOUND")
if(MHTD STREQUAL "MHTD-NOTFOUND")
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support")
else()
set(LIBS ${LIBS} ${MHTD})
Expand Down Expand Up @@ -348,7 +348,7 @@ if(HWLOC_ENABLE)
/usr/local
/usr
ENV "PROGRAMFILES(X86)"
ENV "MICROHTTPD_ROOT"
ENV "HWLOC_ROOT"
PATH_SUFFIXES
include)

Expand All @@ -361,7 +361,7 @@ if(HWLOC_ENABLE)
PATH_SUFFIXES
lib)

if("${HWLOC}" STREQUAL "MHTD-NOTFOUND" OR ${HWLOC_INCLUDE_DIR} STREQUAL "HWLOC_INCLUDE_DIR-NOTFOUND")
if(HWLOC STREQUAL "HWLOC-NOTFOUND" OR ${HWLOC_INCLUDE_DIR} STREQUAL "HWLOC_INCLUDE_DIR-NOTFOUND")
message(FATAL_ERROR "hwloc NOT found: use `-DHWLOC_ENABLE=OFF` to build without hwloc support")
else()
set(LIBS ${LIBS} ${HWLOC})
Expand Down Expand Up @@ -399,10 +399,10 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

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

Expand Down Expand Up @@ -446,7 +446,10 @@ add_library(xmr-stak-c
${SRCFILES_C}
)
set_property(TARGET xmr-stak-c PROPERTY C_STANDARD 99)
target_link_libraries(xmr-stak-c ${MHTD} ${LIBS})
if(MICROHTTPD_ENABLE)
target_link_libraries(xmr-stak-c ${MHTD})
endif()
target_link_libraries(xmr-stak-c ${LIBS})

# compile generic backend files
file(GLOB BACKEND_CPP
Expand All @@ -470,7 +473,7 @@ if(CUDA_FOUND)
"xmrstak/backend/nvidia/nvcc_code/*.cu"
"xmrstak/backend/nvidia/*.cpp")

if("${CUDA_COMPILER}" STREQUAL "clang")
if(CUDA_COMPILER STREQUAL "clang")
# build device code with clang
add_library(
xmrstak_cuda_backend
Expand Down Expand Up @@ -518,19 +521,13 @@ set(LIBRARY_OUTPUT_PATH "bin")

target_link_libraries(xmr-stak ${LIBS} xmr-stak-c xmr-stak-backend)

option(WIN_UAC "Add UAC manifest on Windows" ON)

if(WIN_UAC AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set_property(TARGET xmr-stak PROPERTY LINK_FLAGS "/level='requireAdministrator' /uiAccess='false'")
endif()

################################################################################
# Install
################################################################################


# do not install the binary if the project and install are equal
if( NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "${PROJECT_BINARY_DIR}" )
if( NOT CMAKE_INSTALL_PREFIX STREQUAL PROJECT_BINARY_DIR )
install(TARGETS xmr-stak
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
if(CUDA_FOUND)
Expand Down
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Latest version of ubuntu
FROM nvidia/cuda:9.0-base

# Default git repository
ENV GIT_REPOSITORY https://github.com/fireice-uk/xmr-stak.git
ENV XMRSTAK_CMAKE_FLAGS -DXMR-STAK_COMPILE=generic -DCUDA_ENABLE=ON -DOpenCL_ENABLE=OFF

# Innstall packages
RUN apt-get update \
&& set -x \
&& apt-get install -qq --no-install-recommends -y ca-certificates cmake cuda-core-9-0 git cuda-cudart-dev-9-0 libhwloc-dev libmicrohttpd-dev libssl-dev \
&& git clone $GIT_REPOSITORY \
&& cd /xmr-stak \
&& cmake ${XMRSTAK_CMAKE_FLAGS} . \
&& make \
&& cd - \
&& mv /xmr-stak/bin/* /usr/local/bin/ \
&& rm -rf /xmr-stak \
&& apt-get purge -y -qq cmake cuda-core-9-0 git cuda-cudart-dev-9-0 libhwloc-dev libmicrohttpd-dev libssl-dev \
&& apt-get clean -qq

VOLUME /mnt

WORKDIR /mnt

ENTRYPOINT ["/usr/local/bin/xmr-stak"]
42 changes: 4 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ XMR-Stak is a universal Stratum pool miner. This miner supports CPUs, AMD and NV
* [HowTo Compile](doc/compile.md)
* [FAQ](doc/FAQ.md)
* [Developer Donation](#default-developer-donation)
* [Cheksums](#checksums)
* [PGP Key](#pgp-key)
* [Release Cheksums](#release-checksums)
* [Developer PGP Key's](doc/pgp_keys.md)

## Features

Expand All @@ -32,7 +32,7 @@ XMR-Stak is a universal Stratum pool miner. This miner supports CPUs, AMD and NV

## Download

You can find the latest releases and precompiled binaries on GitHub under [Releases](https://github.com/xmr-stak/xmr-stak/releases).
You can find the latest releases and precompiled binaries on GitHub under [Releases](https://github.com/fireice-uk/xmr-stak/releases).
If you are running on Linux (especially Linux VMs), checkout [Linux Portable Binary](doc/Linux_deployment.md).

## Default Developer Donation
Expand All @@ -51,7 +51,7 @@ psychocrypt:
43NoJVEXo21hGZ6tDG6Z3g4qimiGdJPE6GRxAmiWwm26gwr62Lqo7zRiCJFSBmbkwTGNuuES9ES5TgaVHceuYc4Y75txCTU
```

## Checksums
## Release Checksums
```
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Expand Down Expand Up @@ -87,37 +87,3 @@ cvX6gTCsFYfLw/p+sz+DN7kh7zJlCvIFga3HaFByxCSuyMY08qerXS/0862ZMdo=
-----END PGP SIGNATURE-----
```

## PGP Key
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFhYUmUBCAC6493W5y1MMs38ApRbI11jWUqNdFm686XLkZWGDfYImzL6pEYk
RdWkyt9ziCyA6NUeWFQYniv/z10RxYKq8ulVVJaKb9qPGMU0ESfdxlFNJkU/pf28
sEVBagGvGw8uFxjQONnBJ7y7iNRWMN7qSRS636wN5ryTHNsmqI4ClXPHkXkDCDUX
QvhXZpG9RRM6jsE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SmgudOp1VS45aHIREd
2nrJ+drleeFVyb14UQqO/6iX9GuDX2yBEHdCg2aljeP98AaMU//RiEtebE6CUWsL
HPVXHIkxwBCBe0YkJINHUQqLz/5f6qLsNUp1uTH2++zhdBWvg+gErTYbx8aFMFYH
0GoOtqE5rtlAh5MTvDZm+UcDwKJCxhrLaN3R3dDoyrDNRTgHQQuX5/opJBiUnVNK
d+vugnxzpMIJQP11yCZkz/KxV8zQ2QPMuZdAoh3znd/vGCJcp0rWphn4pqxA4vDp
c4hC0Yg9Dha1OoE5CJCqVL+ic4vAyB1urAwBlsd/wH8=
=B5I+
-----END PGP PUBLIC KEY BLOCK-----
```
8 changes: 3 additions & 5 deletions doc/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Reference: http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?pid=259791#pid

## VirtualAlloc failed

If you set up the user rights properly (see above), and your system has 4-8GB of RAM (50%+ use), there is a significant chance that there simply won't be a large enough chunk of contiguous memory because Windows is fairly bad at mitigating memory fragmentation.
If you set up the user rights properly ([see above](https://github.com/fireice-uk/xmr-stak/blob/master/doc/FAQ.md#selockmemoryprivilege-failed)), and your system has 4-8GB of RAM (50%+ use), there is a significant chance that there simply won't be a large enough chunk of contiguous memory because Windows is fairly bad at mitigating memory fragmentation.

If that happens, disable all auto-staring applications and run the miner after a reboot.

Expand All @@ -56,10 +56,8 @@ This typically means you are trying to run it on a CPU that does not have [AES](

## Virus Protection Alert

Some Virus protection software flag the miner binary as *Male Ware*.
In this case the binary is moved to the quarantine area of the protection software.
This is a wrong alert and not avoid by use.
Add the binary to to protection software white list to solve this issue.s
Some virus protection software flags the miner binary as *malware*. This is a false positive — the software does not contain any malware (and since it is open source, you can verify that yourself!)
If your antivirus software flags **xmr-stak**, it will likely move it to its quarantine area. You may have to whitelist **xmr-stak** in your antivirus.

## Change Currency to Mine

Expand Down
2 changes: 2 additions & 0 deletions doc/Linux_deployment.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Deploying portable **XMR-Stak** on Linux systems

**This is an experimental feature** we reserve the right to remove the binary if we get too many issues.

XMR-Stak releases include a pre-built portable version. If you are simply using it to avoid having to compile the application, you can simply download **xmr-stak-portbin-linux.tar.gz** from our [latest releases](https://github.com/fireice-uk/xmr-stak/releases/latest). Open up command line, and use the following commands:

```
Expand Down
7 changes: 2 additions & 5 deletions doc/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [Compile on Windows](compile_Windows.md)
* [Compile on Linux](compile_Linux.md)
* [Compile on FreeBSD](compile_FreeBSD.md)
* [Compile on MacOS](compile_MacOS.md)

## Build System

Expand All @@ -30,6 +31,7 @@ After the configuration you need to compile the miner, follow the guide for your
* [Compile in Windows](compile_Windows.md)
* [Compile in Linux](compile_Linux.md)
* [Compile in FreeBSD](compile_FreeBSD.md)
* [Compile in MacOS](compile_MacOS.md)

## Generic Build Options
- `CMAKE_INSTALL_PREFIX` install miner to the home folder
Expand All @@ -50,11 +52,6 @@ After the configuration you need to compile the miner, follow the guide for your
- native means the miner binary can be used only on the system where it is compiled but will archive the highest hash rate
- use `cmake .. -DXMR-STAK_COMPILE=generic` to run the miner on all CPU's with sse2

### only available for Windows
- `WIN_UAC` will enable or disable the "Run As Administrator" prompt on Windows.
- UAC confirmation is needed to use large pages on Windows 7.
- On Windows 10 it is only needed once to set up the account to use them.

## CPU Build Options

- `CPU_ENABLE` allow to disable/enable the CPU backend of the miner
Expand Down
31 changes: 31 additions & 0 deletions doc/compile_MacOS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Compile **xmr-stak** for MacOS

## Dependencies

Assuming you already have [Homebrew](https://brew.sh) installed, the installation of dependencies is pretty straightforward and will generate the `xmr-stak` binary in the `bin/` directory.

### For NVIDIA GPUs

```shell
brew tap caskroom/drivers
brew cask install nvidia-cuda
brew install hwloc libmicrohttpd gcc openssl cmake
cmake . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOpenCL_ENABLE=OFF
make install
```

[All available CMake options](compile.md#nvidia-build-options)

### For AMD GPUs

> 🖐 We need help with AMD GPU compilation instructions. Please submit a PR if you managed to install [AMD APP SDK](http://developer.amd.com/amd-accelerated-parallel-processing-app-sdk/) and to compile `xmr-stak` on MacOS.
### For CPU-only mining

```shell
brew install hwloc libmicrohttpd gcc openssl cmake
cmake . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
make install
```

[All available CMake options](compile.md#cpu-build-options)
12 changes: 8 additions & 4 deletions doc/compile_Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- download VS2017 Community and install from [https://www.visualstudio.com/downloads/](https://www.visualstudio.com/downloads/)
- during the install chose the components
- `Desktop development with C++` (left side)
- `Toolset for Visual Studio C++ 2015.3 v140...` (right side)
- `VC++ 2015.3 v140 toolset for desktop` (right side)

### CMake for Win64

Expand All @@ -34,8 +34,12 @@
- 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/)

### Dependencies OpenSSL/Hwloc and Microhttpd
- with CUDA 8: download the version 1 of the precompiled binary from [https://github.com/fireice-uk/xmr-stak-dep/releases/download/v1/xmr-stak-dep.zip](https://github.com/fireice-uk/xmr-stak-dep/releases/download/v1/xmr-stak-dep.zip)
- with CUDA 9: download the version 2 of the precompiled binary from [https://github.com/fireice-uk/xmr-stak-dep/releases/download/v2/xmr-stak-dep.zip](https://github.com/fireice-uk/xmr-stak-dep/releases/download/v2/xmr-stak-dep.zip)
- for CUDA 8*:
- download the version 1 of the precompiled binary from [https://github.com/fireice-uk/xmr-stak-dep/releases/download/v1/xmr-stak-dep.zip](https://github.com/fireice-uk/xmr-stak-dep/releases/download/v1/xmr-stak-dep.zip)
- version 1 of the pre-compiled dependencies is not compatible with Visual Studio Toolset v141
- for CUDA 9 **and/or** AMD GPUs, CPU:
- download the version 2 of the precompiled binary from [https://github.com/fireice-uk/xmr-stak-dep/releases/download/v2/xmr-stak-dep.zip](https://github.com/fireice-uk/xmr-stak-dep/releases/download/v2/xmr-stak-dep.zip)
- version 2 of the pre-compiled dependencies is not compatible with Visual Studio Toolset v140
- unzip all to `C:\xmr-stak-dep`

### Validate the Dependency Folder
Expand Down Expand Up @@ -85,7 +89,7 @@
```
cmake -G "Visual Studio 15 2017 Win64" -T v140,host=x64 ..
```
- for CUDA 9 and/or AMD GPUs, CPU
- for CUDA 9 **and/or** AMD GPUs, CPU
```
cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 ..
```
Expand Down
Loading

0 comments on commit 4622fe0

Please sign in to comment.