High idle CPU and GPU usage on the Apple M1 Max
Operating System Info
macOS 13
Other OS
13.1
OBS Studio Version
28.1.2
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/AxE5S7V-IW_04LKl
OBS Studio Crash Log URL
No response
Expected Behavior
This is (more of) a question than a bug report but I couldn't find an appropriate place for this, so thought I'd put it here. Please let me know if this needs to go some place else.
Expected:
I was expecting lower CPU and GPU usage when idle.
PS: I'm (kind of) new to the video streaming space i.e. haven't done this before. So, I'm not sure if this is normal behavior.
Current Behavior
I have OBS installed on an Apple (M1 Max) MacBook Pro and noticed the idle cpu usage stays at 21% (approx) and GPU usage at 70 %.
- By idle I mean, I'm not streaming or recording.
- OBS's in-app
cpu-usage-monitorshows 8% usage (on avg approx)
My set-up:
- I have a few extra apps open (VSCode, terminal and a browser with 5 tabs). This usually consumes less than 5% of the
cpu and gpuwhile idle. - enabled the hardware encoder option and selected
native resolutionfor both streaming and recording.
Is this normal?
activity monitor shows a similar picture:
Steps to Reproduce
- Launch OBS on an M1 Max with the above settings.
- and check the activity monitor.
...
Anything else we should know?
No response
Update:
- It seems the
WindowServer(process) usage spikes every time OBS is launched and stays that way till its terminated. Can this be the cause for the inordinate CPU and GPU usage (at idle)?
I have one mac studio m1 max and the same thing happens I noticed when I was playing world of warcraft, just opening OBS already makes the game's fps 50% down
You're capturing (and composing) at 3456x2234, which is close to 4k, at 60 frames per second. This also means that Qt has to render a texture that big at 60 frames and push it to the Window server.
These are expensive operations (which can incur additional penalty for mapping colours to your display colourspace) and will obviously tax CPU and GPU. OBS' OpenGL renderer is also not optimised for operations this costly (we flush too early and too often, which usually doesn't have much impact as the operations are small) and neither is Qt.
Reduce your canvas and output resolution to 1080p and check again. Additionally disabling the preview or minimising the OBS window while recording helps (which is related to how Qt updates/renders the main window at retina resolutions, there is no "good" fix there).
Version: 29.0, Resolution: 16x16, FPS: 1, Close preview
It's causing 30% GPU usage on WindowServer on my M1 Pro. After increasing the resolution to 1728x1117 (120 FPS), the occupancy of WindowServer is almost unchanged (But it will affect the occupancy rate of OBS itself).
Hiding or minimizing OBS will help reduce occupancy (~10%).
All occupancy is GPU occupancy.
Did you also track the clock speed of the GPU? Because 30% by itself doesn't give the full picture if the GPU was running at lower clock speeds. The occupancy itself is not surprising as WindowServer has to push the same amount of pixels to the screen constantly - if you don't have ProMotion the refresh rate would also not change.
OBS' own render process will of course occupy the GPU more if it pushes more pixels at a high frame rate and minimising the main window at the very least should remove the need of the GPU to run colour conversion of OBS' main window (as we force Qt to use sRGB instead of the display colour space for the app surface).
If somebody has more resources on how to accurately track performance on a mixed-core architecture with varying clock speeds of CPU and GPU cores, I'd be thankful. Otherwise Instrument's "time spent" metrics might be the next best thing, which requires you to compile OBS locally and attach Instruments to the process to check the time spent in different call stacks.
I used the Mx Power Gadget (https://www.seense.com/menubarstats/mxpg/, It uses helper tools to call Apple's powermetrics command to get relevant information and draw graphs) to track frequency/occupancy and confirmed that the GPU frequency is 0.4GHz at both resolutions.
I mentioned earlier that hiding or minimizing can reduce occupancy, so this time I also tried opening minimize to tray and minimizing, and got the same result.
I'm not sure if this is accurate, but I'm confused by this idle GPU usage
It looks like this is basically expected, and the only real issue here is that performance metrics are sometimes misleading (75% usage when a core is at 0.4ghz compared to 75% at 5ghz is a very different amount of usage, despite seeming the same at a glance to that 75% number).
Without the further metric analysis that is pointing to an actual issue or problem, we don't feel there is anything actionable here, and that the original question posed in this issue has been answered.