File tree Expand file tree Collapse file tree
cuda_bindings/cuda/bindings/_path_finder Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,14 +167,6 @@ def _get_nvvm_wheel():
167167 return None
168168
169169
170- def get_major_cuda_version ():
171- # TODO: remove once cuda-python is
172- # a hard dependency
173- from numba .cuda .cudadrv .runtime import get_version
174-
175- return get_version ()[0 ]
176-
177-
178170def get_nvrtc_dso_path ():
179171 site_paths = [site .getusersitepackages ()] + site .getsitepackages ()
180172 for sp in site_paths :
@@ -185,21 +177,21 @@ def get_nvrtc_dso_path():
185177 ("bin" if IS_WIN32 else "lib" ) if sp else None ,
186178 )
187179 if lib_dir and os .path .exists (lib_dir ):
188- try :
189- major = get_major_cuda_version ()
180+ for major in (12 , 11 ):
190181 if major == 11 :
191182 cu_ver = "112" if IS_WIN32 else "11.2"
192183 elif major == 12 :
193184 cu_ver = "120" if IS_WIN32 else "12"
194185 else :
195186 raise NotImplementedError (f"CUDA { major } is not supported" )
196187
197- return os .path .join (
188+ dso_path = os .path .join (
198189 lib_dir ,
199190 f"nvrtc64_{ cu_ver } _0.dll" if IS_WIN32 else f"libnvrtc.so.{ cu_ver } " ,
200191 )
201- except RuntimeError :
202- continue
192+ if os .path .isfile (dso_path ):
193+ return dso_path
194+ return None
203195
204196
205197def _get_nvrtc_wheel ():
You can’t perform that action at this time.
0 commit comments