com.unity.webrtc icon indicating copy to clipboard operation
com.unity.webrtc copied to clipboard

[BUG] "Hardware encoder is not supported" on systems with multiple GPU

Open unnamed7 opened this issue 5 years ago • 2 comments

I have a laptop with an onboard GTX1060 and an external RTX2080 connected via TB. Whenever WebRTC.Initialize(); is triggered it throws the exception - "Couldn't use hardware encoder. - System.ArgumentException: Hardware encoder is not supported". (as reported earlier on the other closed thread but the problem still persists. I solved other problems on my side and now I am sure there's a flaw in this package.).

The value returns by Unity SystemInfo.graphicsDeviceName is "NVIDIA GeForce RTX 2080" which is correct. And the GTX1060 seems to be turned off while connected to the RTX, I can check that with the windows taskmanger. The system also has the intel HD630 as well. If I disconnect the RTX, then it uses the onboard nvidia no problem.

My guess is that when WebRTC.Initialize() is called, it tries to use the first available NVIDIA graphics card that in my case is listed but cannot be used, then it throws the exception, perhaps does not iterate to the next one nor try to use the 2nd and onwards. Please investigate. Additionally, I think it is better if this package catches the exception internally and use software encoder. It can be done externally, however since every software has to do that, the current throw-exception-then-stop implementation doesn't feel very elegant.

Cheers,

Takashi Watanabe

unnamed7 avatar Jan 28 '21 11:01 unnamed7

Yes, indeed. I'm considering the proposal which using a software encoder as a fallback option automatically.

karasusan avatar Jan 29 '21 01:01 karasusan

memo: WRS-203

karasusan avatar Jan 18 '22 02:01 karasusan