0

everyone!

I am trying to make an inferencing app based of SnapCandy Sample of Windows-Machine-Learning github.

My ONNX Model file is exported at pytorch 1.10. Onnx format : v4, opset v9

Windows version : Win10 21H2 (Build# 19044.1466)

Graphics : NDVIA 2060 (Driver verion : 8.1.961.0, VRAM 6GB)

Code : m_inferenceDeviceSelected = _useGPU ? LearningModelDeviceKind.DirectXHighPerformance : LearningModelDeviceKind.Cpu; m_session = new LearningModelSession(m_model, new LearningModelDevice(m_inferenceDeviceSelected));

If _useGPU is true(Gpu mode), then System.AccessViolationException is occured.

But if _useGPU is false(Cpu mode), then it is inferencing good.

How can I solve this exception?

Thanks in advance!

Roy Li - MSFT
  • 8,043
  • 1
  • 7
  • 13
mathto
  • 1

1 Answers1

1

I had a similar problem and create an issue on github (https://github.com/microsoft/Windows-Machine-Learning/issues/464), that is now answered: The problem is fixed for me, when using the DirectML.DLL from \Windows\System32\ and not the DLL, that comes with the nuget packet "Microsoft.AI.DirectML". best regards, Oliver

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • Yes, ONNX Runtime and WinML expect matching versions of DirectML.dll (e.g. from same Nuget package or both system versions), or else bad things happen. – Dwayne Robinson Feb 24 '22 at 21:13