Coverage for cuda / pathfinder / _dynamic_libs / supported_nvidia_libs.py: 89%

28 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-10 01:19 +0000

1# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 

2# SPDX-License-Identifier: Apache-2.0 

3 

4# THIS FILE NEEDS TO BE REVIEWED/UPDATED FOR EACH CTK RELEASE 

5# Likely candidates for updates are: 

6# SUPPORTED_LIBNAMES 

7# SUPPORTED_WINDOWS_DLLS 

8# SUPPORTED_LINUX_SONAMES 

9 

10from cuda.pathfinder._utils.platform_aware import IS_WINDOWS 

11 

12SUPPORTED_LIBNAMES_COMMON = ( 

13 # Core CUDA Runtime and Compiler 

14 "cudart", 

15 "nvfatbin", 

16 "nvJitLink", 

17 "nvrtc", 

18 "nvvm", 

19 # Math Libraries 

20 "cublas", 

21 "cublasLt", 

22 "cufft", 

23 "cufftw", 

24 "curand", 

25 "cusolver", 

26 "cusolverMg", 

27 "cusparse", 

28 "nppc", 

29 "nppial", 

30 "nppicc", 

31 "nppidei", 

32 "nppif", 

33 "nppig", 

34 "nppim", 

35 "nppist", 

36 "nppisu", 

37 "nppitc", 

38 "npps", 

39 "nvblas", 

40 # Other 

41 "nvjpeg", 

42) 

43 

44# Note: The `cufile_rdma` information is intentionally retained (commented out) 

45# despite not being actively used in the current build. It took a nontrivial 

46# amount of effort to determine the SONAME, dependencies, and expected symbols 

47# for this special-case library, especially given its RDMA/MLX5 dependencies 

48# and limited availability. Keeping this as a reference avoids having to 

49# reconstruct the information from scratch in the future. 

50 

51SUPPORTED_LIBNAMES_LINUX_ONLY = ( 

52 "cufile", 

53 # "cufile_rdma", # Requires libmlx5.so 

54) 

55SUPPORTED_LIBNAMES_LINUX = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_LINUX_ONLY 

56 

57SUPPORTED_LIBNAMES_WINDOWS_ONLY = () 

58SUPPORTED_LIBNAMES_WINDOWS = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_WINDOWS_ONLY 

59 

60SUPPORTED_LIBNAMES_ALL = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_LINUX_ONLY + SUPPORTED_LIBNAMES_WINDOWS_ONLY 

61SUPPORTED_LIBNAMES = SUPPORTED_LIBNAMES_WINDOWS if IS_WINDOWS else SUPPORTED_LIBNAMES_LINUX 

62 

63# Based on ldd output for Linux x86_64 nvidia-*-cu12 wheels (12.8.1) 

64DIRECT_DEPENDENCIES_CTK = { 

65 "cublas": ("cublasLt",), 

66 "cufftw": ("cufft",), 

67 # "cufile_rdma": ("cufile",), 

68 "cusolver": ("nvJitLink", "cusparse", "cublasLt", "cublas"), 

69 "cusolverMg": ("nvJitLink", "cublasLt", "cublas"), 

70 "cusparse": ("nvJitLink",), 

71 "nppial": ("nppc",), 

72 "nppicc": ("nppc",), 

73 "nppidei": ("nppc",), 

74 "nppif": ("nppc",), 

75 "nppig": ("nppc",), 

76 "nppim": ("nppc",), 

77 "nppist": ("nppc",), 

78 "nppisu": ("nppc",), 

79 "nppitc": ("nppc",), 

80 "npps": ("nppc",), 

81 "nvblas": ("cublas", "cublasLt"), 

82} 

83DIRECT_DEPENDENCIES = DIRECT_DEPENDENCIES_CTK | { 

84 "mathdx": ("nvrtc",), 

85 "cublasmp": ("cublas", "cublasLt", "nvshmem_host"), 

86 "cufftMp": ("nvshmem_host",), 

87 "cudss": ("cublas", "cublasLt"), 

88 "cutensor": ("cublasLt",), 

89 "cutensorMg": ("cutensor", "cublasLt"), 

90} 

91 

92# Based on these files: 

93# cuda_12.0.1_525.85.12_linux.run 

94# cuda_12.1.1_530.30.02_linux.run 

95# cuda_12.2.2_535.104.05_linux.run 

96# cuda_12.3.2_545.23.08_linux.run 

97# cuda_12.4.1_550.54.15_linux.run 

98# cuda_12.5.1_555.42.06_linux.run 

99# cuda_12.6.3_560.35.05_linux.run 

100# cuda_12.8.1_570.124.06_linux.run 

101# cuda_12.9.1_575.57.08_linux.run 

102# cuda_13.0.2_580.95.05_linux.run 

103# cuda_13.1.0_590.44.01_linux.run 

104# Generated with toolshed/build_pathfinder_sonames.py 

105# Please keep in old → new sort order. 

106SUPPORTED_LINUX_SONAMES_CTK = { 

107 "cublas": ( 

108 "libcublas.so.12", 

109 "libcublas.so.13", 

110 ), 

111 "cublasLt": ( 

112 "libcublasLt.so.12", 

113 "libcublasLt.so.13", 

114 ), 

115 "cudart": ( 

116 "libcudart.so.12", 

117 "libcudart.so.13", 

118 ), 

119 "cufft": ( 

120 "libcufft.so.11", 

121 "libcufft.so.12", 

122 ), 

123 "cufftw": ( 

124 "libcufftw.so.11", 

125 "libcufftw.so.12", 

126 ), 

127 "cufile": ("libcufile.so.0",), 

128 # "cufile_rdma": ("libcufile_rdma.so.1",), 

129 "curand": ("libcurand.so.10",), 

130 "cusolver": ( 

131 "libcusolver.so.11", 

132 "libcusolver.so.12", 

133 ), 

134 "cusolverMg": ( 

135 "libcusolverMg.so.11", 

136 "libcusolverMg.so.12", 

137 ), 

138 "cusparse": ("libcusparse.so.12",), 

139 "nppc": ( 

140 "libnppc.so.12", 

141 "libnppc.so.13", 

142 ), 

143 "nppial": ( 

144 "libnppial.so.12", 

145 "libnppial.so.13", 

146 ), 

147 "nppicc": ( 

148 "libnppicc.so.12", 

149 "libnppicc.so.13", 

150 ), 

151 "nppidei": ( 

152 "libnppidei.so.12", 

153 "libnppidei.so.13", 

154 ), 

155 "nppif": ( 

156 "libnppif.so.12", 

157 "libnppif.so.13", 

158 ), 

159 "nppig": ( 

160 "libnppig.so.12", 

161 "libnppig.so.13", 

162 ), 

163 "nppim": ( 

164 "libnppim.so.12", 

165 "libnppim.so.13", 

166 ), 

167 "nppist": ( 

168 "libnppist.so.12", 

169 "libnppist.so.13", 

170 ), 

171 "nppisu": ( 

172 "libnppisu.so.12", 

173 "libnppisu.so.13", 

174 ), 

175 "nppitc": ( 

176 "libnppitc.so.12", 

177 "libnppitc.so.13", 

178 ), 

179 "npps": ( 

180 "libnpps.so.12", 

181 "libnpps.so.13", 

182 ), 

183 "nvJitLink": ( 

184 "libnvJitLink.so.12", 

185 "libnvJitLink.so.13", 

186 ), 

187 "nvblas": ( 

188 "libnvblas.so.12", 

189 "libnvblas.so.13", 

190 ), 

191 "nvfatbin": ( 

192 "libnvfatbin.so.12", 

193 "libnvfatbin.so.13", 

194 ), 

195 "nvjpeg": ( 

196 "libnvjpeg.so.12", 

197 "libnvjpeg.so.13", 

198 ), 

199 "nvrtc": ( 

200 "libnvrtc.so.12", 

201 "libnvrtc.so.13", 

202 ), 

203 "nvvm": ("libnvvm.so.4",), 

204} 

205SUPPORTED_LINUX_SONAMES_OTHER = { 

206 "cublasmp": ("libcublasmp.so.0",), 

207 "cufftMp": ("libcufftMp.so.12", "libcufftMp.so.11"), 

208 "mathdx": ("libmathdx.so.0",), 

209 "cudss": ("libcudss.so.0",), 

210 "cusparseLt": ("libcusparseLt.so.0",), 

211 "cutensor": ("libcutensor.so.2",), 

212 "cutensorMg": ("libcutensorMg.so.2",), 

213 "nccl": ("libnccl.so.2",), 

214 "nvpl_fftw": ("libnvpl_fftw.so.0",), 

215 "nvshmem_host": ("libnvshmem_host.so.3",), 

216} 

217SUPPORTED_LINUX_SONAMES = SUPPORTED_LINUX_SONAMES_CTK | SUPPORTED_LINUX_SONAMES_OTHER 

218 

219# Based on these files: 

220# cuda_12.0.1_528.33_windows.exe 

221# cuda_12.1.1_531.14_windows.exe 

222# cuda_12.2.2_537.13_windows.exe 

223# cuda_12.3.2_546.12_windows.exe 

224# cuda_12.4.1_551.78_windows.exe 

225# cuda_12.5.1_555.85_windows.exe 

226# cuda_12.6.3_561.17_windows.exe 

227# cuda_12.8.1_572.61_windows.exe 

228# cuda_12.9.1_576.57_windows.exe 

229# cuda_13.0.2_windows.exe 

230# cuda_13.1.0_windows.exe 

231# Generated with toolshed/build_pathfinder_dlls.py 

232# Please keep in old → new sort order. 

233SUPPORTED_WINDOWS_DLLS_CTK = { 

234 "cublas": ( 

235 "cublas64_12.dll", 

236 "cublas64_13.dll", 

237 ), 

238 "cublasLt": ( 

239 "cublasLt64_12.dll", 

240 "cublasLt64_13.dll", 

241 ), 

242 "cudart": ( 

243 "cudart64_12.dll", 

244 "cudart64_13.dll", 

245 ), 

246 "cufft": ( 

247 "cufft64_11.dll", 

248 "cufft64_12.dll", 

249 ), 

250 "cufftw": ( 

251 "cufftw64_11.dll", 

252 "cufftw64_12.dll", 

253 ), 

254 "curand": ("curand64_10.dll",), 

255 "cusolver": ( 

256 "cusolver64_11.dll", 

257 "cusolver64_12.dll", 

258 ), 

259 "cusolverMg": ( 

260 "cusolverMg64_11.dll", 

261 "cusolverMg64_12.dll", 

262 ), 

263 "cusparse": ("cusparse64_12.dll",), 

264 "nppc": ( 

265 "nppc64_12.dll", 

266 "nppc64_13.dll", 

267 ), 

268 "nppial": ( 

269 "nppial64_12.dll", 

270 "nppial64_13.dll", 

271 ), 

272 "nppicc": ( 

273 "nppicc64_12.dll", 

274 "nppicc64_13.dll", 

275 ), 

276 "nppidei": ( 

277 "nppidei64_12.dll", 

278 "nppidei64_13.dll", 

279 ), 

280 "nppif": ( 

281 "nppif64_12.dll", 

282 "nppif64_13.dll", 

283 ), 

284 "nppig": ( 

285 "nppig64_12.dll", 

286 "nppig64_13.dll", 

287 ), 

288 "nppim": ( 

289 "nppim64_12.dll", 

290 "nppim64_13.dll", 

291 ), 

292 "nppist": ( 

293 "nppist64_12.dll", 

294 "nppist64_13.dll", 

295 ), 

296 "nppisu": ( 

297 "nppisu64_12.dll", 

298 "nppisu64_13.dll", 

299 ), 

300 "nppitc": ( 

301 "nppitc64_12.dll", 

302 "nppitc64_13.dll", 

303 ), 

304 "npps": ( 

305 "npps64_12.dll", 

306 "npps64_13.dll", 

307 ), 

308 "nvJitLink": ( 

309 "nvJitLink_120_0.dll", 

310 "nvJitLink_130_0.dll", 

311 ), 

312 "nvblas": ( 

313 "nvblas64_12.dll", 

314 "nvblas64_13.dll", 

315 ), 

316 "nvfatbin": ( 

317 "nvfatbin_120_0.dll", 

318 "nvfatbin_130_0.dll", 

319 ), 

320 "nvjpeg": ( 

321 "nvjpeg64_12.dll", 

322 "nvjpeg64_13.dll", 

323 ), 

324 "nvrtc": ( 

325 "nvrtc64_120_0.dll", 

326 "nvrtc64_130_0.dll", 

327 ), 

328 "nvvm": ( 

329 "nvvm64.dll", 

330 "nvvm64_40_0.dll", 

331 "nvvm70.dll", 

332 ), 

333} 

334SUPPORTED_WINDOWS_DLLS_OTHER = { 

335 "mathdx": ("mathdx64_0.dll",), 

336 "cudss": ("cudss64_0.dll",), 

337 "cusparseLt": ("cusparseLt.dll",), 

338 "cutensor": ("cutensor.dll",), 

339 "cutensorMg": ("cutensorMg.dll",), 

340} 

341SUPPORTED_WINDOWS_DLLS = SUPPORTED_WINDOWS_DLLS_CTK | SUPPORTED_WINDOWS_DLLS_OTHER 

342 

343LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY = ( 

344 "cufft", 

345 "nvrtc", 

346) 

347 

348LIBNAMES_REQUIRING_RTLD_DEEPBIND = ("cufftMp",) 

349 

350# Based on output of toolshed/make_site_packages_libdirs_linux.py 

351SITE_PACKAGES_LIBDIRS_LINUX_CTK = { 

352 "cublas": ("nvidia/cu13/lib", "nvidia/cublas/lib"), 

353 "cublasLt": ("nvidia/cu13/lib", "nvidia/cublas/lib"), 

354 "cudart": ("nvidia/cu13/lib", "nvidia/cuda_runtime/lib"), 

355 "cufft": ("nvidia/cu13/lib", "nvidia/cufft/lib"), 

356 "cufftw": ("nvidia/cu13/lib", "nvidia/cufft/lib"), 

357 "cufile": ("nvidia/cu13/lib", "nvidia/cufile/lib"), 

358 # "cufile_rdma": ("nvidia/cu13/lib", "nvidia/cufile/lib"), 

359 "curand": ("nvidia/cu13/lib", "nvidia/curand/lib"), 

360 "cusolver": ("nvidia/cu13/lib", "nvidia/cusolver/lib"), 

361 "cusolverMg": ("nvidia/cu13/lib", "nvidia/cusolver/lib"), 

362 "cusparse": ("nvidia/cu13/lib", "nvidia/cusparse/lib"), 

363 "nppc": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

364 "nppial": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

365 "nppicc": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

366 "nppidei": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

367 "nppif": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

368 "nppig": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

369 "nppim": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

370 "nppist": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

371 "nppisu": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

372 "nppitc": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

373 "npps": ("nvidia/cu13/lib", "nvidia/npp/lib"), 

374 "nvJitLink": ("nvidia/cu13/lib", "nvidia/nvjitlink/lib"), 

375 "nvblas": ("nvidia/cu13/lib", "nvidia/cublas/lib"), 

376 "nvfatbin": ("nvidia/cu13/lib", "nvidia/nvfatbin/lib"), 

377 "nvjpeg": ("nvidia/cu13/lib", "nvidia/nvjpeg/lib"), 

378 "nvrtc": ("nvidia/cu13/lib", "nvidia/cuda_nvrtc/lib"), 

379 "nvvm": ("nvidia/cu13/lib", "nvidia/cuda_nvcc/nvvm/lib64"), 

380} 

381SITE_PACKAGES_LIBDIRS_LINUX_OTHER = { 

382 "cublasmp": ("nvidia/cublasmp/cu13/lib", "nvidia/cublasmp/cu12/lib"), 

383 "cudss": ("nvidia/cu13/lib", "nvidia/cu12/lib"), 

384 "cufftMp": ("nvidia/cufftmp/cu13/lib", "nvidia/cufftmp/cu12/lib"), 

385 "cusparseLt": ("nvidia/cusparselt/lib",), 

386 "cutensor": ("cutensor/lib",), 

387 "cutensorMg": ("cutensor/lib",), 

388 "mathdx": ("nvidia/cu13/lib", "nvidia/cu12/lib"), 

389 "nccl": ("nvidia/nccl/lib",), 

390 "nvpl_fftw": ("nvpl/lib",), 

391 "nvshmem_host": ("nvidia/nvshmem/lib",), 

392} 

393SITE_PACKAGES_LIBDIRS_LINUX = SITE_PACKAGES_LIBDIRS_LINUX_CTK | SITE_PACKAGES_LIBDIRS_LINUX_OTHER 

394 

395# Based on output of toolshed/make_site_packages_libdirs_windows.py 

396SITE_PACKAGES_LIBDIRS_WINDOWS_CTK = { 

397 "cublas": ("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), 

398 "cublasLt": ("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), 

399 "cudart": ("nvidia/cu13/bin/x86_64", "nvidia/cuda_runtime/bin"), 

400 "cufft": ("nvidia/cu13/bin/x86_64", "nvidia/cufft/bin"), 

401 "cufftw": ("nvidia/cu13/bin/x86_64", "nvidia/cufft/bin"), 

402 "curand": ("nvidia/cu13/bin/x86_64", "nvidia/curand/bin"), 

403 "cusolver": ("nvidia/cu13/bin/x86_64", "nvidia/cusolver/bin"), 

404 "cusolverMg": ("nvidia/cu13/bin/x86_64", "nvidia/cusolver/bin"), 

405 "cusparse": ("nvidia/cu13/bin/x86_64", "nvidia/cusparse/bin"), 

406 "nppc": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

407 "nppial": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

408 "nppicc": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

409 "nppidei": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

410 "nppif": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

411 "nppig": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

412 "nppim": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

413 "nppist": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

414 "nppisu": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

415 "nppitc": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

416 "npps": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), 

417 "nvJitLink": ("nvidia/cu13/bin/x86_64", "nvidia/nvjitlink/bin"), 

418 "nvblas": ("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), 

419 "nvfatbin": ("nvidia/cu13/bin/x86_64", "nvidia/nvfatbin/bin"), 

420 "nvjpeg": ("nvidia/cu13/bin/x86_64", "nvidia/nvjpeg/bin"), 

421 "nvrtc": ("nvidia/cu13/bin/x86_64", "nvidia/cuda_nvrtc/bin"), 

422 "nvvm": ("nvidia/cu13/bin/x86_64", "nvidia/cuda_nvcc/nvvm/bin"), 

423} 

424SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER = { 

425 "cudss": ("nvidia/cu13/bin", "nvidia/cu12/bin"), 

426 "mathdx": ("nvidia/cu13/bin/x86_64", "nvidia/cu12/bin"), 

427 "cusparseLt": ("nvidia/cusparselt/bin",), 

428 "cutensor": ("cutensor/bin",), 

429 "cutensorMg": ("cutensor/bin",), 

430} 

431SITE_PACKAGES_LIBDIRS_WINDOWS = SITE_PACKAGES_LIBDIRS_WINDOWS_CTK | SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER 

432 

433 

434def is_suppressed_dll_file(path_basename: str) -> bool: 

435 if path_basename.startswith("nvrtc"): 

436 # nvidia_cuda_nvrtc_cu12-12.8.93-py3-none-win_amd64.whl: 

437 # nvidia\cuda_nvrtc\bin\ 

438 # nvrtc-builtins64_128.dll 

439 # nvrtc64_120_0.alt.dll 

440 # nvrtc64_120_0.dll 

441 return path_basename.endswith(".alt.dll") or "-builtins" in path_basename 

442 return path_basename.startswith(("cudart32_", "nvvm32"))