summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/cuda-bindings/patch-nvidia-libs-paths_13_2.patch
blob: f0cabbad67d56a6a86129603a2a3030fff175df7 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in
index 534dcb55cb..bd3feb2760 100644
--- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in
+++ b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in
@@ -8,7 +8,7 @@ cimport cuda.bindings._lib.windll as windll
 {{else}}
 cimport cuda.bindings._lib.dlfcn as dlfcn
 {{endif}}
-from cuda.pathfinder import load_nvidia_dynamic_lib
+from ctypes import CDLL
 from libc.stdint cimport intptr_t, uintptr_t
 import threading
 
@@ -47,7 +47,7 @@ cdef int _cuPythonInit() except -1 nogil:
     # Load library
     with gil, __symbol_lock:
         {{if 'Windows' == platform.system()}}
-        handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint
+        handle = CDLL("@libnvrtc@/lib/libnvrtc.so")._handle
 
         # Load function
         {{if 'nvrtcGetErrorString' in found_functions}}
@@ -156,7 +156,7 @@ cdef int _cuPythonInit() except -1 nogil:
         {{endif}}
 
         {{else}}
-        handle = <void*><uintptr_t>(load_nvidia_dynamic_lib("nvrtc")._handle_uint)
+        handle = <void*><uintptr_t>(CDLL("@libnvrtc@/lib/libnvrtc.so")._handle)
 
         # Load function
         {{if 'nvrtcGetErrorString' in found_functions}}
diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx
index 5231808058..f74cf1daec 100644
--- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx
+++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx
@@ -9,7 +9,7 @@ import threading
 
 from .utils import FunctionNotFoundError, NotSupportedError
 
-from cuda.pathfinder import load_nvidia_dynamic_lib
+from ctypes import CDLL
 
 import cython
 
@@ -107,7 +107,7 @@ cdef void* __cuFileGetParameterPosixPoolSlabArray = NULL
 
 
 cdef void* load_library() except* with gil:
-    cdef uintptr_t handle = load_nvidia_dynamic_lib("cufile")._handle_uint
+    cdef uintptr_t handle = CDLL("@libcufile@/lib/libcufile.so")._handle
     return <void*>handle
 
 
diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx
index f5a9bbd218..8271f7aa20 100644
--- a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx
+++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx
@@ -9,7 +9,7 @@ from libc.stdint cimport intptr_t, uintptr_t
 import threading
 from .utils import FunctionNotFoundError, NotSupportedError
 
-from cuda.pathfinder import load_nvidia_dynamic_lib
+from ctypes import CDLL
 
 
 ###############################################################################
@@ -73,7 +73,7 @@ cdef void* __nvFatbinAddTileIR = NULL
 
 
 cdef void* load_library() except* with gil:
-    cdef uintptr_t handle = load_nvidia_dynamic_lib("nvfatbin")._handle_uint
+    cdef uintptr_t handle = CDLL("@libnvfatbin@/lib/libnvfatbin.so")._handle
     return <void*>handle
 
 
diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx
index d676aac372..ed3c000566 100644
--- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx
+++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx
@@ -9,7 +9,7 @@ from libc.stdint cimport intptr_t, uintptr_t
 import threading
 from .utils import FunctionNotFoundError, NotSupportedError
 
-from cuda.pathfinder import load_nvidia_dynamic_lib
+from ctypes import CDLL
 
 
 ###############################################################################
@@ -76,7 +76,7 @@ cdef void* __nvJitLinkVersion = NULL
 
 
 cdef void* load_library() except* with gil:
-    cdef uintptr_t handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint
+    cdef uintptr_t handle = CDLL("@libnvjitlink@/lib/libnvJitLink.so")._handle
     return <void*>handle
 
 
diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx
index 28f0919423..852f75e46d 100644
--- a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx
+++ b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx
@@ -10,7 +10,7 @@ import threading
 
 from .utils import FunctionNotFoundError, NotSupportedError
 
-from cuda.pathfinder import load_nvidia_dynamic_lib
+from ctypes import CDLL
 
 
 ###############################################################################
@@ -406,7 +406,7 @@ cdef void* __nvmlDeviceSetRusdSettings_v1 = NULL
 
 
 cdef void* load_library() except* with gil:
-    cdef uintptr_t handle = load_nvidia_dynamic_lib("nvml")._handle_uint
+    cdef uintptr_t handle = CDLL("@libnvml@/lib/libnvidia-ml.so")._handle
     return <void*>handle
 
 
diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx
index 8a84834a9a..a3ced66807 100644
--- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx
+++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx
@@ -9,7 +9,7 @@ from libc.stdint cimport intptr_t, uintptr_t
 import threading
 from .utils import FunctionNotFoundError, NotSupportedError
 
-from cuda.pathfinder import load_nvidia_dynamic_lib
+from ctypes import CDLL
 
 
 ###############################################################################
@@ -75,7 +75,7 @@ cdef void* __nvvmGetProgramLog = NULL
 
 
 cdef void* load_library() except* with gil:
-    cdef uintptr_t handle = load_nvidia_dynamic_lib("nvvm")._handle_uint
+    cdef uintptr_t handle = CDLL("@libnvvm@/lib/libnvvm.so")._handle
     return <void*>handle
 
 
diff --git a/cuda_bindings/cuda/bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/cyruntime.pyx.in
index 244410a382..769664e157 100644
--- a/cuda_bindings/cuda/bindings/cyruntime.pyx.in
+++ b/cuda_bindings/cuda/bindings/cyruntime.pyx.in
@@ -2042,7 +2042,7 @@ cdef cudaError_t cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** r
 {{if True}}
 
 from libc.stdint cimport uintptr_t
-from cuda.pathfinder import load_nvidia_dynamic_lib
+from ctypes import CDLL
 {{if 'Windows' == platform.system()}}
 cimport cuda.bindings._lib.windll as windll
 {{else}}
@@ -2052,11 +2052,11 @@ cimport cuda.bindings._lib.dlfcn as dlfcn
 cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil:
     # Load
     with gil:
-        loaded_dl = load_nvidia_dynamic_lib("cudart")
+        loaded_dl = CDLL("@libcudart@/lib/libcudart.so")
         {{if 'Windows' == platform.system()}}
-        handle = <uintptr_t>loaded_dl._handle_uint
+        handle = <uintptr_t>loaded_dl._handle
         {{else}}
-        handle = <void *><uintptr_t>loaded_dl._handle_uint
+        handle = <void *><uintptr_t>loaded_dl._handle
         {{endif}}
 
     {{if 'Windows' == platform.system()}}