-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Documentation] How do I use the DirectML EP from an NUnit unit test? #17793
Comments
Looks like you have an old DirectML. The code throwing that error is
And |
@klasma if you get your ORT package from nuget.org, the dependencies tab should clearly mark which corresponding version of DirectML you'll need to successfully run ORT end to end. i.e. https://www.nuget.org/packages/Microsoft.ML.OnnxRuntime.DirectML#dependencies-body-tab |
Thank you very much for your input. I am getting the Microsoft.ML.OnnxRuntime.DirectML nuget from nuget.org and the correct version of DirectML.dll seems to be in the bin directory next to my test assembly. Is an older version of the dll found somewhere in my windows installation? At first I thought that "C:\Windows\System32\directml.dll" was found, but if I drop that file in the bin-directory of my console application where everything works fine, I get a different error so I assumed that that was not the case. How do I solve this issue? |
This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details. |
@wschin I'm getting this error when trying to use the DML provider from the C API on Windows 10. This document states that feature level 5 / DML v1.8.0 is indeed only available on Windows 11: https://learn.microsoft.com/en-us/windows/ai/directml/dml-version-history So this means that the DML provider is not supported on Windows 10 out of the box. Is it possible to get it to work by manually installing DML 1.8.0, or is this version incompatible with Windows 10? |
@klasma did you resolve this issue on Windows 10? |
No, I did not. |
@klasma thanks for the quick response. So there is no way to use Microsoft.ML.OnnxRuntime.DirectML v 1.16.0 on Windows 10? how about lower versions of Microsoft.ML.OnnxRuntime.DirectML do they work on Windows 10? |
I was able to run inrerence, but not from tests in NUnit. |
I never tried earlier versions. |
I am not able to select the DirectML EP from a unit test. I assume that it is possible somehow and therefore I am tagging this as a documentation issue. I am using version 1.16.0 of the Microsoft.ML.OnnxRuntime.DirectML nuget and Windows 10. Here is the code that I am running:
I am getting the following error:
Microsoft.ML.OnnxRuntime.OnnxRuntimeException : [ErrorCode:RuntimeException] D:\a_work\1\s\onnxruntime\core\providers\dml\dml_provider_factory.cc(158)\onnxruntime.DLL!00007FFCAB1BA1C0: (caller: 00007FFCAB1B9EAE) Exception(1) tid(9b74) 887A0004 The specified device interface or feature level is not supported on this system.
at Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_DML(Int32 deviceId)
at DirectMLTest.Tests.Test1() in C:\git\DirectMLTest\DirectMLTest\DirectMLTest\UnitTest1.cs:line 16
If I run the same code in a console app, everything works as expected and it also works if I replace AppendExecutionProvider_DML with AppendExecutionProvider_CPU.
I am using the x64 configuration and not Any CPU. I read that the Any CPU configuration could cause similar problems.
Page / URL
No response
The text was updated successfully, but these errors were encountered: