Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

cuda - update npp calls to use the new NppStreamContext API if available#3803

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@cudawarped
Copy link
Contributor

@cudawarpedcudawarped commentedOct 3, 2024
edited
Loading

Requires changes inopencv/opencv#26245

Update calls to Nvidia's NPP library to use the newer NppStreamContext API introduced in CUDA 10.1 (release notes)

Although this was introduced in CUDA 10.1 at that point not all of the functions either had a_Ctx version which took aNppStreamContext or an implementation present in the NPP library. Therefore in this PR theUSE_NPP_STREAM_CTX flag which selects the new API is only enabled for versions of NPP >= 12205 (the version included with CUDA toolkit 12.4) which I have verified as working. Currently the only function called inside OpenCV which does not work with the new API isnppiEvenLevelsHost_32s_Ctx which doesn't have an implementation insidenppist.lib orlibnppist.so as of CUDA 12.6.

Tested locally on Ubuntu 20.04 with both CUDA toolkits 12.3 and 12.4.

Adds changes discussed in#3338 to all Npp functions called by OpenCV.
Fixes#3798

@tomoaki0705 I have re-introduced streaming inhttps://github.com/tomoaki0705/opencv/blob/f4e5d777e856f751c4318f0c633dcce37cfa66f2/modules/cudaarithm/src/reductions.cpp#L161 which you disabled inopencv/opencv#11064 because it looks like you fixed it withopencv/opencv#11550 is this correct?

Pull Request Readiness Checklist

See details athttps://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 another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the 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

@cudawarpedcudawarpedforce-pushed thecuda_update_to_npp_stream_ctx branch froma7fdf2f to06f764aCompareOctober 3, 2024 12:39
@cudawarped
Copy link
ContributorAuthor

@asmorkalov Would it be possible to run this on the CI?

@cudawarped
Copy link
ContributorAuthor

@asmorkalov I've just noticed you've mergedopencv/opencv#2624.

I should have mentioned in that PR that both that and this PR are dependant on each other. Because NPP streams were previously global entities, only mergingopencv/opencv#26245 breaks streaming for all OpenCV functions which use NPP under the hood when OpenCV is compiled against CUDA >=12.4.

asmorkalov reacted with confused emojiasmorkalov reacted with eyes emoji

@asmorkalovasmorkalov merged commitc76792f intoopencv:4.xNov 5, 2024
10 checks passed
@asmorkalovasmorkalov mentioned this pull requestNov 13, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@asmorkalovasmorkalovasmorkalov approved these changes

Assignees

@asmorkalovasmorkalov

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Morphology operation is slower on GPU than same operation on CPU

2 participants

@cudawarped@asmorkalov

[8]ページ先頭

©2009-2025 Movatter.jp