summarylogtreecommitdiffstats
path: root/fix-compile.patch
blob: 8dad656d95522ddca60dd1d78eff0c169022202a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
--- a/src/crypto/common/Algorithm.h	2021-09-18 15:16:03.000000000 +0200
+++ b/src/crypto/common/Algorithm.h	2021-09-18 16:44:27.677847874 +0200
@@ -22,6 +22,7 @@


 #include <cstdint>
+#include <cstddef>
 #include <vector>


--- a/cmake/CUDA.cmake	2025-12-28 09:36:57.973726366 +0100
+++ b/cmake/CUDA.cmake	2025-12-28 09:37:27.960774309 +0100
@@ -14,29 +14,7 @@
     add_definitions("-DXMRIG_LARGEGRID=${XMRIG_LARGEGRID}")
 endif()

-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()
-
-# Kepler GPUs are only supported with CUDA < 11.0
-if (CUDA_VERSION VERSION_LESS 11.0)
-    list(APPEND DEFAULT_CUDA_ARCH "30")
-elseif (CUDA_VERSION VERSION_LESS 12.0)
-    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")
-endif()
-
-# add Volta support for CUDA >= 9.0
-if (NOT CUDA_VERSION VERSION_LESS 9.0)
-    list(APPEND DEFAULT_CUDA_ARCH "70")
-endif()
+set(DEFAULT_CUDA_ARCH "80")

 # add Turing support for CUDA >= 10.0
 if (NOT CUDA_VERSION VERSION_LESS 10.0)
@@ -135,6 +113,7 @@
         list(APPEND CUDA_NVRTC_LIB_HINTS "${CUDA_TOOLKIT_ROOT_DIR}/lib")
     else()
         set(LIB_HINTS
+            "${CUDA_TOOLKIT_ROOT_DIR}/targets/x86_64-linux/lib/stubs"
             "${CUDA_TOOLKIT_ROOT_DIR}/lib64"
             "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64"
             "/usr/lib64"
@@ -144,8 +123,8 @@
         list(APPEND CUDA_NVRTC_LIB_HINTS ${LIB_HINTS})
         unset(LIB_HINTS)
     endif()
-    find_library(CUDA_LIB libcuda cuda HINTS ${CUDA_LIB_HINTS})
-    find_library(CUDA_NVRTC_LIB libnvrtc nvrtc HINTS ${CUDA_NVRTC_LIB_HINTS})
+    find_library(CUDA_LIB libcuda.so cuda.so HINTS ${CUDA_LIB_HINTS} REQUIRED)
+    find_library(CUDA_NVRTC_LIB libnvrtc.so nvrtc.so HINTS ${CUDA_NVRTC_LIB_HINTS} REQUIRED)
     unset(CUDA_LIB_HINTS)
     unset(CUDA_NVRTC_LIB_HINTS)

--- a/src/cuda_extra.cu	2025-12-28 09:46:01.099012050 +0100
+++ b/src/cuda_extra.cu	2025-12-28 09:46:46.992371035 +0100
@@ -551,8 +551,16 @@
     ctx->device_mpcount         = props.multiProcessorCount;
     ctx->device_arch[0]         = props.major;
     ctx->device_arch[1]         = props.minor;
-    ctx->device_clockRate       = props.clockRate;
-    ctx->device_memoryClockRate = props.memoryClockRate;
+    err = cudaDeviceGetAttribute(&(ctx->device_clockRate), cudaDevAttrClockRate, ctx->device_id);
+    if (err != cudaSuccess) {
+        printf("\nGPU %d: %s\n%s line %d\n", ctx->device_id, cudaGetErrorString(err), __FUNCTION__, __LINE__);
+        return 1;
+    }
+    err = cudaDeviceGetAttribute(&(ctx->device_memoryClockRate), cudaDevAttrMemoryClockRate, ctx->device_id);
+    if (err != cudaSuccess) {
+        printf("\nGPU %d: %s\n%s line %d\n", ctx->device_id, cudaGetErrorString(err), __FUNCTION__, __LINE__);
+        return 1;
+    }
     ctx->device_pciBusID        = props.pciBusID;
     ctx->device_pciDeviceID     = props.pciDeviceID;
     ctx->device_pciDomainID     = props.pciDomainID;