obsproject / obsproject/obs-studio

OBS Initializes OpenGL on wrong Graphics card at startup if external monitor is connected

Open
#9,832 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

platform/macos
Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

macOS 13

Other OS

No response

OBS Studio Version

30.0.0-rc2

OBS Studio Version (Other)

No response

OBS Studio Log URL

Multiple Logs Uploaded. See repro Steps

OBS Studio Crash Log URL

Multiple Logs Uploaded. See repro Steps

Expected Behavior
  • Preview Should continue to render properly when I move the OBS window to a secondary screen.
  • Application Should not crash when I move it back to built in screen.
Current Behavior
  • Preview Freezes with a sort of picture-in-picture view of the stream content
  • Moving the application window back to the built-in display will crash the application
Steps to Reproduce

Scenario 1 (Crash)

  1. Plug in external display via dock (Mine is a USB-C Dock that requires DisplayLink Manager software to use)
  2. Launch OBS
    • OBS Selects Integrated GPU to render OpenGL
  3. Move OBS window to external display
    • Preview will Freeze
  4. Move OBS Window back to built in display
    • OBS Will Crash

OBS Log
Crash Log

Scenario 2 (No Crash)

  1. Ensure no external monitors are plugged in
  2. Launch OBS
    • OBS Selects Dedicated GPU to render OpenGL
  3. Plug in external display
  4. Move OBS Window to External Display
    • I see a brief flash where the preview redraws and resizes, but it's only a Frame, and it does not freeze.
  5. Move OBS Window back to builtin Display
    • I see a brief flash where the preview redraws and resizes, but it's only a Frame. OBS Does not crash.

OBS Log

Anything else we should know?

2019 Macbook Pro 16"
MacBookPro16,1
2.6GHz 6-core intel Core i7
AMD Radeon Pro 5300M Graphics Processor w/ 4gb VRAM
Intel UHD Graphics 630 w/ 1500MB VRAM
32GB DDR4 Ram

I was originally writing this up as a different issue but I found Scenario 2 while going back to grab more information after having unplugged my machine.

If you look at the log from Scenario 1, you'll see where it initializes OpenGL On the integrated graphics card (but in that case the external displays are connected and they require use of the dedicated GPU).

09:33:37.636: Initializing OpenGL...
09:33:37.702: Loading up OpenGL on adapter Intel Inc. Intel(R) UHD Graphics 630
09:33:37.702: OpenGL loaded successfully, version 4.1 INTEL-20.6.4, shading language 4.10

The logs for Scenario 2 show that with no external displays connected, OBS initializes OpenGL using the Dedicated GPU:

09:43:56.106: Initializing OpenGL...
09:43:56.158: Loading up OpenGL on adapter ATI Technologies Inc. AMD Radeon Pro 5300M OpenGL Engine
09:43:56.158: OpenGL loaded successfully, version 4.1 ATI-4.14.1, shading language 4.10

and then the application can freely move between monitors if they have been plugged in after OBS starts up.

I have found these repro steps work on every latest major release of OBS below:

  • 25.0.8
  • 26.1.2
  • 27.2.4
  • 28.1.2
  • 29.1.3
  • 30.0.0-rc2

I have only pulled logs for 30.0.0-rc2, so I do not know if it's the exact same issue, but the repro steps produce exactly the same behavior.

Now that I have discovered a workaround (unplug displays, then start OBS), this seems more like a minor annoyance, but I would expect this issue is pretty common. Let me know if you need more information or how I can help. I would be glad to see this issue fixed!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with OBS's OpenGL initialization and adapter selection on macOS, using the supplied Scenario 1 and Scenario 2 logs and reproduction steps with an external display. Done means OBS selects a suitable graphics adapter at startup, the preview continues rendering when moved between displays, and the application does not crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
computer-graphics, desktop-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.