Repository navigation
Differences between .dlls in NuGet and Python versions of DirectML provider #24867
Replies: 2 comments
|
The Python and NuGet packages are not necessarily identical deployment bundles, even when they contain the same ONNX Runtime version. They can package the runtime and execution-provider dependencies differently. The key clue is That means copying the Python package’s DLLs into your C++ application may have fixed the issue because it supplied a missing DirectML runtime dependency—or because it replaced one or more binaries with a different version. It does not by itself establish that the NuGet I would check these points before settling on the cause:
For a useful comparison, please share the exact versions of:
Also, test with a clean deployment directory containing only the DLLs from one package plus its documented dependencies. That will help distinguish a missing dependency from an accidental DLL-version mismatch. If this answer helped or pointed you in the right direction, I'd appreciate it if you could mark it as the accepted answer so it's easier for others with the same issue to find. Also, if you found my contribution useful, I'd appreciate it if you could check out my GitHub profile, follow me, and star any repositories you find interesting. GitHub: https://github.com/Advait251206 |
|
The DLL is supplied by a second NuGet package: Inside DirectML 1.15.4, the x64 runtime is One useful check is the loaded DLL's path in Visual Studio's Modules window. Windows also includes DirectML, so an absent app-local copy does not necessarily mean no DirectML was loaded. Comparing the loaded path and version before and after adding the redistributable would help isolate this without replacing |
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to write a C++ application that uses the DirectML Execution Provider, I was using the
onnxruntime.dllandonnxruntime_providers_shared.dllfrom the NuGet C# packageMicrosoft.ML.OnnxRuntime.DirectMLand everything worked fine for the first 2 models I tried to run, but later, when trying to run a YOLO one, it didn't ran on DML, only in CUDA or CPU.After a lot of debugging, I tried running it on python and everything worked fine, out of curiosity, I tried copying the python dlls from
Python313\Lib\site-packages\onnxruntime\capito my own C++ project, and voala, it worked!I noticed that the Python version has 1 extra dll,
DirectML.dll, that the C# one does not.Also, Python's
onnxruntime.dllhas 19-ish KB, while the one from C# has 16-ish KBWhat's the reason for this difference? Shouldn't both packages just be thin wrappers around the same lib?
The error I was getting was
All reactions