Repository navigation
Closed
Labels
bot-triagedThis is a label only to be used by the auto triage botThis is a label only to be used by the auto triage botmodule: binariesAnything related to official binaries that we release to usersAnything related to official binaries that we release to usersmodule: cudaRelated to torch.cuda, and CUDA support in generalRelated to torch.cuda, and CUDA support in generalmodule: windowsWindows support for PyTorchWindows support for PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🐛 Describe the bug
Creating this to continue discussion of the issue pointed at #202206 (comment)
Problem: Cuda-pathfinder on windows has a bug (NVIDIA/cuda-python#3281) where it did not support cupti64_2026.1.2.dll. This exposed a flaw in the load logic: The one try around all eleven libraries, can miss loading subsequent DLLs if either of the libs does not import on a clean Windows machine. CI does not see it because the T4 runner has the toolkit and cuDNN under Program Files.
This can be fixed in 2 ways:
- Add
try / exceptaround theload_nvidia_dynamic_lib(lib). - Instead of preloading the DLLs, we prioritize the
nvidiadir from the env'ssite-packagesand add it to the dll load paths. This aligns better with the on-going efforts of improving the preloading logic [Windows] Drop the torch/lib DLL preload glob #202206.
@atalman @zklaus @nkhasbag-nv would love your input on this.
Versions
2.16.0 nightly
cc @malfet @atalman @tinglvv @nWEIdia @peterjc123 @mszhanyi @skyline75489 @nbcsm @iremyux @Blackhex @nkhasbag-nv @ptrblck @msaroufim @eqy
Metadata
Metadata
Assignees
Labels
bot-triagedThis is a label only to be used by the auto triage botThis is a label only to be used by the auto triage botmodule: binariesAnything related to official binaries that we release to usersAnything related to official binaries that we release to usersmodule: cudaRelated to torch.cuda, and CUDA support in generalRelated to torch.cuda, and CUDA support in generalmodule: windowsWindows support for PyTorchWindows support for PyTorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Activity
nkhasbag-nv commentedon Oct 30, 2026
Overall this is a good fix.
Suggestion: Changes to this
try/exceptblock are easy to miss, and a later refactor could quietly move thetryback around the whole loop. A test with a mock loader would protect against that. It would makeload_nvidia_dynamic_libraise for each library in the list, and check that a warning is emitted and that every other library is still attempted.[Windows] Check DLL load exception per CUDA component (pytorch#202589)
[Windows] Check DLL load exception per CUDA component (pytorch#202589)