Question / Help How Does Encoding With A Separate GPU (Intel IGPU) Work In OBS?

Mavflight09

New Member
Hey guys, I have a few questions that I was wondering if you guys could help me out with.

My setup:
- i7-8700k oc 4.8ghz
- 16gb RAM 3400mhz CAS: 19-19-19-39
- Too many hard drives and ssd's
- GPU 0: UHD Graphics 630
- GPU 1: GTX 1070
- GPU 2: GT 710

Now, my setup is GPU limited because in almost all games the 1070 is maxed out at 100% load, while the 8700k is sitting around 30-60% utilization, which is actually what I want.
This is because I almost always only have 1 program open that heavily relies on the GPU, while I often have several programs open that utilize the CPU.

My question is if I am using the UHD 630 as an encoder (QuickSync) why does having an "unrelated" GPU at 100% load (the 1070) cause OBS's output to stutter?
The same happens if I use x264 (8700k) as an encoder; if I let the fps in game go wild (uncapped, using 100% of the 1070) the output stutters and often the output ends up around 55-60 fps, even though the 1070 isn't the GPU that is encoding.
However if I cap the fps to 60 in game then the output from OBS stays solid at 60 fps.

To me this doesn't make any sense, obviously if OBS and my game were fighting over the 1070 for resources then I would expect both program's performance to suffer.
However when one GPU (1070) is dedicated to the game, while another (UHD 630) is dedicated to encoding, I expected that the output would be smooth no matter what utilization the game GPU was at.
The whole point of me changing from NVENC to QuickSync is because I hated having to manage my FPS limiter to prevent me from going over 90% utilization on the 1070 so that the output from OBS would be smooth.

Also what triggers the "encoding overloaded" message? I find that the GPU that's encoding (UHD 630) can be at 30-50% usage at 1080p but at 4k it jumps up to 70%~ usage.
However I get an "encoding overloaded" message and a bunch of frame drops in the recording. Is there a reason why the encoder gets overloaded even though the usage of the GPU only goes up to about 70%? If it's "overloaded" I would expect the IGPU to be pinned at 100% utilization.

Same thing with the CPU, in x264 encoding sometimes I'll get frame drops and an "encoding overloaded" message, but the CPU will only be at 70%~ total utilization.
Is this because of what I said above? (Having the game GPU at 100%)

I was even considering getting another GPU (1050-1060 ish) as a dedicated encoding GPU, but if I still have to play the balancing act with my FPS limiter then whats the point of having a dedicated encoding GPU?

Does anyone have some recommendations for the issue I'm having? Am I simply delusional about how separate GPU's for encoding works? Is this just kinda how it is? Or am I actually missing something?

Would my idea work? (Having 1 GPU dedicated to the game, while having another dedicated to encoding the game output)

The reason I would like to do this is because A. I dislike having to mess about with my FPS limiter every time I play a game to make sure I leave enough GPU headroom so that output doesn't stutter. And B. I really want 100% of my 1070 dedicated to giving me the most fps in game.


Also all of the above could be a mute point if this next question is an actual issue.

I noticed that the output of the video file encoded by the UHD 630 Graphics has some artifacts at the very beginning of the recording. At first I thought is was artifacts from my hard drive being too slow and having to "catch up" to the recording, but once it "got ahead" the artifacts went away.
However I noticed even if I put the video file onto my M.2 NVME SSD (Adata SX8200) the artifacts remain, and there is no way an SSD capable of 3.2 GB/s read is too slow for a video file.

This still may be true though, as the artifacts get worse the higher I set the bitrate. At 85,000 kbps the artifacts last less than a second at the beginning of the video file.
However at at 200,000 kbps the artifacts last for maybe 2 seconds at the beginning of the file.

Just for fun at 400,000 kbps the artifacts last maybe the first 5-12 seconds of the file, and also at the end. But I think this is a bit ridiculous.

Is there anyway to get rid of these artifacts? I guess just lower the bitrate? Would recording to one of my SSD's help with the issue?


Last what's up with the YUV Color Range being borked? I was messing around with the "Color Space" and "Color Range" and found that upping the color space from 601 to 709 made the image look better, as 601 looked really washed out.
I expected changing the color range from partial to full to be the same as changing it in Nvidia Control Panel for example. However doing this just ends up with the image being really blown out, I took some screen shots here: https://imgur.com/a/ktsHR5G

Is there any reason why this happens? Is it as simply as "set it to partial and forget"? Or am I missing something? I think the benefits of having a higher Color Range could be useful.


Does anyone have any recommendations for what to encode with? I find that QuickSync works the best for me but has artifacts. x264 encoding at the same bitrate as QuickSync just doesn't look as nice, and hogs way too much CPU resources. NVENC requires me to set the fps limiter even lower in game but looks alright.

Would having a separate GPU for encoding be the best of both worlds? ( As in looks as good as QuickSync, but doesn't have the artifacts, but also doesn't require me to set my FPS limiter at all (Which is what I would like to be able to do.))

What about "professional" GPU's for encoding? Would an Nvidia Quadro or AMD Firepro work any better for encoding than a consumer GPU?

I got my recording settings from here: https://obsproject.com/forum/resour...lity-recording-and-multiple-audio-tracks.221/

And fine tuned the QuickSync settings from here: https://obsproject.com/forum/resources/custom-parameters-of-quicksync.104/

Screenshots of artifacts using QuickSync and each encoder's settings here: https://imgur.com/a/nTOhTBg

YUV Color Range issue screenshots here: https://imgur.com/a/ktsHR5G

I've attached log's with each of my encoding settings and they are labeled accordingly.

Thank you guys for any help you can give me!
 

Attachments

  • NVENC Encoding.txt
    14 KB · Views: 39
  • QuickSync Encoding.txt
    13.7 KB · Views: 90
  • x264 Encoding.txt
    13.9 KB · Views: 22

Osiris

Active Member
Scenes are rendered on the GPU, therefore OBS needs some GPU power too. Encoding has nothing to do with that, NVENC is a dedicated chip on the card, it does not affect the 3D rendering of the card itself.
You are currently gimping your system with the GT 710, that will result in your 1070 not running at 16x pci-e speed
 

koala

Active Member
An explanation why OBS suffers if you don't cap the fps of your game: OBS isn't just grabbing the game's frame buffer, encode it and save or stream it. OBS is allocating its own invisible frame buffer on the GPU, composing an output frame from all sources you define, with all the filters and scaling options. This invisible frame buffer is what is output, encoded an saved/streamed. This image processing is taking place on the GPU. Scaling, and every filter. If the game is using up all resources on the GPU, OBS hasn't enough for this composing, and is dropping frames.

Unfortunately, there is no nice and fair automatic scheduler for GPU resources of different processes as it exist for CPU resources. I'm no expert in this, but for me it seems an oversight of the API developers (Microsoft), since until now, you had no multiple programs competing for GPU resources but only one program (the game) and it was fine if it just grabbed every resource it can get.
 
Last edited:

Mavflight09

New Member
Scenes are rendered on the GPU, therefore OBS needs some GPU power too. Encoding has nothing to do with that, NVENC is a dedicated chip on the card, it does not affect the 3D rendering of the card itself.
You are currently gimping your system with the GT 710, that will result in your 1070 not running at 16x pci-e speed

So is the issue my 1070 not running in pcie x16 mode? Because in that case I would also have to get rid of my PCIe NVME SSD, which isn't really an option. Also I need the GT710 for extra monitors because the GTX 1070 only supports up to 4.
 

Mavflight09

New Member
An explanation why OBS suffers if you don't cap the fps of your game: OBS isn't just grabbing the game's frame buffer, encode it and save or stream it. OBS is allocating its own invisible frame buffer on the GPU, composing an output frame from all sources you define, with all the filters and scaling options. This invisible frame buffer is what is output, encoded an saved/streamed. This image processing is taking place on the GPU. Scaling, and every filter. If the game is using up all resources on the GPU, OBS hasn't enough for this composing, and is dropping frames.

So even if I got a separate GPU to encode with I would still have dropped frames?

Is there any way I can force OBS to take priority over my game? So that I don't have to manually play with the FPS limiter?
I tried setting the process priority to "high" in advanced options, but that doesn't seem to do much.

Edit: just saw your edit, so I assume there isn't a way for this to happen? And I have to manually set the FPS limiter in every game I play.
 

Osiris

Active Member
So is the issue my 1070 not running in pcie x16 mode? Because in that case I would also have to get rid of my PCIe NVME SSD, which isn't really an option. Also I need the GT710 for extra monitors because the GTX 1070 only supports up to 4.

Your pcie nvme ssd is running on pci-e lanes that are coming from the motherboard chipset, your GPU (or rather the pci-e slot i's in) is connected to the pci-e lanes from your CPU.
That GT 710 is preventing your 1070 to run at full pci-e speed, which has an impact on performance.
 

Mavflight09

New Member
Your pcie nvme ssd is running on pci-e lanes that are coming from the motherboard chipset, your GPU is connected to the pci-e lanes from your CPU.

So removing the GT710 would actualy make my 1070 run in x16 mode? Would this help with the issue though?

Last I checked (which has been a while) modern GPU's still can't fully saturate a PCIe x8 connection, let alone a PCIe x16 connection, so I don't think this would do much.

Also if I were to get a second GPU that is capable of encoding, that would force my 1070 back to 8x mode.
 

koala

Active Member
So even if I got a separate GPU to encode with I would still have dropped frames?
Yes, if you get separate GPU for encoding, you still get dropped frames if the GPU OBS is running on is on 100%.
And you cannot set priorities on the GPU (see the edit of my previous post).

Now you might think you can try to run OBS on one GPU for composing and your game on a second GPU. Unfortunately, this will not work out as well, because the frame buffer grabbed from the game has to be downloaded from one GPU and uploaded to the second GPU for composing. This is horrible additional load for the pci-e bus, and to make things worse, 2 or more GPUs installed on a motherboard means they are unable to run with x16 speed - usually only x8. All this can lead to pci-e bus overload and even more lags and dropped frames.
 

Mavflight09

New Member
Yes, if you get separate GPU for encoding, you still get dropped frames if the GPU OBS is running on is on 100%.
And you cannot set priorities on the GPU (see the edit of my previous post).

Now you might think you can try to run OBS on one GPU for composing and your game on a second GPU. Unfortunately, this will not work out as well, because the frame buffer grabbed from the game has to be downloaded from one GPU and uploaded to the second GPU for composing. This is horrible additional load for the pci-e bus, and to make things worse, 2 or more GPUs installed on a motherboard means they are unable to run with x16 speed - usually only x8. All this can lead to pci-e bus overload and even more lags and dropped frames.

So basically I'm stuck back where I was.

That's kind of frustrating considering I spend all day testing this, but hey now I know. Thanks for the help.

Any idea's on my other issues?
 

Mavflight09

New Member
Yes, if you get separate GPU for encoding, you still get dropped frames if the GPU OBS is running on is on 100%.
And you cannot set priorities on the GPU (see the edit of my previous post).

Now you might think you can try to run OBS on one GPU for composing and your game on a second GPU. Unfortunately, this will not work out as well, because the frame buffer grabbed from the game has to be downloaded from one GPU and uploaded to the second GPU for composing. This is horrible additional load for the pci-e bus, and to make things worse, 2 or more GPUs installed on a motherboard means they are unable to run with x16 speed - usually only x8. All this can lead to pci-e bus overload and even more lags and dropped frames.

I was doing some digging and noticed that EposVox was able to do exactly what I want to do with a Quadro P400.
https://www.youtube.com/watch?v=rRuS2w4etNk

Both his GTX 1080 and Quadro P400 were running in PCIe 8x mode and recording in 4k he doesn't seem to have any issues being limited by the PCIe bus speed.

Do you think this solution would work for me?
 

Narcogen

Active Member
He's doing that to record tutorials, not an action game. And he's recording Premiere, but I assume he's not doing GPU accelerated rendering in Premiere while recording, so... probably not?
 
Top