Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: GPU Hang When Calling MFXVideoVPP_RunFrameVPPAsync and Synchronize #357

Open
JinCanran opened this issue Jan 16, 2025 · 1 comment

Comments

@JinCanran
Copy link

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

@JinCanran
Copy link
Author

The program has already loaded \iigd_dch.inf_amd64_cde0692e341c0589\libmfx64.dll in other module. Could this be the cause?
I forced the VPL dispatcher to load libmfx64.dll instead of libmfx64-gen.dll in denoising module, but it didn't slove the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant