Commit 4c399af
authored
Added fallback to preload cudnn dlls from nvidia cudnn venv package or torch venv package (#1135)
### What does this PR do?
Type of change: Bug fix
There was a QA team that was testing the modelopt 0.43 release and
pointed out that we could install nvidia-cudnn pypi packages and use
ort.preload_dlls() to load the dlls from the python venv instead of
trying to search in system path only .
Here is the info about onnxruntime.preload_dlls() function
<img width="1478" height="414" alt="image"
src="https://github.com/user-attachments/assets/e43ecbe3-ba52-4dd8-b2a2-e825d013205b"
/>
So added fallback to system path cudnn search to preload dlls and if
that also fails then raise exception.
### Testing
Tested quantization by installing nvidia-cudnn-cu12 package and removing
cudnn dlls from system path. Working as expected.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved startup handling when CUDA/cuDNN libraries are missing: the
app now attempts a conditional preload from installed Python packages
(when supported), logs captured preload output for diagnostics, warns on
preload errors, and only raises an error if preload ultimately fails.
* **Documentation**
* Error messages now better explain missing-library issues, note
platform/version considerations, and recommend installing a cuDNN pip
package (e.g., nvidia-cudnn-cu12) or setting the appropriate environment
variable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Hrishith Thadicherla <hthadicherla@nvidia.com>1 parent f1beaba commit 4c399af
1 file changed
Lines changed: 50 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
74 | 114 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
78 | 124 | | |
79 | 125 | | |
80 | 126 | | |
| |||
0 commit comments