OpenCV 3.1.0, CUDA 8.0.44 , Ubuntu 14.04 kernel 3.13.0-100-generic
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!!!
installed opencv 3.1.0 & CUDA 8.0.44 & cuDNN 5.1.5 on GTX 1070 compile success !!
compile test program (tan_triggs algorithm) https://github.com/bytefish/opencv/bl...
./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 ^^
your test code does not use cuda at all. (maybe opencl under the hood)
see here for cuda samples
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 ^^
Try timing it in a second run, your first run probably does an internal OpenCL initialization and thus gives you a wrong impression.
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. .....
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!!!
Try to set environment variable
OPENCV_OPENCL_DEVICE=disabled
and run test again.Nothing changed !! ~~, so now i update the kernel of system to 4.2XXXXX ^^
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 ^^
and I guess that this is related to ippicv.a ^^ maybe, i am not sure ~~
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 ~~~