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

Refined the DEADLOCK_DEBUG outputs in each encoding stage. #492

Merged
merged 7 commits into from
Mar 23, 2020

Conversation

Austin-Hu
Copy link
Contributor

@Austin-Hu Austin-Hu commented Mar 12, 2020

To track each picture whether it's posted from every encoding kernel or not, after being fed into kernels.

As the message is to track picture level, this change can output picture flow once in each encoding kernel, with redundant outputs eliminated.

The recommended steps to debug encoding dead lock (hang) issue:

  1. Track the POCs in the entrance and exit of the encoding pipeline,
    by forcibly printing the 1st DEADLOCK_DEBUG log in RC, and the
    last DEADLOCK_DEBUG log in PK;
  2. Reorder the POC numbers of RC and PK separately, to check the
    1st POC which couldn't be outputted from PK;
  3. Open the DEADLOCK_DEBUG switch, and change the MIN_POC & MAX_POC
    values clamping the range where that POC locates;
  4. Check the specific stage where that POC can't go through.

Signed-off-by: Austin Hu austin.hu@intel.com

Signed-off-by: Austin Hu <austin.hu@intel.com>
Source/Lib/Codec/EbEncDecProcess.c Outdated Show resolved Hide resolved
@@ -2100,6 +2097,9 @@ void* ModeDecisionConfigurationKernel(void *inputPtr)
EbPostFullObject(encDecTasksWrapperPtr);
}
}
#if DEADLOCK_DEBUG
SVT_LOG("POC %lu MDC OUT \n", pictureControlSetPtr->pictureNumber);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to right after EbPostFullObject?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ModeDecisionConfiguration posts tile group(s) of a picture to EncDec. But DEADLOCK_DEBUG is used to track picture level, not tile, segment or LCU level.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. thank you.

Source/Lib/Codec/EbPictureManagerProcess.c Outdated Show resolved Hide resolved
@tianjunwork tianjunwork added the Clean up A cleaner implementation or improved functionality label Mar 12, 2020
Signed-off-by: Austin Hu <austin.hu@intel.com>
#if DEADLOCK_DEBUG
SVT_LOG("POC %lld ENCDEC OUT \n", pictureControlSetPtr->pictureNumber);
SVT_LOG("POC %lu ENCDEC OUT \n", pictureControlSetPtr->pictureNumber);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I run this PR, the line sometimes shows later than PK OUT.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, due to the race condition that, PK triggered from Line 3051 may happen before the current picture completes its encoding with SAO and other stuff.

Signed-off-by: Austin Hu <austin.hu@intel.com>
Signed-off-by: Austin Hu <austin.hu@intel.com>
The recommended steps to debug encoding dead lock (hang) issue:
1. Track the POCs in the entrace and exit of the encoding pipeline,
   by forcibly printing the 1st DEADLOCK_DEBUG log in RC, and the
   last DEADLOCK_DEBUG log in PK;
2. Reorder the POC numbers of RC and PK separately, to check the
   1st POC which couldn't be outputted from PK;
3. Open the DEADLOCK_DEBUG switch, and change the MIN_POC & MAX_POC
   values clamping the range where that POC locates.
2. Check the specific stage where that POC can't go through.

Signed-off-by: Austin Hu <austin.hu@intel.com>
@intelmark
Copy link
Contributor

Do you have a bit more background on why the MIN/MAX check is needed. If it's to help pinpoint issues in debugging, then maybe add a comment saying that this is the purpose of these defines.

Just fyi. A typical value for UINT_MAX is 4294967295 which for a 60fps video corresponds to a duration of close to 20k hours.

Signed-off-by: Austin Hu <austin.hu@intel.com>
@Austin-Hu
Copy link
Contributor Author

Do you have a bit more background on why the MIN/MAX check is needed. If it's to help pinpoint issues in debugging, then maybe add a comment saying that this is the purpose of these defines.

Just fyi. A typical value for UINT_MAX is 4294967295 which for a 60fps video corresponds to a duration of close to 20k hours.

Added the instructions into the code, thanks!
Yes, for example, an unlimitted video conference...

Signed-off-by: Austin Hu <austin.hu@intel.com>
@tianjunwork tianjunwork merged commit 4445617 into OpenVisualCloud:master Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean up A cleaner implementation or improved functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants