OpenCV 3.1.0, CUDA 8.0.44 , Ubuntu 14.04 kernel 3.13.0-100-generic

asked 2016-11-07 05:38:02 -0600

Sedgewick77 gravatar image

updated 2016-11-07 20:27:34 -0600

the problem summary : independent of CUDA lib. the opencv program became slow when we use opencv 3.1.0 compared to opencv 2.4.X on the same machine!!!

  1. installed opencv 3.1.0 & CUDA 8.0.44 & cuDNN 5.1.5 on GTX 1070 compile success !!

  2. compile test program (tan_triggs algorithm) https://github.com/bytefish/opencv/bl...

  3. ./test aaa.jpg bbb.jpg success !! but too slow , too slow !!! about over 3.0 sec.

what's the problem? (opencv 3.1.0 problem? Linux Kernel Problem? cuda version problem?, GTX 1070 problem? )

and solution?

I tested same program in other machines.


Test 1: opencv 3.1.0 & CUDA 7.5 on Titan X (Maxwell) 0.04 sec (kernel 4.2.0-35-generic ubuntu 14.04)

Test 2: opencv 3.1.0 & CUDA 7.0 on Tital X (Maxwell) 0.04 sec (kernel 3.19.0-56-generic ubuntu 14.04)

Test 3 : opencv 2.4.9 & CUDA 7.0 on Titan X(Maxwell) 0.04 sec (kernel 3.19.0-56-generic ubuntu 14.04)

Test 4: opencv 2.4.7 & no CUDA lib on GTX 1070 0.04 sec (kernel 3.13.0-100-generic ubuntu 14.04)


the very strange result is below.!!!

the time result on the same machine and different opencv versions is belows (in the same machine, OpenCV 3.1.0 and opencv 2.4.7 version time comparison, CUDA 8.0.44 , Ubuntu 14.04 kernel 3.13.0-100-generic)

-== opencv 2.4.7 (apt-get install ) and no cuda ==-

time ./test aaa.jpg ooo.jpg

real 0m0.042s user 0m0.024s sys 0m0.016s

-== opencv 3.1.0 (source install) and cuda 8.0 ==-

time ./test aaa.jpg bb.jpg

real 0m4.279s user 0m0.012s sys 0m1.744s

Please let me know the reason and solution ....

I profiled function execution time : so i found pow(X, gamma, I); takes over 2 secs in opencv 3.1.0, and 0.001s in opencv 2.4.X , hmm, but i am not sure the reason ^^

edit retag flag offensive close merge delete

Comments

1

your test code does not use cuda at all. (maybe opencl under the hood)

see here for cuda samples

berak gravatar imageberak ( 2016-11-07 05:55:32 -0600 )edit

hmm. so as your opinion, this is not the problem of CUDA or GPU. Okay I understand.

so what makes difference of execution ? i want to know that i use this combination(installation) for developing programs. and i want to fix the problems (slow execution time).

and i tested build/bin/opencv test code

the result is belows ^^

  • [----------] Global test environment
  • tear-down [==========] 10323 tests
  • from 193 test cases ran. (832440 ms
  • total) [ PASSED ] 10322 tests. [
  • FAILED ] 1 test, listed below: [
  • FAILED ] Core_globbing.accuracy
Sedgewick77 gravatar imageSedgewick77 ( 2016-11-07 06:08:32 -0600 )edit
1

Try timing it in a second run, your first run probably does an internal OpenCL initialization and thus gives you a wrong impression.

StevenPuttemans gravatar imageStevenPuttemans ( 2016-11-07 06:31:44 -0600 )edit

thank you for your reply Steven, but the result is same, first time and second time. and as you see (in my post, last paragraph), in the same machine using opencv 2.4.7 (apt-get install version), opencv 3.1.0 (source compile version) , the result is different !! ,.... i guess that the reason is the machine problem or kernel problem. i am not sure. .....

Sedgewick77 gravatar imageSedgewick77 ( 2016-11-07 06:53:47 -0600 )edit

the problem summary : independent of CUDA lib. the opencv program became slow when we use opencv 3.1.0 compared to opencv 2.4.X on the same machine!!!

Sedgewick77 gravatar imageSedgewick77 ( 2016-11-07 07:27:28 -0600 )edit

Try to set environment variable OPENCV_OPENCL_DEVICE=disabled and run test again.

mshabunin gravatar imagemshabunin ( 2016-11-07 08:59:21 -0600 )edit

Nothing changed !! ~~, so now i update the kernel of system to 4.2XXXXX ^^

Sedgewick77 gravatar imageSedgewick77 ( 2016-11-07 19:49:59 -0600 )edit

I profiled function execution time : so i found pow(X, gamma, I); takes over 2 secs in opencv 3.1.0, and 0.001s in opencv 2.4.X , hmm, but i am not sure the reason ^^

Sedgewick77 gravatar imageSedgewick77 ( 2016-11-07 20:27:13 -0600 )edit

and I guess that this is related to ippicv.a ^^ maybe, i am not sure ~~

Sedgewick77 gravatar imageSedgewick77 ( 2016-11-08 00:39:04 -0600 )edit

it is not ippicv.a problem, and i upgrade kernel to 4.4 , but failed. ... i almost give up ^^ .... and i think this is system problem!!! so i concluded that i must use opencv 2.4.X for this machine ~~~ sad ~~~

Sedgewick77 gravatar imageSedgewick77 ( 2016-11-08 02:45:47 -0600 )edit