- Notifications
You must be signed in to change notification settings - Fork5.9k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
a7fdf2f to06f764aComparecudawarped commentedOct 29, 2024
@asmorkalov Would it be possible to run this on the CI? |
cudawarped commentedNov 4, 2024
@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. |
c76792f intoopencv:4.xUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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
_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 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
Patch to opencv_extra has the same branch name.