cuda - update npp calls to use the new NppStreamContext API if available#3803
Merged
asmorkalov merged 1 commit intoopencv:4.xfrom Nov 5, 2024
Merged
Conversation
a7fdf2f to
06f764a
Compare
Contributor
Author
|
@asmorkalov Would it be possible to run this on the CI? |
Contributor
Author
|
@asmorkalov I've just noticed you've merged opencv/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 merging opencv/opencv#26245 breaks streaming for all OpenCV functions which use NPP under the hood when OpenCV is compiled against CUDA >=12.4. |
asmorkalov
approved these changes
Nov 5, 2024
asmorkalov
approved these changes
Nov 5, 2024
Merged
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requires changes in opencv/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
_Ctxversion which took aNppStreamContextor an implementation present in the NPP library. Therefore in this PR theUSE_NPP_STREAM_CTXflag 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_Ctxwhich doesn't have an implementation inside nppist.lib or libnppist.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 in https://github.com/tomoaki0705/opencv/blob/f4e5d777e856f751c4318f0c633dcce37cfa66f2/modules/cudaarithm/src/reductions.cpp#L161 which you disabled in opencv/opencv#11064 because it looks like you fixed it with opencv/opencv#11550 is this correct?
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.