OBS Studio 24.0.3 GPU Priority Fix Testing

dodgepong

Administrator
Forum Admin
OBS Studio 24.0.3 includes a fix on Windows that may alleviate framerate issues caused by 95%+ GPU utilization. We would like some wider testing of this fix to see how it affects people with a variety of configurations and experiences.

Background: Many users have reported that they experience degraded performance in OBS Studio when they are running applications that consume their GPU resources. For example, if OBS is set to capture and record at 60 FPS but the the user runs a graphically-demanding game that utilizes nearly 100% of their GPU, OBS may render at a reduced framerate. You can see your GPU utilization on Windows 10 in the Task Manager, and you can see if OBS is running at a degraded framerate by checking the "Frames missed due to rendering lag" stat in the Stats window under View > Stats or View > Docks > Stats.

Here are the steps to test this fix:
  1. Ensure you have the latest version of OBS Studio (24.0.3 as of this writing)
  2. Run a graphical application with high GPU demands (examples: Apex Legends, Rainbow 6 Siege, PlayerUnknown's Battlegrounds)
  3. Run OBS Studio as Administrator. The fix will only work if you are running OBS as administrator. To disable the fix, run OBS as a normal user.
  4. Open the Stats window under View > Stats, or View > Docks > Stats.
  5. Begin streaming or recording as normal
  6. In the Stats window, verify that your FPS count matches what is set under your Settings > Video settings, and that you are getting minimal frames missed due to rendering lag.
Please report back your "Before" and "After" with OBS both running not as administrator, and with OBS running as Administrator. Log files would be appreciated as well (Help > Log Files). NOTE: This may result in a small reduction in performance of any games or other graphics applications running at the same time.

You must run OBS as administrator to enable this fix. We're investigating ways to make this fix available without the need to run as admin. There are some functions that do not work properly if you are running OBS as administrator, such as drag+drop files and some hotkey behavior.

Thanks for your feedback!
 

Rodney

Forum Moderator
Note: If you see little or no improvement and you are using window capture sources to capture secondary windows like a music player or speedrun timer (i.e. not the game), please check to see if the frame rate stabilizes if you disable the window capture sources.
 
This works incredibly well. Haven't logged anything but the recording and the FPS from a game of PUBG, but the GPU was constantly above 95% during a long game and i recorded it at the same time with pretty good settings. Not a single frame gone, no rendering lag at all.

I am 100% sure these setting would have created rendering lag without the admin flag.
 
I am curious. Does this bug affect using x264 since that is software encoding? I understand that if the GPU is maxed out it cannot do the whole NVENC thing, but what if it maxes out and the user is using x264?
 

dodgepong

Administrator
Forum Admin
This has nothing to do with encoding. This has to do with rendering, which is the process that comes before encoding.
 

Fam3mon5ster

New Member
Do we just post the before and after logs here? I've been testing this GPU fix for about a week and honestly its amazing to be able to run maxed out settings and get literally no skipped or lagged frames. Recently with COD MW update though I have noticed very frequent crashes in obs - I have 9 logs alone from 11/17/2019 - "
22:23:08.529: [jim-nvenc: 'streaming_h264'] get_encoded_packet: nv.nvEncLockBitstream(s, &lock) failed: 8 (NV_ENC_ERR_INVALID_PARAM)
22:23:08.530: Error encoding with encoder 'streaming_h264'
22:23:08.530: Video stopped, number of skipped frames due to encoding lag: 3/270770 (0.0%)
22:23:08.530: [rtmp stream: 'adv_stream'] Encoder error, disconnecting"

I figured it was because raytracing was enabled because I recall when the game launched the obs error would occur when raytracing was enabled and after couples of matches but when disabled I have no issue. With this recent update MW experienced, I can no longer stream MW without it erroring out and with raytracing disabled. I may try other nvidia drivers and see if thats the issue. ( I attached some logs one with this weird errors which will usually end up with obs saying an error had occurred.)

I wouldn't mind by the way if you want me to do some tests to maybe help this build? ( added non administrator log as well )
 

Attachments

Last edited:

Astillius

New Member
Literally made an account just so i could give you guys feedback that it has made a massive difference for me.
Game: Final Fantasy XIV
Before, frame render time was 20-40 ms whenever the game was in focus.
after, frame render time is always 2ms or less, even when the game is in focus.

difference is night and day. awesome job guys.
 

CuoReNeRo

New Member
Btw this fix works for GPU issues, but it causes CPU issues: if you have a really good video card and an "old" CPU, do NOT run OBS Studio as administrator, or you'll see your CPU at 100%, with frames dropped and lag.

Just for info, I have an Asus Strix RTX2070 and an i7 4790k, so if you have something similar you know what to do.
 

xcasxcursex

New Member
This seems to fix more than just what was intended. I never have any frame drops or other errors in the log, have reasonable (85% ish) GPU utilisation (GTX1070) and fairly low (40-50%) CPU utilisation.....however after a reinstall/upgrade of Windows to 1909 and enabling the new Nvidia Ultra Low latency feature, while the error-free behaviour of OBS continued, I noticed strange tearing-like artifacts and duplicate frames in my recordings.

The cadence of the duplicate frames was directly proportionate to the framerate ratio between the game and the recording - as in, with the game at 150FPS and recording at 60FPS, I'd see a dupe frame averaging but not absolutely every third frame, like: frame, frame, dupe; frame, frame, dupe; frame, frame, frame, dupe, frame, dupe....

The tearing was more intermittent and TBH I did not bother to try and find a pattern to it, just went searching to see what had changed. It was almost like someone turned off vsync in the game, if you know what I mean. A very similar visual pattern to that seen in these forum posts, not tearing in the traditional sense where the frame is divided neatly in half along a horizontal border, but a strange mix of horizontal,vertical and blocks of the old and new frame.

After a solid search for answers, I turned to the log and saw the (not admin?) message, tried starting as admin and...joy. No dropped frames, no tearing. Log continues to be error-free. No noticeable (via frametime graphs, monitoring of CPU/GPU utilisation, etc) change in performance.

Happy to provide logs/screenshots of video/etc but honestly there's nothing to see in the logs. The only change is the "D3D11 GPU priority setup...." message, there are no dropped/skipped frames or encoder/render stalls in either. If I had to hazard a guess, I'd say that it's the Nvidia low latency feature I turned on, that made the difference. Seemed as though it wasn't getting enough time to copy the buffer, so I'd either end up with the previous buffer, or half-and-half - just to guess at it. Also happy to test that if you want more info.
 

xcasxcursex

New Member
While I'm here - it was reported in the other thread but that's now locked - OBS crashes when closing it while the replay buffer is running. Logs are as normal, and end as such:


Code:
08:36:26.557:
08:36:26.561: ==== Replay Buffer Start ===========================================
08:36:32.390: ==== Shutting down ==================================================
08:36:32.856: Switched to scene '(null)'
08:36:32.857: WASAPI: Device 'VoiceMeeter Input (VB-Audio VoiceMeeter VAIO)' Terminated
08:36:32.865: WASAPI: Device 'VoiceMeeter Aux Input (VB-Audio VoiceMeeter AUX VAIO)' Terminated
08:36:32.872: WASAPI: Device 'VoiceMeeter Aux Output (VB-Audio VoiceMeeter AUX VAIO)' Terminated
08:36:32.877: WASAPI: Device 'VoiceMeeter VAIO3 Output (VB-Audio VoiceMeeter VAIO3)' Terminated
08:36:32.883: All scene data cleared
08:36:32.883: ------------------------------------------------
08:36:32.906: Output 'Replay Buffer': stopping
08:36:32.906: Output 'Replay Buffer': Total frames output: 370
08:36:32.906: Output 'Replay Buffer': Total drawn frames: 381
I have to end-task it at that point. Task Manager shows that the process is using the GPU for a copy operation, but it is unresponsive, just the systray icon stuck in the corner being dead. rip.

Since I only saw one other person mention it and it seemed to fall through the cracks, I thought I'd chime in. Sorry it's a little OT.
 

xcasxcursex

New Member
Regarding the issue in the post two above this (can't edit)... Turns out that this new feature was masking a problem with ReShade interfering with the frame grab. Renaming the reshade dll from dxgi.dll to d3d11.dll fixes it even without the new feature.

Crashing when exiting while recording is still a thing. Looks like it goes back to 23.2.1 when the hotfix was added for the tray icon. https://github.com/obsproject/obs-studio/commit/58ce89bbe9bf834996851cc7653c3d0c2064d4db
 

TheBasicBro

New Member
Hey I’m looking forward to trying this out. A couple weeks I noticed that I kept getting skipped frames and running into issues I hadn’t experienced before streaming to Mixer and Twitch. I wasn’t sure what the issue was specifically since I kept getting dropped frames etc. I have an RTX 2060 and an i5 9600k overclocked to 4.8Ghz and have had it for a year now. I went into Task Manager and went to app details and turned priority to High on OBS64.exe and after doing this every time I immediately noticed that my frame drops never turned orange or red once after 5 consecutive days of testing. Is there a way others can test this fix I tried without admin running to see if they have similar results? This could be an embedded prioritization issue in the program code.
 

XPACT

New Member
Finally when game is in focus fps is rock steady when run as administrator, I was unable to stream/record DCS World without Vsync (game mode in windows is disabled btw), it was jumping between 20-60fps constantly (massive stutters) with encoding overloaded message even tho obviously it's not encoding issue.
Whatever you done did the trick for me, thanks!
 

jtr

New Member
I'm seeing significant gains on many games, although I seem to still be competing with Forza Horizon 4 for GPU resources. This is with the new Window Capturing method introduced in OBS v25.0 and Game Mode enabled.
 

Padinn

Member
So in OBS 26 I get drops in flight simulator unless I click obs window. No window capture sources in use and it is running as admin. Using a 3090.
 

Padinn

Member
So in OBS 26 I get drops in flight simulator unless I click obs window. No window capture sources in use and it is running as admin. Using a 3090.
I think this was actually due to Nvidia broadcast software. Though I do find enabling HAGS helped.
 
Top