Coverage for cuda / pathfinder / _dynamic_libs / supported_nvidia_libs.py: 100.00%
36 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-08 01:07 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-08 01:07 +0000
1# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2# SPDX-License-Identifier: Apache-2.0
4"""Legacy table exports derived from the authored descriptor catalog.
6The canonical data entry point is :mod:`descriptor_catalog`. This module keeps
7historical constant names for backward compatibility by deriving them from the
8catalog.
9"""
11from __future__ import annotations
13from cuda.pathfinder._dynamic_libs.descriptor_catalog import DESCRIPTOR_CATALOG
14from cuda.pathfinder._utils.platform_aware import IS_WINDOWS
16_CTK_DESCRIPTORS = tuple(desc for desc in DESCRIPTOR_CATALOG if desc.packaged_with == "ctk")
17_OTHER_DESCRIPTORS = tuple(desc for desc in DESCRIPTOR_CATALOG if desc.packaged_with == "other")
18_DRIVER_DESCRIPTORS = tuple(desc for desc in DESCRIPTOR_CATALOG if desc.packaged_with == "driver")
19_NON_CTK_DESCRIPTORS = _OTHER_DESCRIPTORS + _DRIVER_DESCRIPTORS
21SUPPORTED_LIBNAMES_COMMON = tuple(desc.name for desc in _CTK_DESCRIPTORS if desc.linux_sonames and desc.windows_dlls)
22SUPPORTED_LIBNAMES_LINUX_ONLY = tuple(
23 desc.name for desc in _CTK_DESCRIPTORS if desc.linux_sonames and not desc.windows_dlls
24)
25SUPPORTED_LIBNAMES_WINDOWS_ONLY = tuple(
26 desc.name for desc in _CTK_DESCRIPTORS if desc.windows_dlls and not desc.linux_sonames
27)
29SUPPORTED_LIBNAMES_LINUX = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_LINUX_ONLY
30SUPPORTED_LIBNAMES_WINDOWS = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_WINDOWS_ONLY
31SUPPORTED_LIBNAMES_ALL = SUPPORTED_LIBNAMES_COMMON + SUPPORTED_LIBNAMES_LINUX_ONLY + SUPPORTED_LIBNAMES_WINDOWS_ONLY
32SUPPORTED_LIBNAMES = SUPPORTED_LIBNAMES_WINDOWS if IS_WINDOWS else SUPPORTED_LIBNAMES_LINUX
34DIRECT_DEPENDENCIES_CTK = {desc.name: desc.dependencies for desc in _CTK_DESCRIPTORS if desc.dependencies}
35DIRECT_DEPENDENCIES = {desc.name: desc.dependencies for desc in DESCRIPTOR_CATALOG if desc.dependencies}
37SUPPORTED_LINUX_SONAMES_CTK = {desc.name: desc.linux_sonames for desc in _CTK_DESCRIPTORS if desc.linux_sonames}
38SUPPORTED_LINUX_SONAMES_OTHER = {desc.name: desc.linux_sonames for desc in _OTHER_DESCRIPTORS if desc.linux_sonames}
39SUPPORTED_LINUX_SONAMES_DRIVER = {desc.name: desc.linux_sonames for desc in _DRIVER_DESCRIPTORS if desc.linux_sonames}
40SUPPORTED_LINUX_SONAMES = SUPPORTED_LINUX_SONAMES_CTK | SUPPORTED_LINUX_SONAMES_OTHER | SUPPORTED_LINUX_SONAMES_DRIVER
42SUPPORTED_WINDOWS_DLLS_CTK = {desc.name: desc.windows_dlls for desc in _CTK_DESCRIPTORS if desc.windows_dlls}
43SUPPORTED_WINDOWS_DLLS_OTHER = {desc.name: desc.windows_dlls for desc in _OTHER_DESCRIPTORS if desc.windows_dlls}
44SUPPORTED_WINDOWS_DLLS_DRIVER = {desc.name: desc.windows_dlls for desc in _DRIVER_DESCRIPTORS if desc.windows_dlls}
45SUPPORTED_WINDOWS_DLLS = SUPPORTED_WINDOWS_DLLS_CTK | SUPPORTED_WINDOWS_DLLS_OTHER | SUPPORTED_WINDOWS_DLLS_DRIVER
47LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY = tuple(
48 desc.name for desc in DESCRIPTOR_CATALOG if desc.requires_add_dll_directory and desc.windows_dlls
49)
50LIBNAMES_REQUIRING_RTLD_DEEPBIND = tuple(
51 desc.name for desc in DESCRIPTOR_CATALOG if desc.requires_rtld_deepbind and desc.linux_sonames
52)
54# Based on output of toolshed/make_site_packages_libdirs_linux.py
55SITE_PACKAGES_LIBDIRS_LINUX_CTK = {
56 desc.name: desc.site_packages_linux for desc in _CTK_DESCRIPTORS if desc.site_packages_linux
57}
58SITE_PACKAGES_LIBDIRS_LINUX_OTHER = {
59 desc.name: desc.site_packages_linux for desc in _NON_CTK_DESCRIPTORS if desc.site_packages_linux
60}
61SITE_PACKAGES_LIBDIRS_LINUX = SITE_PACKAGES_LIBDIRS_LINUX_CTK | SITE_PACKAGES_LIBDIRS_LINUX_OTHER
63SITE_PACKAGES_LIBDIRS_WINDOWS_CTK = {
64 desc.name: desc.site_packages_windows for desc in _CTK_DESCRIPTORS if desc.site_packages_windows
65}
66SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER = {
67 desc.name: desc.site_packages_windows for desc in _NON_CTK_DESCRIPTORS if desc.site_packages_windows
68}
69SITE_PACKAGES_LIBDIRS_WINDOWS = SITE_PACKAGES_LIBDIRS_WINDOWS_CTK | SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER
72def is_suppressed_dll_file(path_basename: str) -> bool:
73 if path_basename.startswith("nvrtc"): 1abcdefghi
74 # nvidia_cuda_nvrtc_cu12-12.8.93-py3-none-win_amd64.whl:
75 # nvidia\cuda_nvrtc\bin\
76 # nvrtc-builtins64_128.dll
77 # nvrtc64_120_0.alt.dll
78 # nvrtc64_120_0.dll
79 return path_basename.endswith(".alt.dll") or "-builtins" in path_basename
80 return path_basename.startswith(("cudart32_", "nvvm32")) 1abcdefghi