Skip to content

Commit

Permalink
XMR-AEON-STAK 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
IndeedMiners committed Mar 10, 2019
1 parent c0a67e0 commit cd7dd42
Show file tree
Hide file tree
Showing 73 changed files with 12,957 additions and 1,890 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ install:
- curl -sL https://github.com/fireice-uk/xmr-stak-dep/releases/download/v1/xmr-stak-dep.zip -o xmr-stak-dep.zip
- 7z x xmr-stak-dep.zip -o"c:\xmr-stak-dep" -y > nul
- appveyor DownloadFile https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_windows-exe -FileName cuda_8.0.44_windows.exe
- cuda_8.0.44_windows.exe -s compiler_8.0 cudart_8.0
- cuda_8.0.44_windows.exe -s compiler_8.0 cudart_8.0 nvrtc_8.0 nvrtc_dev_8.0
- set PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp;%PATH%
- nvcc -V

Expand Down
83 changes: 68 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

# help to find cuda on systems with a software module system
list(APPEND CMAKE_PREFIX_PATH "$ENV{CUDA_ROOT}")

# help to find AMD OCL SDK Light (replaced APP SDK)
list(APPEND CMAKE_PREFIX_PATH "$ENV{OCL_ROOT}")

# help to find AMD app SDK on systems with a software module system
list(APPEND CMAKE_PREFIX_PATH "$ENV{AMDAPPSDKROOT}")

# allow user to extent CMAKE_PREFIX_PATH via environment variable
list(APPEND CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")

Expand Down Expand Up @@ -63,6 +70,42 @@ if(CUDA_ENABLE)
find_package(CUDA 7.5)

if(CUDA_FOUND)
# required for monero's cryptonight_r
# libcuda
find_library(CUDA_LIB
NAMES
libcuda
cuda
cuda.lib
HINTS
${CUDA_TOOLKIT_ROOT_DIR}
${LIBCUDA_LIBRARY_DIR}
${CUDA_TOOLKIT_ROOT_DIR}
/usr
/usr/local/cuda
PATH_SUFFIXES
lib64
lib/x64
lib/Win32
lib64/stubs)

#nvrtc
find_library(CUDA_NVRTC_LIB
NAMES
libnvrtc
nvrtc
nvrtc.lib
HINTS
${CUDA_TOOLKIT_ROOT_DIR}
${LIBNVRTC_LIBRARY_DIR}
${CUDA_TOOLKIT_ROOT_DIR}
/usr
/usr/local/cuda
PATH_SUFFIXES
lib64
lib/x64
lib/Win32)

list(APPEND BACKEND_TYPES "nvidia")
option(XMR-STAK_LARGEGRID "Support large CUDA block count > 128" ON)
if(XMR-STAK_LARGEGRID)
Expand Down Expand Up @@ -152,6 +195,9 @@ if(CUDA_ENABLE)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")
endif()

# required for cryptonight_gpu (fast floating point operations are not allowed)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --fmad=false --prec-div=true --ftz=false")

# avoid that nvcc in CUDA 8 complains about sm_20 pending removal
if(CUDA_VERSION VERSION_EQUAL 8.0)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Wno-deprecated-gpu-targets")
Expand Down Expand Up @@ -190,16 +236,11 @@ if(CUDA_ENABLE)
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 OR
CUDA_VERSION VERSION_EQUAL 9.2 OR
CUDA_VERSION VERSION_EQUAL 10.0)
)
# 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
set(CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE FILEPATH "Host side compiler used by NVCC" FORCE)
endif()
# 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
# in linux where clang and gcc is installed it also helps to select the correct host compiler
set(CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE FILEPATH "Host side compiler used by NVCC" FORCE)

else()
message(FATAL_ERROR "selected CUDA compiler '${CUDA_COMPILER}' is not supported")
endif()
Expand All @@ -210,11 +251,6 @@ else()
add_definitions("-DCONF_NO_CUDA")
endif()

# help to find AMD app SDK on systems with a software module system
list(APPEND CMAKE_PREFIX_PATH "$ENV{AMDAPPSDKROOT}")
# allow user to extent CMAKE_PREFIX_PATH via environment variable
list(APPEND CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")

###############################################################################
# Find OpenCL
###############################################################################
Expand All @@ -228,6 +264,7 @@ if(OpenCL_ENABLE)
OpenCL/cl.h
NO_DEFAULT_PATH
PATHS
ENV "OCL_ROOT"
ENV "OpenCL_ROOT"
ENV AMDAPPSDKROOT
ENV ATISTREAMSDKROOT
Expand All @@ -244,6 +281,7 @@ if(OpenCL_ENABLE)
OpenCL.lib
NO_DEFAULT_PATH
PATHS
ENV "OCL_ROOT"
ENV "OpenCL_ROOT"
ENV AMDAPPSDKROOT
ENV ATISTREAMSDKROOT
Expand Down Expand Up @@ -279,6 +317,14 @@ else()
list(APPEND BACKEND_TYPES "cpu")
endif()

################################################################################
# Explicit march setting for Clang
################################################################################

if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set_source_files_properties(xmrstak/backend/cpu/crypto/cn_gpu_avx.cpp PROPERTIES COMPILE_FLAGS "-mavx2")
endif()

################################################################################
# Find PThreads
################################################################################
Expand Down Expand Up @@ -462,18 +508,23 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
# asm optimized monero v8 code
enable_language(ASM_MASM)
set_property(SOURCE "xmrstak/backend/cpu/crypto/asm/cryptonight_v8_main_loop.asm" PROPERTY ASM_MASM)
set_property(SOURCE "xmrstak/backend/cpu/crypto/asm/cnR/CryptonightR_template.asm" PROPERTY ASM_MASM)
add_library(xmr-stak-asm
STATIC
"xmrstak/backend/cpu/crypto/asm/cryptonight_v8_main_loop.asm"
"xmrstak/backend/cpu/crypto/asm/cnR/CryptonightR_template.asm"
)
else()
# asm optimized monero v8 code
enable_language(ASM)
set_property(SOURCE "xmrstak/backend/cpu/crypto/asm/cryptonight_v8_main_loop.S" PROPERTY CPP)
set_property(SOURCE "xmrstak/backend/cpu/crypto/asm/cnR/CryptonightR_template.S" PROPERTY CPP)
set_source_files_properties("xmrstak/backend/cpu/crypto/asm/cryptonight_v8_main_loop.S" PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")
set_source_files_properties("xmrstak/backend/cpu/crypto/asm/cnR/CryptonightR_template.S" PROPERTIES COMPILE_FLAGS "-x assembler-with-cpp")
add_library(xmr-stak-asm
STATIC
"xmrstak/backend/cpu/crypto/asm/cryptonight_v8_main_loop.S"
"xmrstak/backend/cpu/crypto/asm/cnR/CryptonightR_template.S"
)
endif()

Expand Down Expand Up @@ -532,6 +583,8 @@ if(CUDA_FOUND)
${CUDASRCFILES}
)
endif()

set(CUDA_LIBRARIES ${CUDA_LIB} ${CUDA_NVRTC_LIB} ${CUDA_LIBRARIES})
target_link_libraries(xmrstak_cuda_backend ${CUDA_LIBRARIES})
target_link_libraries(xmrstak_cuda_backend xmr-stak-backend xmr-stak-asm)
endif()
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,38 @@ Besides [Monero](https://getmonero.org), following coins can be mined using this
- [Aeon](http://www.aeon.cash)
- [BBSCoin](https://www.bbscoin.xyz)
- [BitTube](https://coin.bit.tube/)
- [Conceal](https://conceal.network)
- [Graft](https://www.graft.network)
- [Haven](https://havenprotocol.com)
- [Intense](https://intensecoin.com)
- [Lethean](https://lethean.io)
- [Masari](https://getmasari.org)
- [Plenteum](https://www.plenteum.com/)
- [QRL](https://theqrl.org)
- **[Ryo](https://ryo-currency.com) - Upcoming xmr-stak-gui is sponsored by Ryo**
- [Stellite](https://stellite.cash/)
- [TurtleCoin](https://turtlecoin.lol)
- [Zelerius](https://zelerius.org/)

Ryo currency is a way for us to implement the ideas that we were unable to in
Monero. See [here](https://github.com/fireice-uk/cryptonote-speedup-demo/) for details.

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

- 256Kib scratchpad memory
- cryptonight_turtle
- 1MiB scratchpad memory
- cryptonight_lite
- cryptonight_lite_v7
- cryptonight_lite_v7_xor (algorithm used by ipbc)
- 2MiB scratchpad memory
- cryptonight
- cryptonight_masari
- cryptonight_gpu (for Ryo's 14th of Feb fork)
- cryptonight_masari (used in 2018)
- cryptonight_v7
- cryptonight_v7_stellite
- cryptonight_v8
- cryptonight_v8_half (used by masari and stellite)
- cryptonight_v8_reversewaltz (used by graft)
- cryptonight_v8_zelerius
- 4MiB scratchpad memory
- cryptonight_haven
- cryptonight_heavy
Expand Down
4 changes: 1 addition & 3 deletions doc/compile_Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
- run `./amdgpu-pro-install --opencl=legacy,pal` from the unzipped folder
- set the environment variable to opencl `export AMDAPPSDKROOT=/opt/amdgpu-pro/`

**ATTENTION** The linux driver 18.3 creating invalid shares.
If you have an issue with `invalid shares` please downgrade your driver or switch to ROCm.

For linux also the OpenSource driver ROCm 1.9.X+ is a well working alternative, see https://rocm.github.io/ROCmInstall.html
ROCm is not supporting old GPUs please check if your GPU is supported https://rocm.github.io/hardware.html.

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

Expand Down
3 changes: 0 additions & 3 deletions doc/compile_Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@

- Download & install the AMD driver: https://www.amd.com/en/support

**ATTENTION** Many windows driver 18.5+ creating invalid shares.
If you have an issue with `invalid shares` please downgrade your driver.

- Download and install the latest version of the OCL-SDK from https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/releases

Do not follow old information that you need the AMD APP SDK. AMD has removed the APP SDK and is now shipping the OCL-SDK_light.
Expand Down
Loading

0 comments on commit cd7dd42

Please sign in to comment.