Skip to content

ONLY FOR REFERENCE, NOT FOR MERGING: pathfinder_iter_env_path_directories branch (on top of PR #1506)#1794

Draft
rwgk wants to merge 6 commits intoNVIDIA:mainfrom
rwgk:pathfinder_iter_env_path_directories
Draft

ONLY FOR REFERENCE, NOT FOR MERGING: pathfinder_iter_env_path_directories branch (on top of PR #1506)#1794
rwgk wants to merge 6 commits intoNVIDIA:mainfrom
rwgk:pathfinder_iter_env_path_directories

Conversation

@rwgk
Copy link
Collaborator

@rwgk rwgk commented Mar 19, 2026

The only change relative to PR #1506 is commit a7ac1dc

Generated by Cursor GPT-5.4 Extra High

See #1506 (comment) and following comments.

rwgk added 6 commits January 15, 2026 22:38
…n Windows

When loading CUDA DLLs via system search on Windows, the previous
approach using LoadLibraryExW with flags=0 would find the DLL on PATH
but fail to locate its co-located dependencies (error 126).

This fix uses SearchPathW to first find the DLL's full path, then loads
it with LOAD_WITH_ALTERED_SEARCH_PATH so Windows searches for
dependencies starting from the DLL's directory.
Made-with: Cursor

# Conflicts:
#	cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_windows.py
…_HOME/CUDA_PATH)

Loads nvrtc in a subprocess with CUDA_HOME and CUDA_PATH stripped from the
environment.  On Windows CI where nvrtc is only reachable via PATH, this
exercises the LOAD_WITH_ALTERED_SEARCH_PATH fix; on other platforms the
test passes harmlessly via whatever search path finds nvrtc first.

Made-with: Cursor
Also load nvrtc with the normal environment first. If the normal load
finds nvrtc in a directory on PATH but the CUDA_HOME/CUDA_PATH-stripped
load fails, the test now fails instead of skipping — directly catching
the Windows bug where SetDefaultDllDirectories excludes PATH from
LoadLibraryExW.

Made-with: Cursor
…agnosis

SearchPathW is the primary fix (bypasses Python 3.8+'s
SetDefaultDllDirectories restriction); LOAD_WITH_ALTERED_SEARCH_PATH
is a secondary benefit for dependency resolution.

Made-with: Cursor
Keep the native Windows process DLL search path for user-dir and driver-library
behavior, then add an explicit PATH-only fallback for CTK libraries so PATH-based
installs still load without broadening lookup semantics.

Made-with: Cursor
@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Mar 19, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant