Ask Your Question

Huge time to upload data to GPU

asked 2012-08-21 04:59:55 -0600

TrueBers gravatar image

updated 2012-08-21 05:12:20 -0600

Good day! I've just built the latest master branch of OpenCV with CUDA support. So, I tried some sample code:

Mat shot = imread("D:\\shot.bmp"); // Shot.bmp is a picture 1571x1002
gpu::GpuMat gpuShot;

The last line "gpuShot.upload(shot);" takes huge time to invoke! It takes about 4-5 seconds to upload to GPU! Is it normal for that? I don't think so... BTW: My hardware is GeForce GT 520.

And second question: the file "opencv_gpu249d.dll" has size about 250 Mb! Meanwhile, "opencv_gpu242d.dll" from official prebuild boundle (v.2.4.2) has size approx 800 Kb. What the hell of a size? And what I doing wrong? Please help, thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-08-21 07:13:49 -0600

Vladislav Vinogradov gravatar image

The first gpu function call is always takes more time, because CUDA initialize context for device. The following calls will be faster.

800 Kb means that OpenCV was compiled without CUDA support and this module is just a dummy. 250 Mb is a real size of gpu module that was compiled for all compute capabilities.

edit flag offensive delete link more


Oh, thank you for explanation!

TrueBers gravatar imageTrueBers ( 2012-08-21 08:36:38 -0600 )edit

Question Tools



Asked: 2012-08-21 04:59:55 -0600

Seen: 3,691 times

Last updated: Aug 21 '12