Win32 DX11 Getting error DXGI_ERROR_DEVICE_REMOVED in backend CreateWindow when using RDP #8418

Open
opened 2025-02-20 23:32:47 +00:00 by lailoken · 0 comments
lailoken commented 2025-02-20 23:32:47 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

1.91.9 dockking

Back-ends:

imgui_impl_dx11 + imgui_impl_win32

Compiler, OS:

MSVC

Full config/build information:

Dear ImGui 1.91.9 WIP (19184)

sizeof(size_t): 8, sizeof(ImDrawIdx): 4, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS
define: _WIN32
define: _WIN64
define: _MSC_VER=1940
define: _MSVC_LANG=202002
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK

io.BackendPlatformName: imgui_impl_win32
io.BackendRendererName: imgui_impl_dx11
io.ConfigFlags: 0x0000C481
NavEnableKeyboard
DockingEnable
ViewportsEnable
DpiEnableScaleViewports
DpiEnableScaleFonts
io.ConfigViewportsNoAutoMerge
io.ConfigViewportsNoDefaultParent
io.ConfigDockingWithShift
io.ConfigNavCaptureKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001C0E
HasMouseCursors
HasSetMousePos
PlatformHasViewports
HasMouseHoveredViewport
RendererHasVtxOffset
RendererHasViewports

io.Fonts: 11 fonts, Flags: 0x00000000, TexSize: 1024,1024
io.DisplaySize: 1795.00,1161.00
io.DisplayFramebufferScale: 1.00,1.00

style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Details:

In the DX11 backend binding, inside ImGui_ImplDX11_CreateWindow,
The CreateSwapChain call returns an error while using RDP (for some users only).

I've tracked it down to the following steps to reproduce:

While on a host with an NVidia RTX and Intel graphics, inside the NVidia Control Panel I set it to always use NVidia (default is Auto, which uses Intel I assume)

Then I start the ImGui application, causing it to use NVidia (I assume)

Then when I RDP in, I suspect that RDP forces it to use Intel, and this switch then crashes ImGui on the next window/viewport creation.
I can then restart the ImGui application inside RDP without a problem after this.

Switching NVidia Control panel back to "Auto" prevents this. I also suspect that disabling Intel integrated gfx in the BIOS may prevent this, but have not tested.

Ideally ImGui needs to detect this change and select the new device for use.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

### Version/Branch of Dear ImGui: 1.91.9 dockking ### Back-ends: imgui_impl_dx11 + imgui_impl_win32 ### Compiler, OS: MSVC ### Full config/build information: Dear ImGui 1.91.9 WIP (19184) -------------------------------- sizeof(size_t): 8, sizeof(ImDrawIdx): 4, sizeof(ImDrawVert): 20 define: __cplusplus=199711 define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS define: _WIN32 define: _WIN64 define: _MSC_VER=1940 define: _MSVC_LANG=202002 define: IMGUI_HAS_VIEWPORT define: IMGUI_HAS_DOCK -------------------------------- io.BackendPlatformName: imgui_impl_win32 io.BackendRendererName: imgui_impl_dx11 io.ConfigFlags: 0x0000C481 NavEnableKeyboard DockingEnable ViewportsEnable DpiEnableScaleViewports DpiEnableScaleFonts io.ConfigViewportsNoAutoMerge io.ConfigViewportsNoDefaultParent io.ConfigDockingWithShift io.ConfigNavCaptureKeyboard io.ConfigInputTextCursorBlink io.ConfigWindowsResizeFromEdges io.ConfigMemoryCompactTimer = 60.0 io.BackendFlags: 0x00001C0E HasMouseCursors HasSetMousePos PlatformHasViewports HasMouseHoveredViewport RendererHasVtxOffset RendererHasViewports -------------------------------- io.Fonts: 11 fonts, Flags: 0x00000000, TexSize: 1024,1024 io.DisplaySize: 1795.00,1161.00 io.DisplayFramebufferScale: 1.00,1.00 -------------------------------- style.WindowPadding: 8.00,8.00 style.WindowBorderSize: 1.00 style.FramePadding: 4.00,3.00 style.FrameRounding: 0.00 style.FrameBorderSize: 0.00 style.ItemSpacing: 8.00,4.00 style.ItemInnerSpacing: 4.00,4.00 ### Details: In the DX11 backend binding, inside `ImGui_ImplDX11_CreateWindow`, The `CreateSwapChain` call returns an error while using RDP (for some users only). I've tracked it down to the following steps to reproduce: While on a host with an NVidia RTX and Intel graphics, inside the NVidia Control Panel I set it to always use NVidia (default is Auto, which uses Intel I assume) Then I start the ImGui application, causing it to use NVidia (I assume) Then when I RDP in, I suspect that RDP forces it to use Intel, and this switch then crashes ImGui on the next window/viewport creation. I can then restart the ImGui application inside RDP without a problem after this. Switching NVidia Control panel back to "Auto" prevents this. I also suspect that disabling Intel integrated gfx in the BIOS may prevent this, but have not tested. Ideally ImGui needs to detect this change and select the new device for use. ### Screenshots/Video: _No response_ ### Minimal, Complete and Verifiable Example code: _No response_
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#8418
No description provided.