From ff3775be447d1fd25866da919dcebac10ea856be Mon Sep 17 00:00:00 2001 From: prewaskar-nv <273072399+prewaskar-nv@users.noreply.github.com> Date: Wed, 18 Nov 2026 14:42:10 +0530 Subject: [PATCH 1/4] fix(pathfinder): find cuDNN in the Windows Arm64 wheel The nvidia-cudnn-cu13 win_arm64 wheel installs cudnn64_9.dll and its sub-libraries in nvidia/cudnn/bin, the same directory as the win_amd64 wheel (checked for 9.28.0.42 and 9.28.1.4). The cuDNN descriptor listed that site-packages directory for x64 only, so on Windows Arm64 load_nvidia_dynamic_lib("cudnn") skipped the wheel and could only find cuDNN through CUDNN_PATH/bin/arm64. List nvidia/cudnn/bin for arm64 as well. Conda, CUDA_PATH, and Program Files stay x64-only on Windows Arm64. Signed-off-by: Pawan Rewaskar <273072399+prewaskar-nv@users.noreply.github.com> --- .../_dynamic_libs/descriptor_catalog.py | 10 +++++++--- cuda_pathfinder/docs/nv-versions.json | 4 ++++ .../tests/test_descriptor_catalog.py | 5 ++++- cuda_pathfinder/tests/test_search_steps.py | 18 +++++++++++++++++- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py index 5d9bb3e363e..c1ef7ad76f3 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py @@ -430,13 +430,17 @@ class DescriptorSpec: windows_dlls=("cudnn64_9.dll",), supported_windows_arch=("x64", "arm64"), site_packages_linux=("nvidia/cudnn/lib",), - site_packages_windows=WindowsSearchDirs.x64_only("nvidia/cudnn/bin"), + site_packages_windows=WindowsSearchDirs( + x64=("nvidia/cudnn/bin",), + arm64=("nvidia/cudnn/bin",), + ), dependencies=("cublasLt",), optional_dependencies=("nvrtc",), install_root_env_vars_linux=("CUDNN_PATH",), install_root_env_rel_dirs_linux=("lib", "lib64"), - # The ARM64 layout is verified only for the standalone archive rooted - # at CUDNN_PATH, not for conda, CUDA_PATH, or Program Files installs. + # The ARM64 layouts are verified only for the nvidia-cudnn-cu13 wheel and + # the standalone archive rooted at CUDNN_PATH, not for conda, CUDA_PATH, + # or Program Files installs. anchor_rel_dirs_windows=WindowsSearchDirs.x64_only("bin/x64", "bin"), install_root_env_vars_windows=("CUDNN_PATH",), install_root_env_rel_dirs_windows=WindowsSearchDirs( diff --git a/cuda_pathfinder/docs/nv-versions.json b/cuda_pathfinder/docs/nv-versions.json index 2adde8cc61f..e3e66a4df58 100644 --- a/cuda_pathfinder/docs/nv-versions.json +++ b/cuda_pathfinder/docs/nv-versions.json @@ -3,6 +3,10 @@ "version": "latest", "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/" }, + { + "version": "1.9.1", + "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.9.1/" + }, { "version": "1.9.0", "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.9.0/" diff --git a/cuda_pathfinder/tests/test_descriptor_catalog.py b/cuda_pathfinder/tests/test_descriptor_catalog.py index 835e7572ef0..ae77123b8b3 100644 --- a/cuda_pathfinder/tests/test_descriptor_catalog.py +++ b/cuda_pathfinder/tests/test_descriptor_catalog.py @@ -164,7 +164,10 @@ def test_cudnn_metadata_matches_supported_layouts(): assert spec.windows_dlls == ("cudnn64_9.dll",) assert spec.supported_windows_arch == ("x64", "arm64") assert spec.site_packages_linux == ("nvidia/cudnn/lib",) - assert spec.site_packages_windows == WindowsSearchDirs.x64_only("nvidia/cudnn/bin") + assert spec.site_packages_windows == WindowsSearchDirs( + x64=("nvidia/cudnn/bin",), + arm64=("nvidia/cudnn/bin",), + ) assert spec.anchor_rel_dirs_windows == WindowsSearchDirs.x64_only("bin/x64", "bin") assert spec.dependencies == ("cublasLt",) assert spec.optional_dependencies == ("nvrtc",) diff --git a/cuda_pathfinder/tests/test_search_steps.py b/cuda_pathfinder/tests/test_search_steps.py index af752643f10..a7df97b5218 100644 --- a/cuda_pathfinder/tests/test_search_steps.py +++ b/cuda_pathfinder/tests/test_search_steps.py @@ -471,6 +471,22 @@ def test_found_windows_arm64_skips_cuda12_when_cuda13_is_absent(self, mocker, tm assert result is None + @pytest.mark.agent_authored(model="claude-opus-5.5") + def test_found_windows_arm64_cudnn_wheel(self, mocker, tmp_path): + wheel_dir = tmp_path / "nvidia" / "cudnn" / "bin" + wheel_dir.mkdir(parents=True) + cudnn_dll = wheel_dir / "cudnn64_9.dll" + cudnn_dll.touch() + + _patch_site_packages_search(mocker, tmp_path) + mocker.patch(f"{_PLAT_MOD}.is_suppressed_dll_file", return_value=False) + + desc = LIB_DESCRIPTORS["cudnn"] + result = find_in_site_packages(_ctx(desc, platform=WindowsSearchPlatform(target_arch="arm64"))) + assert result is not None + assert result.abs_path == str(cudnn_dll) + assert result.found_via == "site-packages" + def test_not_found_appends_error(self, mocker, tmp_path): empty_dir = tmp_path / "nvidia" / "cuda_runtime" / "lib" empty_dir.mkdir(parents=True) @@ -899,7 +915,7 @@ def test_cudnn_arm64_archive_layout_is_not_assumed_for_other_roots(self, mocker, assert find_in_conda(ctx) is None assert find_in_cuda_path(ctx) is None assert find_in_program_files_roots(ctx) is None - assert ctx.platform.site_packages_rel_dirs(ctx.desc) == () + assert ctx.platform.site_packages_rel_dirs(ctx.desc) == ("nvidia/cudnn/bin",) # --------------------------------------------------------------------------- From d7a01a38edb8420aa8695851e54cfd776f9e6666 Mon Sep 17 00:00:00 2001 From: prewaskar-nv <273072399+prewaskar-nv@users.noreply.github.com> Date: Wed, 18 Nov 2026 14:44:49 +0530 Subject: [PATCH 2/4] docs(pathfinder): add 1.9.1 release notes for the cuDNN Arm64 wheel Signed-off-by: Pawan Rewaskar <273072399+prewaskar-nv@users.noreply.github.com> --- .../docs/source/release/1.9.1-notes.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 cuda_pathfinder/docs/source/release/1.9.1-notes.rst diff --git a/cuda_pathfinder/docs/source/release/1.9.1-notes.rst b/cuda_pathfinder/docs/source/release/1.9.1-notes.rst new file mode 100644 index 00000000000..9e8df568199 --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.9.1-notes.rst @@ -0,0 +1,17 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. py:currentmodule:: cuda.pathfinder + +``cuda-pathfinder`` 1.9.1 Release notes +======================================= + +Highlights +---------- + +* Find cuDNN installed from the ``nvidia-cudnn-cu13`` Windows Arm64 wheel. + The wheel places ``cudnn64_9.dll`` in ``nvidia/cudnn/bin``, the same + directory as the x64 wheel, which ``load_nvidia_dynamic_lib("cudnn")`` + previously searched on x64 only. Conda, ``CUDA_PATH``, and Program Files + installs remain x64-only on Windows Arm64. + (`PR #3489 `_) From c658d926ef6841c0bf7d50a7d71c681e6f58da60 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 18 Nov 2026 12:50:57 -0800 Subject: [PATCH 3/4] fix(pathfinder): skip incompatible Windows cuDNN DLLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit — codex GPT-6 on behalf of Ralf — Check the PE architecture before selecting cuDNN from a shared wheel location so discovery can continue to a compatible installation. Cover matching x64 and Arm64 wheels and fallback from an x64 wheel to an Arm64 archive. Update synthetic DLL fixtures for architecture validation. --- .../_dynamic_libs/descriptor_catalog.py | 3 ++ .../docs/source/release/1.9.1-notes.rst | 6 ++- .../tests/test_descriptor_catalog.py | 4 +- ...st_load_nvidia_dynamic_lib_using_mocker.py | 1 + cuda_pathfinder/tests/test_search_steps.py | 49 +++++++++++++------ 5 files changed, 44 insertions(+), 19 deletions(-) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py index c1ef7ad76f3..3edd35c4c71 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py @@ -429,6 +429,9 @@ class DescriptorSpec: linux_sonames=("libcudnn.so.9",), windows_dlls=("cudnn64_9.dll",), supported_windows_arch=("x64", "arm64"), + # Skip DLLs that do not match the running Python interpreter's architecture, + # allowing the search to continue to a compatible installation. + requires_windows_binary_arch_check=True, site_packages_linux=("nvidia/cudnn/lib",), site_packages_windows=WindowsSearchDirs( x64=("nvidia/cudnn/bin",), diff --git a/cuda_pathfinder/docs/source/release/1.9.1-notes.rst b/cuda_pathfinder/docs/source/release/1.9.1-notes.rst index 9e8df568199..563d179a27f 100644 --- a/cuda_pathfinder/docs/source/release/1.9.1-notes.rst +++ b/cuda_pathfinder/docs/source/release/1.9.1-notes.rst @@ -12,6 +12,8 @@ Highlights * Find cuDNN installed from the ``nvidia-cudnn-cu13`` Windows Arm64 wheel. The wheel places ``cudnn64_9.dll`` in ``nvidia/cudnn/bin``, the same directory as the x64 wheel, which ``load_nvidia_dynamic_lib("cudnn")`` - previously searched on x64 only. Conda, ``CUDA_PATH``, and Program Files - installs remain x64-only on Windows Arm64. + previously searched on x64 only. Windows cuDNN discovery checks the DLL's + architecture so that an incompatible wheel does not prevent searching + later installation roots. Conda, ``CUDA_PATH``, and Program Files installs + remain x64-only on Windows Arm64. (`PR #3489 `_) diff --git a/cuda_pathfinder/tests/test_descriptor_catalog.py b/cuda_pathfinder/tests/test_descriptor_catalog.py index ae77123b8b3..60a77927486 100644 --- a/cuda_pathfinder/tests/test_descriptor_catalog.py +++ b/cuda_pathfinder/tests/test_descriptor_catalog.py @@ -206,7 +206,7 @@ def test_only_ctk_libs_define_ctk_root_canary_anchors(spec: DescriptorSpec): @pytest.mark.agent_authored(model="gpt-5") -def test_only_nvvm_requires_windows_binary_arch_check(): +def test_windows_binary_arch_checks_cover_architecture_neutral_layouts(): checked_libs = {spec.name for spec in DESCRIPTOR_CATALOG if spec.requires_windows_binary_arch_check} - assert checked_libs == {"nvvm"} + assert checked_libs == {"nvvm", "cudnn"} diff --git a/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib_using_mocker.py b/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib_using_mocker.py index 7c47197fffa..ff1c17ab609 100644 --- a/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib_using_mocker.py +++ b/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib_using_mocker.py @@ -61,6 +61,7 @@ def test_cudnn_arm64_archive_layout_reaches_loader(tmp_path, mocker, monkeypatch dll.touch() monkeypatch.delenv("CONDA_PREFIX", raising=False) monkeypatch.setenv("CUDNN_PATH", str(tmp_path)) + mocker.patch("cuda.pathfinder._dynamic_libs.search_platform.windows_pe_matches_arch", return_value=True) desc = load_mod.LIB_DESCRIPTORS["cudnn"] ctx = SearchContext(desc, platform=WindowsSearchPlatform(target_arch="arm64")) diff --git a/cuda_pathfinder/tests/test_search_steps.py b/cuda_pathfinder/tests/test_search_steps.py index a7df97b5218..33156411036 100644 --- a/cuda_pathfinder/tests/test_search_steps.py +++ b/cuda_pathfinder/tests/test_search_steps.py @@ -335,7 +335,7 @@ def test_found_windows(self, mocker, tmp_path): def test_windows_exact_names_reject_cudnn_sidecar(self, mocker, tmp_path): bin_dir = tmp_path / "nvidia" / "cudnn" / "bin" bin_dir.mkdir(parents=True) - (bin_dir / "cudnn_adv64_9.dll").touch() + _write_pe(bin_dir / "cudnn_adv64_9.dll", windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH["x64"]) mocker.patch( f"{_PLAT_MOD}.find_sub_dirs_all_sitepackages", @@ -471,21 +471,40 @@ def test_found_windows_arm64_skips_cuda12_when_cuda13_is_absent(self, mocker, tm assert result is None - @pytest.mark.agent_authored(model="claude-opus-5.5") - def test_found_windows_arm64_cudnn_wheel(self, mocker, tmp_path): + @pytest.mark.parametrize( + ("target_arch", "wheel_arch", "expected_source"), + ( + ("x64", "x64", "site-packages"), + ("arm64", "arm64", "site-packages"), + ("arm64", "x64", "CUDNN_PATH"), + ), + ) + @pytest.mark.agent_authored(model="gpt-6") + def test_cudnn_wheel_architecture_and_archive_fallback( + self, mocker, tmp_path, target_arch, wheel_arch, expected_source + ): wheel_dir = tmp_path / "nvidia" / "cudnn" / "bin" wheel_dir.mkdir(parents=True) cudnn_dll = wheel_dir / "cudnn64_9.dll" - cudnn_dll.touch() + _write_pe(cudnn_dll, windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH[wheel_arch]) + + archive_root = tmp_path / "archive" + archive_dll = archive_root / "bin" / target_arch / "cudnn64_9.dll" + archive_dll.parent.mkdir(parents=True) + _write_pe(archive_dll, windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH[target_arch]) + mocker.patch.dict(os.environ, {"CUDNN_PATH": str(archive_root)}) _patch_site_packages_search(mocker, tmp_path) mocker.patch(f"{_PLAT_MOD}.is_suppressed_dll_file", return_value=False) desc = LIB_DESCRIPTORS["cudnn"] - result = find_in_site_packages(_ctx(desc, platform=WindowsSearchPlatform(target_arch="arm64"))) - assert result is not None - assert result.abs_path == str(cudnn_dll) - assert result.found_via == "site-packages" + result = run_find_steps( + _ctx(desc, platform=WindowsSearchPlatform(target_arch=target_arch)), + (find_in_site_packages, find_in_install_root_env_vars), + ) + + expected_dll = cudnn_dll if expected_source == "site-packages" else archive_dll + assert result == FindResult(str(expected_dll), expected_source) def test_not_found_appends_error(self, mocker, tmp_path): empty_dir = tmp_path / "nvidia" / "cuda_runtime" / "lib" @@ -826,7 +845,7 @@ def test_cudnn_path_finds_supported_archive_layouts(self, mocker, tmp_path, targ bin_dir = tmp_path / archive_bin_rel_dir bin_dir.mkdir(parents=True) dll = bin_dir / "cudnn64_9.dll" - dll.touch() + _write_pe(dll, windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH[target_arch]) mocker.patch.dict(os.environ, {"CUDNN_PATH": str(tmp_path)}) result = find_in_install_root_env_vars( @@ -847,7 +866,7 @@ def test_cudnn_path_finds_supported_archive_layouts(self, mocker, tmp_path, targ def test_cudnn_path_does_not_cross_architectures(self, mocker, tmp_path, target_arch, other_arch_bin_rel_dir): bin_dir = tmp_path / other_arch_bin_rel_dir bin_dir.mkdir(parents=True) - (bin_dir / "cudnn64_9.dll").touch() + _write_pe(bin_dir / "cudnn64_9.dll", windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH[target_arch]) mocker.patch.dict(os.environ, {"CUDNN_PATH": str(tmp_path)}) result = find_in_install_root_env_vars( @@ -861,9 +880,9 @@ def test_program_files_finds_versioned_cudnn_install(self, mocker, tmp_path): bin_dir = tmp_path / "NVIDIA" / "CUDNN" / "v9.24" / "bin" x64_bin_dir = bin_dir / "x64" x64_bin_dir.mkdir(parents=True) - (x64_bin_dir / "cudnn_adv64_9.dll").touch() + _write_pe(x64_bin_dir / "cudnn_adv64_9.dll", windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH["x64"]) dll = bin_dir / "cudnn64_9.dll" - dll.touch() + _write_pe(dll, windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH["x64"]) mocker.patch.dict(os.environ, {"PROGRAMFILES": str(tmp_path), "PROGRAMW6432": ""}) result = find_in_program_files_roots( @@ -878,9 +897,9 @@ def test_program_files_prefers_newest_numeric_cudnn_version_across_layouts(self, newer_dir = tmp_path / "NVIDIA" / "CUDNN" / "v9.10" / "bin" older_dir.mkdir(parents=True) newer_dir.mkdir(parents=True) - (older_dir / "cudnn64_9.dll").touch() + _write_pe(older_dir / "cudnn64_9.dll", windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH["x64"]) newer_dll = newer_dir / "cudnn64_9.dll" - newer_dll.touch() + _write_pe(newer_dll, windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH["x64"]) mocker.patch.dict(os.environ, {"PROGRAMFILES": str(tmp_path), "PROGRAMW6432": ""}) result = find_in_program_files_roots( @@ -900,7 +919,7 @@ def test_cudnn_arm64_archive_layout_is_not_assumed_for_other_roots(self, mocker, program_files_root / "NVIDIA" / "CUDNN" / "v9.25" / "bin" / "arm64", ): bin_dir.mkdir(parents=True) - (bin_dir / "cudnn64_9.dll").touch() + _write_pe(bin_dir / "cudnn64_9.dll", windows_arch_mod.WINDOWS_PE_MACHINE_BY_ARCH["arm64"]) mocker.patch.dict( os.environ, { From 5e5a5cea92bb46875d748881272f830c1d171f22 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 18 Nov 2026 12:51:29 -0800 Subject: [PATCH 4/4] test(pathfinder): isolate the Arm64 cuDNN archive lookup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit — codex GPT-6 on behalf of Ralf — Hide installed wheels from the archive loader test so site-packages cannot override its temporary CUDNN_PATH installation. --- .../tests/test_load_nvidia_dynamic_lib_using_mocker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib_using_mocker.py b/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib_using_mocker.py index ff1c17ab609..70a09540678 100644 --- a/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib_using_mocker.py +++ b/cuda_pathfinder/tests/test_load_nvidia_dynamic_lib_using_mocker.py @@ -61,6 +61,7 @@ def test_cudnn_arm64_archive_layout_reaches_loader(tmp_path, mocker, monkeypatch dll.touch() monkeypatch.delenv("CONDA_PREFIX", raising=False) monkeypatch.setenv("CUDNN_PATH", str(tmp_path)) + mocker.patch("cuda.pathfinder._dynamic_libs.search_platform.find_sub_dirs_all_sitepackages", return_value=[]) mocker.patch("cuda.pathfinder._dynamic_libs.search_platform.windows_pe_matches_arch", return_value=True) desc = load_mod.LIB_DESCRIPTORS["cudnn"]