GLWpfControl icon indicating copy to clipboard operation
GLWpfControl copied to clipboard

Can't create control using dedicated GPU when display is plugged into integrated GPU

Open Krugpelke opened this issue 1 year ago • 10 comments

GPU - Intel UHD Graphics 630 GLWpfControl - 4.0.0 - 4.3.2 Can't create GLWpfControl, DXOpenDeviceNV returns an empty GLDeviceHandle, DXInterop.GetLastError shows -1073283022 and Marshal.GetLastWin32Error shows 0, so not sure why this is happening. Previously I thought that this might be due to missing NV_DX_interop support, but Wgl.Arb.GetExtensionsString does show this string. I've tried changing multisampling samples, opengl version from 3.0 to 4.6 and context profiles, but neither seems to have any impact.

Krugpelke avatar Aug 09 '24 10:08 Krugpelke

So this is either integrated+dedicated gpu issue, or a multi-monitor issue. I've successfully created and rendered the example project (except with multisampling enabled) after specifying to only use the integrated card in bios and starting the pc with a single monitor. I'll test more when I get to pcs with only integrated gpus.

Krugpelke avatar Aug 10 '24 19:08 Krugpelke

This is what I tested with the example project:

iGPU+dGPU PC with two monitors

  • Both monitor cables in dGPU slots runs fine on dGPU but results in empty GLDeviceHandle when running on iGPU.
  • One monitor cable in dGPU other in iGPU slot runs fine on iGPU but throws WGL: The driver does not appear to support OpenGL trying to create NativeWindow when running on dGPU.

iGPU PC with two monitors

  • Runs fine.

iGPU+dGPU laptop

  • Runs fine on dGPU.
  • On iGPU shows black screen with ContextProfile.Core, but runs fine with ContextProfile.Compatibility as mentioned here https://github.com/opentk/GLWpfControl/issues/73#issuecomment-2060569841

Interesting thing to note though, when rendering on iGPU, everything seems to render correctly but the debug callback is actually showing this error: [DebugSeverityHigh source=DebugSourceApi type=DebugTypeError id=1282] Error has been generated. GL error GL_INVALID_OPERATION in FramebufferRenderbuffer: (ID: 1914656587) Generic error This happens at ReallocateFramebufferIfNeeded when trying to attach depth-stencil renderbuffer to framebuffer.

Krugpelke avatar Aug 12 '24 10:08 Krugpelke

Hopefully in the next version we'll be able to fix a lot of the integrated graphics issues. No guarantees though. Any info or updates are appreciated in fixing this issue.

NogginBops avatar Oct 31 '24 20:10 NogginBops

@Krugpelke would it be possible for you to test https://github.com/opentk/GLWpfControl/pull/151? It's an attempt to fix these issues with integrated graphics cards.

NogginBops avatar Jul 03 '25 00:07 NogginBops

Couldn't test the laptop scenario, otherwise the behaviour remains the same. The only difference compared to 4.3.3 is the following debug callbacks, though I'm unsure of their significance because visually I couldn't see any problems (the GL_INVALID_ENUM error probably comes from my own project, this time I didn't test the example project):

  • 4.3.3 compatibility context profile
[DebugSeverityHigh source=DebugSourceApi type=DebugTypeError id=1282] Error has been generated. GL error GL_INVALID_OPERATION in FramebufferRenderbuffer: (ID: 1914656587) Generic error
  • 4.3.3 core context profile
[DebugSeverityHigh source=DebugSourceApi type=DebugTypeError id=1282] Error has been generated. GL error GL_INVALID_OPERATION in FramebufferRenderbuffer: (ID: 1914656587) Generic error
[DebugSeverityHigh source=DebugSourceApi type=DebugTypeError id=1280] Error has been generated. GL error GL_INVALID_ENUM in TexParameteri: (ID: 2102148481) Generic error
  • PR151 compatibility context profile No errors

  • PR151 core context profile

[DebugSeverityHigh source=DebugSourceApi type=DebugTypeError id=1280] Error has been generated. GL error GL_INVALID_ENUM in TexParameteri: (ID: 2102148481) Generic error

Krugpelke avatar Jul 03 '25 13:07 Krugpelke

Ok so if I understand correctly, the control works visually in 4.3.3 and using #151, but 151 has one fewer debug callback errors?

What gpu is this running on? And what driver version?

NogginBops avatar Jul 03 '25 14:07 NogginBops

Yes, it works fine on a single igpu, and that specific monitor cable configuration with igpu+dgpu for both branches. I've tested Intel UHD Graphics 630 on two separate pcs, driver is 2023-05-24 31.0.101.2125

Krugpelke avatar Jul 03 '25 14:07 Krugpelke

Ok great. Is there some configuration that doesn't work?

NogginBops avatar Jul 03 '25 14:07 NogginBops

It's exactly the same as previously in https://github.com/opentk/GLWpfControl/issues/136#issuecomment-2283616657, in other words, it doesn't work when trying to run on dgpu and at least one cable is in igpu, and when trying to run on igpu and all cables are in dgpu.

Krugpelke avatar Jul 03 '25 14:07 Krugpelke

I've updated the issue title to hopefully better reflect the issue.

NogginBops avatar Oct 06 '25 12:10 NogginBops