[Bug]: GPU Hang When Calling MFXVideoVPP_RunFrameVPPAsync and Synchronize
- Dominant language
- C++
- Stars
- 157
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Description
### Which component impacted?
Video Processing
### Is it regression? Good in old configuration?
None
### What happened?
Calling MFXVideoVPP_RunFrameVPPAsync seems to cause the GPU to hang in my program.
`sts = vppOutSurface->FrameInterface->Synchronize(vppOutSurface, WAIT_100_MILLISECONDS)` returns `MFX_WRN_IN_EXECUTION` indefinitely. Neither a loop to retry nor infinite wait resolves this.
Bypassing the `Synchronize `call causes subsequent calls to `MFXVideoVPP_RunFrameVPPAsync `to return `MFX_ERR_GPU_HANG`.
Below is snippets of my code:
```
PrepareFrameInfo(&VPPParams.vpp.In, MFX_FOURCC_NV12, cliParams.srcWidth, cliParams.srcHeight);
PrepareFrameInfo(&VPPParams.vpp.Out, MFX_FOURCC_NV12, cliParams.srcWidth, cliParams.srcHeight);
VPPParams.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY | MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
// Configure denoise filter
denoiseFilter.Header.BufferId = MFX_EXTBUFF_VPP_DENOISE;
denoiseFilter.Header.BufferSz = sizeof(denoiseFilter);
denoiseFilter.DenoiseFactor = cliParams.strength;
// Attach the extended buffer to the VPP parameters
extBuffers[0] = (mfxExtBuffer *)&denoiseFilter;
VPPParams.ExtParam = extBuffers;
VPPParams.NumExtParam = 1;
// Initialize VPP
sts = MFXVideoVPP_Init(session, &VPPParams);
VERIFY(MFX_ERR_NONE == sts, "Could not initialize VPP");
sts = MFXVideoVPP_RunFrameVPPAsync(session, vppInSurface, vppOutSurface, NULL, &syncp);
sts = vppOutSurface->FrameInterface->Synchronize(vppOutSurface, WAIT_100_MILLISECONDS);
```
### Questions:
Could you please advise on what might be causing this issue and how to resolve it?
I suspect it could be due to GPU resource conflicts in the streaming application. Are there any debugging tools or methods to analyze and identify the cause of the GPU hang?
Thank you for your assistance!
### What's the usage scenario when you are seeing the problem?
Video Conference
### What impacted?
_No response_
### Debug Information
### Environment Details:
I used static linking to compile and integrate libVPL and used 2.x API with internal memory management.
OS Name: Microsoft Windows 11 Enterprise
Processor: 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz, 2995 MHz, 4 Core(s), 8 Logical Processor(s)
GPU: Intel(R) Iris(R) Xe Graphics
**Implementation Details printed from VPL:**
API Version: 2.13
Implementation Type: HW
Acceleration Mode: D3D11
Device ID: 9a49/0
Library Path: C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_cde0692e341c0589\libmfx64-gen.dll
### What I Have Tried:
- Verified that my code is correct. I built a standalone test program to perform raw frame file denoising using the same code. The test program and the original streaming application were started at the same time and work fine.
- Tried alternative APIs like MFXVideoVPP_ProcessFrameAsync and MFXVideoCORE_SyncOperation, but they did not resolve the issue.
- Tried another VPP function, like scaling, the issue presists.
### Do you want to contribute a patch to fix the issue?
None
Contributor guide
Assessment
This issue has not been assessed yet.