neovide / neovide

No Nonsense Neovim Client in Rust
https://neovide.dev
MIT License
12.73k stars 515 forks source link

[Bug] `Using the D3D12 SDKLayers dll requires that the latest SDKLayers for Windows 10 is installed` error when starting `neovide` #2517

Closed pidgeon777 closed 4 months ago

pidgeon777 commented 4 months ago

Describe the bug

When building and running the latest neovide sources with cargo build --release (master branch), the resulting neovide.exe binary crashes.

Here is the log:

C:\Work\Repositories\GitHub\neovide\neovide\target\release\deps>gdb neovide.exe
GNU gdb (GDB) 14.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from neovide.exe...
(No debugging symbols found in neovide.exe)
(gdb) run
Starting program: C:\Work\Repositories\GitHub\neovide\neovide\target\release\deps\neovide.exe 
[New Thread 226364.0x37404]
[New Thread 226364.0x37438]
[New Thread 226364.0x37a88]
warning: Can not parse XML library list; XML support was disabled at compile time
[New Thread 226364.0x37a70]
[New Thread 226364.0x37a74]
[Thread 226364.0x37a70 exited with code 0]
[Thread 226364.0x37a74 exited with code 0]
[New Thread 226364.0x37b20]
[New Thread 226364.0x37b14]
[New Thread 226364.0x37b3c]
[New Thread 226364.0x37b40]
[New Thread 226364.0x37b30]
[New Thread 226364.0x37b34]
[New Thread 226364.0x37b54]
[New Thread 226364.0x37ad4]
[New Thread 226364.0x37af0]
[New Thread 226364.0x37b60]
[New Thread 226364.0x37b18]
[New Thread 226364.0x37b1c]
[New Thread 226364.0x37b04]
[New Thread 226364.0x37b28]
[New Thread 226364.0x37b48]
[New Thread 226364.0x37b0c]
[New Thread 226364.0x37b08]
[New Thread 226364.0x37934]
[New Thread 226364.0x37ae4]
[New Thread 226364.0x378c8]
[New Thread 226364.0x36dc4]
[New Thread 226364.0x36d9c]
[New Thread 226364.0x36548]
warning: D3D Error 887e0003: (225956@57611984) at 00007FFAFCEBA112 - Using the D3D12 SDKLayers dll requires that the latest SDKLayers for Windows 10 is installed.
warning: D3D12GetDebugInterface: This method requires the D3D12 SDK Layers for Windows 10, but they are not present on the system.
[Thread 226364.0x37b34 exited with code 0]
[Thread 226364.0x37b30 exited with code 0]
[Thread 226364.0x37b60 exited with code 0]
[Thread 226364.0x37b20 exited with code 0]
[Thread 226364.0x37404 exited with code 101]
[Thread 226364.0x37ad4 exited with code 101]
[Thread 226364.0x37b54 exited with code 101]
[Thread 226364.0x37b40 exited with code 101]
[Thread 226364.0x37b04 exited with code 101]
[Thread 226364.0x37af0 exited with code 101]
[Thread 226364.0x37b18 exited with code 101]
[Thread 226364.0x37b28 exited with code 101]
[Thread 226364.0x37b1c exited with code 101]
[Thread 226364.0x37a88 exited with code 101]
[Thread 226364.0x37b3c exited with code 101]
[Thread 226364.0x37b14 exited with code 101]
[Thread 226364.0x37438 exited with code 101]
[Thread 226364.0x37ae4 exited with code 101]
[Thread 226364.0x378c8 exited with code 101]
[Thread 226364.0x37b08 exited with code 101]
[Thread 226364.0x37934 exited with code 101]
[Thread 226364.0x36dc4 exited with code 101]
[Thread 226364.0x37b48 exited with code 101]
[Thread 226364.0x36548 exited with code 101]
[Thread 226364.0x36d9c exited with code 101]
[Thread 226364.0x37b0c exited with code 101]
[Inferior 1 (process 226364) exited with code 0145]
(gdb)

And if I try the debug build (cargo build), I obtain:

C:\Work\Repositories\GitHub\neovide\neovide\target\debug\deps>gdb neovide.exe
GNU gdb (GDB) 14.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from neovide.exe...
(No debugging symbols found in neovide.exe)
(gdb) run
Starting program: C:\Work\Repositories\GitHub\neovide\neovide\target\debug\deps\neovide.exe
[New Thread 248188.0x3c62c]
[New Thread 248188.0x3cb80]
[New Thread 248188.0x3aba8]
warning: Can not parse XML library list; XML support was disabled at compile time
[New Thread 248188.0x3c9b4]
[New Thread 248188.0x16184]
[Thread 248188.0x3c9b4 exited with code 0]
[Thread 248188.0x16184 exited with code 0]
[New Thread 248188.0x3c560]
[New Thread 248188.0x3c8d8]
[New Thread 248188.0x3cbd8]
[New Thread 248188.0x3bb38]
[New Thread 248188.0x3cbe0]
[New Thread 248188.0x3cb74]
[New Thread 248188.0x32fec]
[New Thread 248188.0x3caa8]
[New Thread 248188.0x3c778]
[New Thread 248188.0x39c0c]
[New Thread 248188.0x3c99c]
[New Thread 248188.0x3ca2c]
[New Thread 248188.0x3ca14]
[New Thread 248188.0x3bd58]
[New Thread 248188.0x3c704]
[New Thread 248188.0x3bc60]
[New Thread 248188.0x3c740]
[New Thread 248188.0x3c61c]
[New Thread 248188.0x3c7fc]
[New Thread 248188.0x3b1e0]
[New Thread 248188.0x3c9d4]
[New Thread 248188.0x3c968]
[New Thread 248188.0x3ca28]
warning: D3D Error 887e0003: (243728@58910890) at 00007FFAFCEBA112 - Using the D3D12 SDKLayers dll requires that the latest SDKLayers for Windows 10 is installed.
warning: D3D12GetDebugInterface: This method requires the D3D12 SDK Layers for Windows 10, but they are not present on the system.
Neovide panicked with the message 'Failed to create Direct3D debug controller: Error { code: HRESULT(0x887A002D), message: "The application requested an operation that depends on an SDK component that is missing or mismatched." }'. (File: src\renderer\d3d.rs; Line: 94, Column: 18)
This is a bug and we would love for it to be reported to https://github.com/neovide/neovide/issues
   0: backtrace::backtrace::dbghelp64::trace
             at C:\Users\<USERNAME>\scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.71\src\backtrace\dbghelp64.rs:99
      backtrace::backtrace::trace_unsynchronized<backtrace::capture::impl$1::create::closure_env$0>
             at C:\Users\<USERNAME>\scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.71\src\backtrace\mod.rs:66
   1: backtrace::backtrace::trace<backtrace::capture::impl$1::create::closure_env$0>
             at C:\Users\<USERNAME>\scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.71\src\backtrace\mod.rs:53
   2: backtrace::capture::Backtrace::create
             at C:\Users\<USERNAME>\scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.71\src\capture.rs:193
   3: backtrace::capture::Backtrace::new
             at C:\Users\<USERNAME>\scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.71\src\capture.rs:158
   4: neovide::main::closure$0
             at C:\Work\Repositories\GitHub\neovide\neovide\src\main.rs:81
   5: alloc::boxed::impl$49::call
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\alloc\src\boxed.rs:2029
      std::panicking::rust_panic_with_hook
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:785
   6: std::panicking::begin_panic_handler::closure$0
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:659
   7: std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\sys_common\backtrace.rs:171
   8: std::panicking::begin_panic_handler
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:647
   9: core::panicking::panic_fmt
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\core\src\panicking.rs:72
  10: core::result::unwrap_failed
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\core\src\result.rs:1649
  11: enum2$<core::result::Result<tuple$<>,windows_result::error::Error> >::expect<tuple$<>,windows_result::error::Error>
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\core\src\result.rs:1030
  12: neovide::renderer::d3d::D3DSkiaRenderer::new
             at C:\Work\Repositories\GitHub\neovide\neovide\src\renderer\d3d.rs:93
  13: neovide::renderer::create_skia_renderer
             at C:\Work\Repositories\GitHub\neovide\neovide\src\renderer\mod.rs:533
  14: neovide::window::window_wrapper::WinitWindowWrapper::new
             at C:\Work\Repositories\GitHub\neovide\neovide\src\window\window_wrapper.rs:96
  15: neovide::window::main_loop
             at C:\Work\Repositories\GitHub\neovide\neovide\src\window\mod.rs:302
  16: neovide::main
             at C:\Work\Repositories\GitHub\neovide\neovide\src\main.rs:101
  17: core::ops::function::FnOnce::call_once<neovide::error_handling::NeovideExitCode (*)(),tuple$<> >
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\core\src\ops\function.rs:250
  18: std::sys_common::backtrace::__rust_begin_short_backtrace<neovide::error_handling::NeovideExitCode (*)(),neovide::error_handling::NeovideExitCode>
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\std\src\sys_common\backtrace.rs:155
  19: std::rt::lang_start::closure$0<neovide::error_handling::NeovideExitCode>
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\std\src\rt.rs:166
  20: std::rt::lang_start_internal::closure$2
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\rt.rs:148
      std::panicking::try::do_call
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:554
      std::panicking::try
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:518
      std::panic::catch_unwind
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panic.rs:142
      std::rt::lang_start_internal
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\rt.rs:148
  21: std::rt::lang_start<neovide::error_handling::NeovideExitCode>
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\std\src\rt.rs:165
  22: main
  23: invoke_main
             at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
      __scrt_common_main_seh
             at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  24: BaseThreadInitThunk
  25: RtlUserThreadStart

Backtrace saved to neovide_backtraces.log!
[Thread 248188.0x3c560 exited with code 0]
[Thread 248188.0x3aba8 exited with code 101]
[Thread 248188.0x32fec exited with code 101]
[Thread 248188.0x3bb38 exited with code 101]
[Thread 248188.0x3c62c exited with code 101]
[Thread 248188.0x3cb80 exited with code 101]
[Thread 248188.0x3cbe0 exited with code 101]
[Thread 248188.0x3c8d8 exited with code 101]
[Thread 248188.0x3cb74 exited with code 101]
[Thread 248188.0x3c778 exited with code 101]
[Thread 248188.0x3caa8 exited with code 101]
[Thread 248188.0x3cbd8 exited with code 101]
[Thread 248188.0x3bd58 exited with code 101]
[Thread 248188.0x3c61c exited with code 101]
[Thread 248188.0x3bc60 exited with code 101]
[Thread 248188.0x3c968 exited with code 101]
[Thread 248188.0x3c9d4 exited with code 101]
[Thread 248188.0x3c704 exited with code 101]
[Thread 248188.0x3ca14 exited with code 101]
[Thread 248188.0x3ca28 exited with code 101]
[Thread 248188.0x39c0c exited with code 101]
[Thread 248188.0x3c99c exited with code 101]
[Thread 248188.0x3ca2c exited with code 101]
[Thread 248188.0x3b1e0 exited with code 101]
[Thread 248188.0x3c740 exited with code 101]
[Thread 248188.0x3c7fc exited with code 101]
[Inferior 1 (process 248188) exited with code 0145]
(gdb)

Expected behavior I don't expect a crash.

Desktop:

Additional context The latest neovide stable release (v0.12.2) works fine.

Also, Visual Studio Build Tools 2022 and Windows 11 SDK (10.0.22621.0) are installed in my system (the second as a component of the first).

pidgeon777 commented 4 months ago

Also, I updated the drivers for my AMD Radeon 780M card to the latest version (24.4.1).

zbyna commented 4 months ago

Hello, I encountered a similar error a while ago when I was trying to build from up-to-date (main) sources on Win10:

2024-05-05 18:53:40 - Neovide panicked with the message 'Failed to create Direct3D debug controller: Error { code: HRESULT(0x887A002D), message: "Aplikace vyžádala operaci závisející na chybějící nebo neodpovídající komponentě sady SDK." }'. (File: src\renderer\d3d.rs; Line: 94, Column: 18)

The last stable version works without problem for me too.

I manage to avoid above mention error by installing Graphics Tools from MS.

pidgeon777 commented 4 months ago

Hello @zbyna,

at the end this is what I did to solve the issue on my Windows 11 Pro setup:

Windows Settings -> System -> Optional features -> ✅ Graphic Tools -> Next -> Add

After the installation, the following files where created:

log
C:\Windows\WinSxS\wow64_microsoft-windows-directx-d3d12sdklayers_31bf3856ad364e35_10.0.22621.3235_none_cbfcb10ab824c56a\r\d3d12SDKLayers.dll
C:\Windows\WinSxS\wow64_microsoft-windows-directx-d3d12sdklayers_31bf3856ad364e35_10.0.22621.3235_none_cbfcb10ab824c56a\d3d12SDKLayers.dll
C:\Windows\WinSxS\amd64_microsoft-windows-directx-d3d12sdklayers_31bf3856ad364e35_10.0.22621.3235_none_c1a806b883c4036f\r\d3d12SDKLayers.dll
C:\Windows\WinSxS\amd64_microsoft-windows-directx-d3d12sdklayers_31bf3856ad364e35_10.0.22621.3235_none_c1a806b883c4036f\d3d12SDKLayers.dll
C:\Windows\WinSxS\wow64_microsoft-windows-directx-d3d12sdklayers_31bf3856ad364e35_10.0.22621.3235_none_cbfcb10ab824c56a\f\d3d12SDKLayers.dll
C:\Windows\WinSxS\amd64_microsoft-windows-directx-d3d12sdklayers_31bf3856ad364e35_10.0.22621.3235_none_c1a806b883c4036f\f\d3d12SDKLayers.dll
C:\Windows\WinSxS\amd64_microsoft-windows-directx-d3d12sdklayers_31bf3856ad364e35_10.0.22621.1_none_433fe384fbfdcff5\d3d12SDKLayers.dll
C:\Windows\WinSxS\wow64_microsoft-windows-directx-d3d12sdklayers_31bf3856ad364e35_10.0.22621.1_none_4d948dd7305e91f0\d3d12SDKLayers.dll

The d3d12SDKLayers.dll file was missing before the installation, I'm not sure about how it is now detected by Neovide.

As for the rest, I confirm that Neovide is finally starting on my Windows 11 machine.

@fredizzimo maybe it could be a good idea to add the above information to Neovide README?

The only problem is that now this bug arised:

https://github.com/neovide/neovide/issues/2522

fredizzimo commented 4 months ago

The bug needs to be fixed, it's just that I haven't been on Windows to properly be able to fix and test it myself.

The debug layer should be disabled by default, and only enabled with a rust feature flag.