Skip to content

Windows: Show more useful DLL load errors to say exactly what DLL is missing#1345

Merged
RyanUnderhill merged 3 commits intomainfrom
ryanunderhill/dll_errors
Mar 25, 2025
Merged

Windows: Show more useful DLL load errors to say exactly what DLL is missing#1345
RyanUnderhill merged 3 commits intomainfrom
ryanunderhill/dll_errors

Conversation

@RyanUnderhill
Copy link
Contributor

Description

When we fail to load a provider shared DLL in windows, the error is not very specific. Users have to figure out if the onnxruntime file is missing, a cuda file, or cudnn is not installed (and perhaps others). And this is just the cuda provider. It would be far more useful if it would say exactly what file is missing so the user can fix the actual problem.

Plus, this will likely result in many fewer github issues regarding this problem, but if they do, they will be much easier to fix.

This fix adds a function that will try loading a dll and its dependencies recursively to figure out which file is missing. It uses the OS dbghelp library to do it and is not very complex.

Almost the same as what I added for onnxruntime recently:

microsoft/onnxruntime#24053

@RyanUnderhill RyanUnderhill merged commit 0c1df9a into main Mar 25, 2025
14 checks passed
@RyanUnderhill RyanUnderhill deleted the ryanunderhill/dll_errors branch March 25, 2025 18:38
baijumeswani pushed a commit that referenced this pull request Mar 27, 2025
…missing (#1345)

### Description
When we fail to load a provider shared DLL in windows, the error is not
very specific. Users have to figure out if the onnxruntime file is
missing, a cuda file, or cudnn is not installed (and perhaps others).
And this is just the cuda provider. It would be far more useful if it
would say exactly what file is missing so the user can fix the actual
problem.

Plus, this will likely result in many fewer github issues regarding this
problem, but if they do, they will be much easier to fix.

This fix adds a function that will try loading a dll and its
dependencies recursively to figure out which file is missing. It uses
the OS dbghelp library to do it and is not very complex.

Almost the same as what I added for onnxruntime recently: 

microsoft/onnxruntime#24053
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants