Bug Report Quicksync unavailable

SenpaiYank

New Member
Greetings,

so, I've been having this issue which disables me from using intel's quicksync (it doesn't appear on the encoder dropdown list) on my laptop whenever I use my dedicated GPU to open OBS. It happens that when I do that, OBS doesn't recognize the intel iGPU but the dedicated nvidia one only (It is also recognized "twice" so, the logs end up showing that I have 2 identic nvidia cards). It happears that I'm not alone with this problem, https://obsproject.com/forum/thread...0-22-0-2-quicksync-no-longer-an-option.95249/ (see the 22.0.2 part).

When I open OBS with my iGPU (which is the default), the logs show that both the iGPU and the dedicated GPU are properly recognized but OBS ends up choosing the intel one to do the rendering work (as you can see in the logs). Due to this problem I'm obligated to either have the encoding performance of quicksync but slow rendering (as it is much weaker than the dGPU) and game capturing (since I have to use the slow multi GPU compability option) or, the CPU toll of x264 and the giant uplift on rendering and game capturing performance of my dGPU.

I'm obviously just trying to get the best of both worlds (which if I recall correctly, this was already possible on earlier OBS versions where you could manually choose the D3D11 adapter on the settings). I'd like to take this opportunity to suggest the revival of this feature as it would prove quite useful to some of us.

Here's the logs nevertheless, https://obsproject.com/logs/jTJNPpwHKxfihqF8
Thanks, _Yank :)
 

FerretBomb

Active Member
Unfortunately, you'll only be able to use QSV when running on the integrated GPU, as the features are not available to OBS when it is running on the discrete GPU. The multi-GPU compatibility option IS a workaround, and that iGPU should not really have an issue handling the compositing and rendering tasks OBS assigns to it unless it's already otherwise loaded, or you're trying to record/stream at an unfeasibly high framerate (>60fps).

If it is running into an issue when running on the iGPU with capture in multi-compatibility mode, please post a logfile from a live streaming or recording session where the issue was happening and we can take a look, see if we can offer advice. The provided log does not contain one though.
 

SenpaiYank

New Member
The iGPU renders my stuff at sub 6ms timings (which is plenty for 60fps I guess) but the encoding doesn't do so well it seems. Whenever I try streaming at anything higher than 720p30, encoder oveload (which is strange, as I've researched and found benchmarks of sandy bridge's QSV showing it is maxed out at 720p90). Not only that but, capturing games that are using the dedicated nvidia card is not possible unitl I enable the multi GPU workaround which leaves me with poor capturing performance.

I remember reading somewhere that in the past there was a QSVHelper.exe something that helped in situations like this if I got it right. I assume it was a wrapper or something that provided QSV support even when OBS was running on another card. Any words on that? Or did I get it wrong?
 

koala

Active Member
The Quicksync encoder needs a bit of iGPU computing resources for encoding, so if you put high graphics load onto your iGPU with your game, the encoder is getting not enough computing resources and you get encoding lag.
You need to tune down the graphics requirement of your app(s) to give the Quicksync encoder more computing resources. You need to balance both. OBS itself needs some amount of graphics resources for itself, so you should also try to make your scenes as simple as possible. Especially filters tend to require more GPU resources than you thought in the first place.

The QSVHelper.exe was an internal helper required by the obsolete OBS classic to make Quicksync work in Classic in the first place. But this mechanic is not used by OBS Studio. OBS Studio has this mechanics built in. It's not a magic app that makes all lags and encoding issues go away magically.
 

SenpaiYank

New Member
That totally makes sense however, the games are being run on the discrete GPU not the QSV one. I guess it's actually my scenes fault, too much junk and stuff. I'll now try to see its performance with a blank scene and see how it goes.
So that means that it is impossible to run OBS with the discrete adapter but still use quicksync? Kinda unfortunate but I guess I can live with it.
The only thing I can think of right now is, have 2 OBS instances running, one with the discrete and one the iGPU. Capture, render, etc with the discrete GPU and feed the output in a raw format to the internal one instance and let it encode and stream it... Would that be possible (or anything of that sort)?
 

FerretBomb

Active Member
That totally makes sense however, the games are being run on the discrete GPU not the QSV one. I guess it's actually my scenes fault, too much junk and stuff. I'll now try to see its performance with a blank scene and see how it goes.
So that means that it is impossible to run OBS with the discrete adapter but still use quicksync? Kinda unfortunate but I guess I can live with it.
The only thing I can think of right now is, have 2 OBS instances running, one with the discrete and one the iGPU. Capture, render, etc with the discrete GPU and feed the output in a raw format to the internal one instance and let it encode and stream it... Would that be possible (or anything of that sort)?
You might be able to install the obs-ndi plugin (and Newtek redistributable package) and send between the two instances that way, or install obs-virtualcam on the capturing one and add its output as a source to the one running on the iGPU (this is easier, but may lead to a small amount of image degradation).
Note that both of these methods will generate significantly more system overhead than even running in multi-GPU compatibility mode, but hey, it might be worth a shot in your case.

Really though, the fix is a hardware upgrade being needed.
 

SenpaiYank

New Member
The NDI based approach worked very well except that, as you've said, its performance hit is way too heavy on the GPU side (the source), rendering it useless. The virtual cam approach should be roughly the same I presume.. I guess there's really no other option then :/

Any chance this could be considered being implemented in the future? I mean, running the quicksync encoding stuff in another process or something like that (just like you do with obs-browser-page. I think that this would be a quite useful feature and could bring benefits to usecases other than this quicksync one.
 

SenpaiYank

New Member
Somehow I managed to get QSV showing on the encoders list with the help of a little program named Nvidia Inspector. This tool allows me to configure various driver related parameters for specific programs, just like one does with Nvidia Control Panel but with much finer control. I noticed that there was an option which supposedly allows a program to be run with the dedicated adapter but, have quicksync at its disposal:
igputranscoding.png


After setting that, OBS recognizes QSV normally even though it is running on the discrete card. So I enable it, configure it to my liking and hit record. No errors or anything of that sort whatsoever. Everything seems to go completely fine until I go to play the actual file itself. It looks like it is corrupted and actually nothing was written to it (even though the stats window showed a totally valid and conceivable number of encoded frames and bitrates/total data output, etc throughout the recording). I left a sample of an affected file in case it could provide any information regarding the issue.

Logs appear to report no error too:

Thanks, _Yank.
 

Attachments

  • 2020-04-20 02-53-31.zip
    8.9 KB · Views: 28

SenpaiYank

New Member
Another report, this time with good news!
After researching and playing with the source code I haven't found a solution to the method described on my previous post but turns out quicksync while running OBS on the dedicated card is entirely possible :)

Unfortunately, you'll only be able to use QSV when running on the integrated GPU, as the features are not available to OBS when it is running on the discrete GPU.
Fortunately OBS is capable of choosing the rendering adapter, even if it was set to run with the iGPU by nvidia's profiles driver (makes sense as both GPUs are detected on this case, as you can see in the logs). This was basically the fix to run quicksync alongside the nvidia GPU. I've made a personal build with some dirty edits as I'm not very experienced in C/C++ yet (and also not very experienced with big projects like this one) and voilá, it is working just fine.
 

AaronZ

Member
Fortunately OBS is capable of choosing the rendering adapter, even if it was set to run with the iGPU by nvidia's profiles driver (makes sense as both GPUs are detected on this case, as you can see in the logs). This was basically the fix to run quicksync alongside the nvidia GPU. I've made a personal build with some dirty edits as I'm not very experienced in C/C++ yet (and also not very experienced with big projects like this one) and voilá, it is working just fine.

Care to share how you did it?
 
Top