Skip to content

Commit

Permalink
Merge pull request #2269 from fireice-uk/dev
Browse files Browse the repository at this point in the history
release 2.9.0
  • Loading branch information
fireice-uk authored Mar 3, 2019
2 parents e785ca1 + b591823 commit 61e997c
Show file tree
Hide file tree
Showing 36 changed files with 2,749 additions and 340 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
53 changes: 43 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,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 @@ -200,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 Down Expand Up @@ -547,6 +578,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
Loading

0 comments on commit 61e997c

Please sign in to comment.