Skip to content
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

DirectML Execution Provider Error: Unable to load D3D12Core.dll #1054

Open
sjpritchard opened this issue Nov 9, 2024 · 2 comments
Open

DirectML Execution Provider Error: Unable to load D3D12Core.dll #1054

sjpritchard opened this issue Nov 9, 2024 · 2 comments
Labels

Comments

@sjpritchard
Copy link

sjpritchard commented Nov 9, 2024

Describe the bug
When using the prebuilt v0.5.0 DirectML ES runtime on Windows 11 using C++, it fails with the error:

D3D Error 887e0003: (19196@617069187) at 00007FF89073B23F - Unable to load D3D12Core.dll.  Verify D3D12SDKPath is correct.
Microsoft.Direct3DSrc\D3D\module.cpp(689)\d3d12.dll!00007FF89073B263: (caller: 00007FF89073900E) LogHr(1) tid(4afc) 887E0003 The D3D12 SDK version configuration of the host exe is invalid.
    Msg:[Unable to load D3D12Core.dll.  Verify D3D12SDKPath is correct.] 

I've installed the D3D12 Agility SDK runtime files under the D3D12 folder installed in my application folder. I've tried manually setting the D3D12SDKPath environment variable with no change.

To Reproduce
Steps to reproduce the behavior:

  1. Compile application with onnxruntime-genai DirectML ES
  2. Run app

Expected behavior
D3D12Core.dll is able to be found, and DirectML ES loads properly.

Desktop (please complete the following information):

  • OS: Windows 11 23H2 Build 22635.4440
  • Agility SDK Version: 1.614.1
  • Qt 6.8 with C++ 20

Additional context
Add any other context about the problem here.

@sjpritchard
Copy link
Author

sjpritchard commented Nov 15, 2024

It loads with 0.5.1 if I put the D3D12 files in the same folder as the executable (against Microsoft recommendations). Does not work if they are in the default D3D12 subfolder of the main executable. I swear I tried this with 0.5.0 and it didn't work. However, DirectML models crash on load.

@sjpritchard
Copy link
Author

sjpritchard commented Nov 16, 2024

I can't find any references in the source code to D3D12SDKPath. So in theory it should be using the default which is ./D3D12. But this doesn't work. Any ideas where D3D12Core.dll should be installed?

The Agility SDK doco says: The DirectX team recommends that developers avoid having Agility SDK components in the same directory as their application exe, to avoid mismatching D3D12SDKLayers with the D3D12SDKVersion of D3D12Core.dll (see Known Issues for more detail).

I wonder if having it in the same folder is causing the crash on inference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant