Question / Help How to control the GPU used to composite the scene?

In the encoder settings, we can select the discrete GPU used to perform the actual encoding task of the video we are streaming/recording.

The GPU work of displaying the preview is determined by the card which has the output monitor connected which displays the preview.

However, OBS also uses the GPU to composite the scene. How do we control which GPU performs this work?
 
Thanks Osiris. So, say I have a machine with two GPUs, which one will be used to for compositing the scene? Will it always be the first card, always the card where the preview is displayed, always the card selected for the encoding...or something else?
 

Osiris

Active Member
The GPU that the monitor designated as the primary monitor is connected too is the one OBS will be running on. The GPU used for encoding depends on the encoder, with NVENC you can control it with the GPU setting, no idea about AMD.
But it is not a good idea, having different GPUs taking care of rendering and encoding, will cause a lot of data being moved over the pcie-lanes.
 
If we were to use the same monitor for encoding and for rendering/compositing the scene, would it be possible to make this the secondary monitor (rather than the primary as you explained above)

I ask this as there could be some performance advantage in doing this, by taking the load off the primary GPU, and if it were done on the same GPU then it would avoid some of that PCI-e lane traffic.... but for G-SYNC users the GSYNC monitor must be the primary, and that is the one you would want to game on.

Just for context, I am asking in reference to this video: https://www.youtube.com/watch?v=eAi5W9s-_QM
Like others before him, this video aims to relieve the game's GPU of some load by using another GPU for encoding.... but as we know, the encoding is separate to the GPU rendering cores, so this is of limited benefit. However, if the display of the preview, and the rendering/compositing of the OBS scene, could also be offloaded, then there might actually be some more tangible benefit.
 
Right. I would assume that this is because the framebuffer must be copied from one GPU (the game) to the other (the OBS compositor/ NVENC encoder), via the PCI-e buss? I imagine this would also be transferred via system RAM rather than directly via PCIe, so that would be yet more overhead? Then again I'm not sure how this would differ from copying that same framebuffer to a capture card or network card for export to a dedicated streaming PC?

I am in agreement with you here, but obviously some people don't quite understand the nature of the situation and the reason why using a 2nd card for encoding can sometimes provide an improvement, and what the reasons or limitations of those improvements are, so I would like to be able to provide them with specifics. Watching the results from the video I linked above, does raise a lot of "Why is that?" kind of questions. We know it is not the encoder, since that is not the same hardware that processes the game. We know (from your posts here) that it is not the compositing of the scene (since that also occurs on the primary monitor's GPU)... Could it just be from drawing the preview on screen?

Please don't feel like I am arguing with you here. I just want to be fully informed, and I know that you know your stuff. I'm not fighting you, I am seeking education, that I may share it with others :)
 
Little bump here. There's an endless argument about whether this is good and all logic dictates that it should not help and could in fact hurt performance, a few people have shown evidence that it can help, in certain specific scenarios such as the video above. It would be good to have a definitive response from an inarguable source.

A link to the timestamp in the video (8:14) showing performance increase when using a second card to encode, and to display the preview:
https://youtu.be/eAi5W9s-_QM?t=494
 
Top