Skip to content

Commit

Permalink
Fixed build with recent CUDA 11.
Browse files Browse the repository at this point in the history
  • Loading branch information
xmrig committed Jul 15, 2020
1 parent 7d4946f commit d483b2b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ option(WITH_RANDOMX "Enable RandomX algorithms family" ON)

include_directories(src)
add_definitions(/DXMRIG_ALGO_CN_LITE /DXMRIG_ALGO_CN_HEAVY /DXMRIG_ALGO_CN_PICO)
add_definitions(/DCUB_IGNORE_DEPRECATED_CPP_DIALECT)


include(cmake/cpu.cmake)
Expand Down
15 changes: 12 additions & 3 deletions cmake/CUDA.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
add_definitions(-DCUB_IGNORE_DEPRECATED_CPP_DIALECT -DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT)

option(XMRIG_LARGEGRID "Support large CUDA block count > 128" ON)
if (XMRIG_LARGEGRID)
add_definitions("-DXMRIG_LARGEGRID=${XMRIG_LARGEGRID}")
Expand All @@ -23,13 +25,19 @@ find_library(CUDA_NVRTC_LIB libnvrtc nvrtc HINTS "${CUDA_TOOLKIT_ROOT_DIR}/lib64

set(LIBS ${LIBS} ${CUDA_LIBRARIES} ${CUDA_LIB} ${CUDA_NVRTC_LIB})

set(DEFAULT_CUDA_ARCH "30;50")
set(DEFAULT_CUDA_ARCH "50")

# Fermi GPUs are only supported with CUDA < 9.0
if (CUDA_VERSION VERSION_LESS 9.0)
list(APPEND DEFAULT_CUDA_ARCH "20;21")
endif()

if (CUDA_VERSION VERSION_LESS 11.0)
list(APPEND DEFAULT_CUDA_ARCH "30")
else()
list(APPEND DEFAULT_CUDA_ARCH "35")
endif()

# add Pascal support for CUDA >= 8.0
if (NOT CUDA_VERSION VERSION_LESS 8.0)
list(APPEND DEFAULT_CUDA_ARCH "60")
Expand Down Expand Up @@ -85,9 +93,10 @@ elseif("${CUDA_COMPILER}" STREQUAL "nvcc")
if (CUDA_VERSION VERSION_LESS 8.0)
add_definitions(-D_FORCE_INLINES)
add_definitions(-D_MWAITXINTRIN_H_INCLUDED)
elseif(CUDA_VERSION VERSION_LESS 9.0)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Wno-deprecated-gpu-targets")
endif()

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Wno-deprecated-gpu-targets")

foreach(CUDA_ARCH_ELEM ${CUDA_ARCH})
# set flags to create device code for the given architecture
if("${CUDA_ARCH_ELEM}" STREQUAL "21")
Expand Down
6 changes: 3 additions & 3 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
#define APP_ID "xmrig-cuda"
#define APP_NAME "XMRig"
#define APP_DESC "XMRig CUDA plugin"
#define APP_VERSION "6.2.1"
#define APP_VERSION "6.3.0"
#define APP_DOMAIN "xmrig.com"
#define APP_SITE "www.xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2020 xmrig.com"

#define APP_VER_MAJOR 6
#define APP_VER_MINOR 2
#define APP_VER_PATCH 1
#define APP_VER_MINOR 3
#define APP_VER_PATCH 0

#define API_VERSION 3

Expand Down

0 comments on commit d483b2b

Please sign in to comment.