Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,17 @@ class DescriptorSpec:
dependencies=("nvshmem_host",),
requires_rtld_deepbind=True,
),
DescriptorSpec(
name="cudnn",
packaged_with="other",
linux_sonames=("libcudnn.so.9",),
windows_dlls=("cudnn64_9.dll",),
supported_windows_arch=("x64",),
site_packages_linux=("nvidia/cudnn/lib",),
site_packages_windows=WindowsSearchDirs.x64_only("nvidia/cudnn/bin"),
anchor_rel_dirs_windows=WindowsSearchDirs.x64_only("bin/x64", "bin"),
requires_add_dll_directory=True,
),
DescriptorSpec(
name="cusolverMp",
packaged_with="other",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ class HeaderDescriptorSpec:
# -----------------------------------------------------------------------
# Third-party / separately packaged headers
# -----------------------------------------------------------------------
HeaderDescriptorSpec(
name="cudnn",
packaged_with="other",
header_basename="cudnn.h",
site_packages_dirs=("nvidia/cudnn/include",),
conda_targets_layout=False,
use_ctk_root_canary=False,
),
HeaderDescriptorSpec(
name="cusolverMp",
packaged_with="other",
Expand Down Expand Up @@ -244,6 +252,15 @@ class HeaderDescriptorSpec:
conda_targets_layout=False,
use_ctk_root_canary=False,
),
HeaderDescriptorSpec(
name="nccl",
packaged_with="other",
header_basename="nccl.h",
site_packages_dirs=("nvidia/nccl/include",),
available_on_windows=False,
conda_targets_layout=False,
use_ctk_root_canary=False,
),
HeaderDescriptorSpec(
name="nvshmem",
packaged_with="other",
Expand Down
2 changes: 2 additions & 0 deletions cuda_pathfinder/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cu12 = [
"cuquantum-cu12; sys_platform != 'win32'",
"cutensor-cu12",
"nvidia-cublasmp-cu12; sys_platform != 'win32'",
"nvidia-cudnn-cu12",
"nvidia-cudss-cu12",
"nvidia-cufftmp-cu12; sys_platform != 'win32'",
"nvidia-cusolvermp-cu12; sys_platform != 'win32'",
Expand All @@ -39,6 +40,7 @@ cu13 = [
"cutensor-cu13",
"nvidia-cublasmp-cu13; sys_platform != 'win32'",
"nvidia-cudla; platform_system == 'Linux' and platform_machine == 'aarch64'",
"nvidia-cudnn-cu13",
"nvidia-cudss-cu13",
"nvidia-cufftmp-cu13; sys_platform != 'win32'",
"nvidia-cusolvermp-cu13; sys_platform != 'win32'",
Expand Down
14 changes: 14 additions & 0 deletions cuda_pathfinder/tests/test_descriptor_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ def test_cusparselt_windows_metadata_matches_wheel_layouts():
)


@pytest.mark.agent_authored(model="gpt-5")
def test_cudnn_metadata_matches_wheel_layouts():
spec = _CATALOG_BY_NAME["cudnn"]
assert spec.packaged_with == "other"
assert spec.linux_sonames == ("libcudnn.so.9",)
assert spec.windows_dlls == ("cudnn64_9.dll",)
assert spec.supported_windows_arch == ("x64",)
assert spec.site_packages_linux == ("nvidia/cudnn/lib",)
assert spec.site_packages_windows == WindowsSearchDirs.x64_only("nvidia/cudnn/bin")
assert spec.anchor_rel_dirs_windows == WindowsSearchDirs.x64_only("bin/x64", "bin")
assert spec.dependencies == ()
assert spec.requires_add_dll_directory


@pytest.mark.parametrize("spec", DESCRIPTOR_CATALOG, ids=lambda s: s.name)
def test_ctk_root_canary_anchors_reference_known_ctk_libs(spec: DescriptorSpec):
for anchor in spec.ctk_root_canary_anchor_libnames:
Expand Down
22 changes: 22 additions & 0 deletions cuda_pathfinder/tests/test_find_nvidia_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import (
_resolve_system_loaded_abs_path_in_subprocess,
)
from cuda.pathfinder._headers.header_descriptor import HEADER_DESCRIPTORS
from cuda.pathfinder._headers.supported_nvidia_headers import (
SUPPORTED_HEADERS_CTK,
SUPPORTED_HEADERS_CTK_ALL,
Expand All @@ -43,6 +44,7 @@

NON_CTK_IMPORTLIB_METADATA_DISTRIBUTIONS_NAMES = {
"cudensitymat": r"^cudensitymat-.*$",
"cudnn": r"^nvidia-cudnn-.*$",
"cupauliprop": r"^cupauliprop-.*$",
"cusolverMp": r"^nvidia-cusolvermp-.*$",
"cusparseLt": r"^nvidia-cusparselt-.*$",
Expand All @@ -53,6 +55,7 @@
"custatevec": r"^custatevec-.*$",
"cutlass": r"^nvidia-cutlass$",
"mathdx": r"^nvidia-libmathdx-.*$",
"nccl": r"^nvidia-nccl-.*$",
"nvshmem": r"^nvidia-nvshmem-.*$",
}

Expand All @@ -78,6 +81,25 @@ def test_non_ctk_importlib_metadata_distributions_names():
assert sorted(NON_CTK_IMPORTLIB_METADATA_DISTRIBUTIONS_NAMES) == sorted(SUPPORTED_HEADERS_NON_CTK_ALL)


@pytest.mark.agent_authored(model="gpt-5")
def test_cudnn_and_nccl_header_metadata_matches_wheel_layouts():
cudnn = HEADER_DESCRIPTORS["cudnn"]
assert cudnn.header_basename == "cudnn.h"
assert cudnn.site_packages_dirs == ("nvidia/cudnn/include",)
assert cudnn.available_on_linux
assert cudnn.available_on_windows
assert not cudnn.conda_targets_layout
assert not cudnn.use_ctk_root_canary

nccl = HEADER_DESCRIPTORS["nccl"]
assert nccl.header_basename == "nccl.h"
assert nccl.site_packages_dirs == ("nvidia/nccl/include",)
assert nccl.available_on_linux
assert not nccl.available_on_windows
assert not nccl.conda_targets_layout
assert not nccl.use_ctk_root_canary


@functools.cache
def have_distribution_for(libname: str) -> bool:
pattern = re.compile(NON_CTK_IMPORTLIB_METADATA_DISTRIBUTIONS_NAMES[libname])
Expand Down
1 change: 1 addition & 0 deletions toolshed/conda_create_for_pathfinder_testing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ conda activate "pathfinder_testing_cu$CudaMajorMinorPatch"
# Keep this list aligned with the Windows-installable subset of
# cuda_pathfinder/pyproject.toml.
$cpkgs = @(
"cudnn",
"cusparselt-dev",
"cutensor",
"cutlass",
Expand Down
2 changes: 2 additions & 0 deletions toolshed/conda_create_for_pathfinder_testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ set -u
# cuda_pathfinder/pyproject.toml.
cpkgs=(
"cuquantum"
"cudnn"
"cusparselt-dev"
"cutensor"
"cutlass"
Expand All @@ -34,6 +35,7 @@ cpkgs=(
"libcufftmp-dev"
"libcusolvermp-dev"
"libmathdx-dev"
"nccl"
"libnvshmem3"
"libnvshmem-dev"
)
Expand Down