Skip to content

[G-API] Async infer request hotfix#19533

Merged
alalek merged 3 commits intoopencv:masterfrom
TolyaTalamanov:at/async-requests-hotfix
Feb 17, 2021
Merged

[G-API] Async infer request hotfix#19533
alalek merged 3 commits intoopencv:masterfrom
TolyaTalamanov:at/async-requests-hotfix

Conversation

@TolyaTalamanov
Copy link
Copy Markdown
Contributor

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Overview

  • In case empty roi list for InferROIList & Infer2 data will be got from StreamingOutput but not post back, due the list is empty, it cause hanging.
  • Since the async request and collecting data for the next frame work asynchronously, there is a data race on StreamingOutput object, because callback can call StreamingOutput::post method while the StreamingOutput::get is working.

Build configuration

Xforce_builders_only=linux,docs
force_builders=Custom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

build_image:Custom=centos:7
buildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

Xbuild_image:Custom=ubuntu-openvino-2021.1.0:20.04
build_image:Custom Win=openvino-2021.1.0
build_image:Custom Mac=openvino-2021.1.0

Xtest_modules:Custom=gapi
test_modules:Custom Win=gapi
test_modules:Custom Mac=gapi

Xbuildworker:Custom=linux-1
# disabled due high memory usage: test_opencl:Custom=ON
Xtest_opencl:Custom=OFF
Xtest_bigdata:Custom=1
Xtest_filter:Custom=*

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@dmatveev Could you have a look ?

// wait until it is over and run kernel.
// (At this point, an asynchronous request will be started.)
// 5. Without waiting for the completion of the asynchronous request
// 4. Without waiting for the completion of the asynchronous request
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This text is hard to read. I'd rephrase it as "go to the next frame without ..."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@TolyaTalamanov TolyaTalamanov force-pushed the at/async-requests-hotfix branch from 429e597 to 19abc71 Compare February 17, 2021 10:42
@alalek alalek merged commit 413c056 into opencv:master Feb 17, 2021
@alalek alalek mentioned this pull request Apr 9, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…-hotfix

[G-API] Async infer request hotfix

* Fix hanging on empty roi list

* Prevent possible data race

* Clean up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants