Make Windows pathfinder dynamic library searches architecture-aware - #2393
Open
isVoid wants to merge 15 commits into
Open
Make Windows pathfinder dynamic library searches architecture-aware#2393isVoid wants to merge 15 commits into
isVoid wants to merge 15 commits into
Conversation
Contributor
Contributor
Author
|
/ok to test |
Contributor
@isVoid, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
Contributor
Author
|
/ok to test 1d0a111 |
|
isVoid
force-pushed
the
codex/pathfinder-windows-arch-search-ctk-next
branch
from
July 21, 2026 16:38
1d0a111 to
3247072
Compare
Contributor
Author
|
/ok to test 3247072 |
isVoid
commented
Jul 21, 2026
| } | ||
| SITE_PACKAGES_LIBDIRS_LINUX = SITE_PACKAGES_LIBDIRS_LINUX_CTK | SITE_PACKAGES_LIBDIRS_LINUX_OTHER | ||
|
|
||
| # Historical table exports represent the original x64 catalog. |
Contributor
Author
There was a problem hiding this comment.
Q: What should we list here? Historically it's only listing the x64 catalog. But should we instead list all available items?
leofang
reviewed
Jul 21, 2026
Contributor
|
isVoid
commented
Jul 22, 2026
Contributor
Author
|
/ok to test a6348e9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This PR makes both Windows dynamic-library path sources architecture-aware:
site_packages_windowsdescribes wheel locations separately for x64 and ARM64. CUDA 13 aggregate-wheel directories are searched before CUDA 12 component-wheel directories, and CUDA 12 remains an x64-only fallback.anchor_rel_dirs_windowsdescribes locations relative to a Conda,CUDA_PATH/CUDA_HOME, or discovered system-CTK root separately for x64 and ARM64.The change introduces the immutable
WindowsSearchDirsdataclass. It stores independent, orderedx64andarm64path tuples so the architectures can have different path counts and architecture-only locations without synthetic common entries.for_arch()returns the paths for the requested Windows Python architecture, whilex64_only()andarm64_only()make single-architecture layouts explicit.The default local-CTK search uses
bin/x64followed by legacybinfor x64, andbin/arm64for ARM64. Wheel search usesnvidia/cu13/bin/x86_64ornvidia/cu13/bin/arm64before any applicable CUDA 12 component-wheel location.Special library layouts
CUPTI
CUPTI does not use the default local-CTK layout. Its x64 anchor order is
extras/CUPTI/lib/x64, legacyextras/CUPTI/lib64, thenbin. Its ARM64 anchor is onlyextras/CUPTI/lib/arm64. Wheel paths continue to use the CUDA 13 aggregate-wheel directory first, with the CUDA 12 component-wheel directory available only to x64.cuDLA
Windows cuDLA is explicitly ARM64-only. It is searched only at the local-CTK anchor
bin/arm64; x64 has no anchor path. No Windows wheel currently shipscudla.dll, sosite_packages_windowsis intentionally empty.NVVM
NVVM uses
nvvm/bin/x64followed by legacynvvm/binfor x64 local-CTK searches, while ARM64 usesnvvm/bin. Its wheel search uses the CUDA 13 architecture-qualified aggregate-wheel directory first and retains the CUDA 12 NVCC component-wheel location only as an x64 fallback.The unqualified
nvvm/bindirectory is architecture-ambiguous across toolkit layouts: it contains x64 NVVM before CUDA 13.4 and ARM64 NVVM in the CUDA 13.4 Windows-on-Arm toolkit. For NVVM anchor searches only, pathfinder therefore inspects the candidate DLL's PEMachinefield and accepts it only when it matches the Python process architecture. This avoids adding CTK-version detection and prevents x64 Python from selecting an ARM64 NVVM DLL, or ARM64 Python from selecting a legacy x64 DLL.Additional changes
toolshed/make_site_packages_libdirs.pyand its related catalog-writer round-trip test instead of extending and maintaining that generator for architecture-aware paths. Thesite_packages_windowsmappings are authored directly indescriptor_catalog.py.Why
CUDA Toolkit 13.4 installs Windows binaries in architecture-specific directories such as
bin/x64andbin/arm64. CUDA 13 wheels likewise use architecture-specific directories undernvidia/cu13/bin, while CUDA 12 component wheels retain their existing package-specific layouts. Because Windows installers can install cross-architecture packages, pathfinder selects paths using the Python process architecture rather than the host architecture.Validation
ruff checkpassed for all changed Python files.ruff format --checkpassed for all changed Python files.