Ask Your Question

OpenCV Error: The function/feature is not implemented

asked 2018-03-20 16:23:58 -0500

abdorreza gravatar image

updated 2018-03-20 16:24:20 -0500

I am using : Visual Studio2017 (v 15) and OpenCV 3.4.0 and Cuda toolkit 9.1

When I use "labelComponents" in my project then occur a problem :

"OpenCV Error: The function/feature is not implemented (The called functionality is disabled for current build or platform) in throw_no_cuda, file C:\OpenCV 3.4.0\opencv-3.4.0\modules\core\include\opencv2/core/private.cuda.hpp, line 111"

How I can solve this problem ?

edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted

answered 2018-03-21 05:12:46 -0500

updated 2018-03-21 10:23:57 -0500

The labelComponents algorithm is legacy and uses Nvidia's NPP library, graphcut api. Unfortunately this was removed by Nvidia in CUDA 8.0.

If you read the git log you for modules\cudalegacy\src\graphcuts.cpp you can see that it was moved from cuda to cudalegacy in Jan 2015, probably because of the removal of the above api.

If you look at the source for labelComponents, line 46 you can see that only the headers are included for versions of CUDA greater than or equal to 8, to allow OpenCv to compile with the legacy modules selected.

Because you are 100% that you need to process on the GPU I dug out some timing results I had for a CUDA CCL implementation I worked on at a previous company, to give you an indication of the performance increase that is achievable when performing CCL on the GPU.

The comparison was connectedComponentsWithStats and cvFindContours run on a laptop i7 vs against our ccl implementation on a gtx 980m with CUDA 8.0 (no cooperative groups).

Because CCL algorithms on the GPU are iterative the execution time is highly dependent on the type of image you are looking at. For example our CUDA implementation was only slightly faster on the below 1080p maze image

image description

cvFindContours: 16.3ms 
connectedComponentsWithStats: 4.5ms 
customCCL: 3.9ms

however on the below classic foreground image (enlarged to 960x2240 to saturate the GPU)

image description

our implementation was over 2x faster

cvFindContours: 0.63ms
connectedComponentsWithStats: 3.2ms
customCCL: 1.4ms

however on this type of image you cvFindContours performs extremely efficiently

Our implementation of the CCL algorithm was competitive being significantly faster than ArrayFire's regions, mainly because it required fewer iterations to converge.

edit flag offensive delete link more


Thank you dear. my Graphic card is NVIDIA GeForce 920mx. do I use CUDA toolkit 9.1 for my work or I must use CUDA 5.0? becuase I saw GeForce 920mx support CUDA 5.0 !

abdorreza gravatar imageabdorreza ( 2018-03-21 16:04:38 -0500 )edit

I think you are confusing compute capability with CUDA version. If you want to use labelComponents you will need to compile OpenCV with CUDA 7.5 or earlier (if this is possible with the latest version, OpenCV 3.4). Your card supports compute capability 5.0, which is fine for everything you want to do.

Unfortunately your card has very low bandwidth, 14.4GB/s so the result of your CCL, if you get it to work will most likely be slower on the GPU and CPU. I have timings for a similar card 840M vs an i5-5200U on the above images Maze:

cvFindContours: 17.07ms
connectedComponentsWithStats: 10.77ms
customCCL: 14.82ms


cvFindContours: 0.64ms
connectedComponentsWithStats: 6.85ms
customCCL: 6.68ms
cudawarped gravatar imagecudawarped ( 2018-03-22 07:59:14 -0500 )edit

thank you so much for your help :)

abdorreza gravatar imageabdorreza ( 2018-03-23 05:44:56 -0500 )edit

CUDA toolkit 7.5 isn,t compatible with my NVIDIA hardware !!! Now what must I to do ?!!!!??!

abdorreza gravatar imageabdorreza ( 2018-03-23 10:43:16 -0500 )edit

Sorry, that makes perfect sense you have a 920mx which came out after CUDA 7.5. You need to either write your own CCL CUDA routines, or use another library which implements the functionality you are looking for.

cudawarped gravatar imagecudawarped ( 2018-03-23 13:46:13 -0500 )edit

answered 2018-03-21 03:03:25 -0500

LBerger gravatar image

updated 2018-03-21 03:07:09 -0500

Have you build opencv with cuda and set flag BUILD_opencv_cudalegacy:BOOL=ON ?

see labelComponents

edit flag offensive delete link more


I don't know dear !!! I must chek it !!! thank you dear.

abdorreza gravatar imageabdorreza ( 2018-03-21 16:05:07 -0500 )edit

Yes. I did it.

abdorreza gravatar imageabdorreza ( 2018-03-21 17:41:01 -0500 )edit

answered 2019-10-22 04:55:44 -0500

friendCYQ gravatar image

updated 2019-10-22 04:59:11 -0500

Dear friends ,

I used "Visual Studio 2017 (v15)" - "CUDA 10.1" - "OpenCV 3.4.7".

I turned CUDA,opencv_contrib,OPENCV_ENABLE_NONFREE in CMAKE. But yet I have problem with OpenCV in Visual Studio C++. OpenCV(3.4.7) Error: The function/feature is not implemented (The called functionality is disabled for current build or platform) in throw_no_cuda, file D:\OpenCV\opencv\sources\modules\core\include\opencv2/core/private.cuda.hpp, line 113

and i'd want to know what i should do to solve it, thanks a billion!!!

edit flag offensive delete link more


@friendCYQ please do NOT post an answer here, if you have a question or comment, thank you !

berak gravatar imageberak ( 2019-10-22 04:57:51 -0500 )edit

answered 2018-03-26 06:56:33 -0500

abdorreza gravatar image

Dear friends ,

I used "Visual Studio 2017 (v15)" - "CUDA 9.1" - "OpenCV 3.4.1".

I turned CUDA, CUFFT, CUBLAS, FAST_MATH in CMAKE. But yet I have problem with OpenCV in Visual Studio C++. When I use "labelComponents" then occur a error :

"OpenCV(3.4.1) Error: The function/feature is not implemented (The called functionality is disabled for current build or platform) in throw_no_cuda, file C:\OpenCV 3.4.1\opencv-3.4.1\modules\core\include\opencv2/core/private.cuda.hpp, line 111"

edit flag offensive delete link more


See my answer above. labelComponents uses the graphcuts api which was depreciated in CUDA 8.0, therefore it will not work with CUDA 9.1.

cudawarped gravatar imagecudawarped ( 2018-03-26 08:16:26 -0500 )edit

thank you dear. But why ?!!!!!!

abdorreza gravatar imageabdorreza ( 2018-03-26 09:20:33 -0500 )edit

Why was it depreciated? Ask Nvidia. Just to clarify, by depreciated, I mean it does not exist in CUDA 9.1 and therefore the functions which labelComponents calls do not exist.

cudawarped gravatar imagecudawarped ( 2018-03-26 12:23:20 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-03-20 16:23:58 -0500

Seen: 1,961 times

Last updated: Oct 22 '19