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

"HW busy now" when calling vaSyncSurface sometimes #747

Open
maxnelso opened this issue Aug 29, 2023 · 1 comment
Open

"HW busy now" when calling vaSyncSurface sometimes #747

maxnelso opened this issue Aug 29, 2023 · 1 comment

Comments

@maxnelso
Copy link

maxnelso commented Aug 29, 2023

Sorry for the vague question, but I'm not understanding the error I'm seeing from libva. My setup is as follows: I have two different video streams that I'm trying to decode simultaneously, so I have one VADisplay, two VAContextID's, and two different VASurfaceID's that I'm decoding to. Without getting too much in the weeds, I call something similar to this for each stream:

vaBeginPicture(hw_context_->display(), va_context_->context_id(), va_surface_id);
vaEndPicture(hw_context_->display(), va_context_->context_id());

Then, for each stream, I want to wait for the surface to be finished decoding:

vaSyncSurface(hw_context_->display(), va_surface_id);

However, some amount of time (maybe 60% of the time?), I get VA_STATUS_ERROR_HW_BUSY when calling vaSyncSurface. What does this error mean in the context of decoding? From the docs it appears like this error should only happen if you try and kick off two decoding jobs on the same context, but I have been careful to create two different VAAPI contexts.

Curiously, if I call vaSyncSurface immediately after starting the decoding job for one stream (thereby making the whole process serial, and defeating the purpose of having two different streams), then I no longer see this error. It seems like there is some contamination across VAAPI contexts? Is the flow I'm trying to do supported?

I looked at the trace file, but it didn't contain anything useful as far as I could tell. This is an HEVC stream if that is important! Thanks for any help!

@maxnelso maxnelso changed the title "HW busy now" when calling vaSyncSurfaces sometimes "HW busy now" when calling vaSyncSurface sometimes Aug 29, 2023
@XinfengZhang
Copy link
Contributor

XinfengZhang commented Sep 14, 2023

  1. from your description , it should work to decode 2 stream simultaneously.

  2. the only request is , you should avoid same VA object was used in these two streams, please refer "multithread guide" in http://intel.github.io/libva/ . from your description, there should not be any such issue.

  3. HW_BUSY always means , there are something wrong in HW, and there should be a gpu hang or gpu reset, you could check dmesg to check it. most likely it should because same VA object was used cross context. if you are sure it is not the case. please file issue with reproducing method to backend driver repo, such as https://github.com/intel/media-driver

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

2 participants