Recently I wrote a C++ software to do h264 hardware encoding by using Intel Media SDK 2018R2, with my dual-GPU (Windows 10 1809 + Intel HD Graphics 4600 + Nvidia GTX1080) equipped desktop.
When I used the GTX1080 as my primary gfx device and tried to use the headless intel's GPU as secondary hw-accelerated device, everything is fine until about ten minutes later. The call of MFXVideoSession::SyncOperation() in my program begun to return MFX_ERR_DEVICE_FAILED occasionally, which lead to crash. But when I used Intel's GPU as the primary device, it works pretty well. There is no more MFX_ERR_DEVICE_FAILED errors, no matter how long it runs.
How to avoid this MFX_ERR_DEVICE_FAILED situation and make my secondary intel's gpu work stable? Any suggestion would be appreciated.
Thanks for your suggestion.
I have read the Appendix D carefully. By following descriptions I noted that from an application’s perspective, the MFX_ERR_DEVICE_FAILED situation which I mentioned above is completely out-of-my control, if I didn’t set the GPU’s affinity MANUALLY beforehand. The only thing I can do is to accept it and reinitialize the whole things from the bottom-up…
During decoding, video processing, and encoding operations, if the application is not in the Intel graphic device affinity list, the previously accessible Intel graphic device may become inaccessible due to a switch event. The SDK functions will return MFX_ERR_DEVICE_LOST or MFX_ERR_DEVICE_FAILED, depending on when the switch occurs and what stage the SDK functions operate. The application needs to handle these errors and exits gracefully.
Is my understanding of this correct? I also observed that the sample of decoding in msdk would fail occasionally because of MFX_ERR_DEVICE_FAILED errors without explicit intel’s GPU affinity setting.
I think so, to set the GPU's affinity MANUALLY should like the description of following web page:
We understand this is a good solution but this seems depending on OS.
Let me know if you have any suggestions.