First time here? Check out the FAQ!

Ask Your Question
1

Long delay on cv::gpu::GpuMat::upload after upgrade to GTX970

asked Jan 4 '15

wronglyNeo gravatar image

updated Jan 6 '15

Hello,

I have been using the gpu module (cuda) of OpenCV in my program for a while and it worked fine. Now I upgraded my graphics card to a gtx970. Now, the first time I call cv::gpu::GpuMat::upload after launching the program I get a very long delay. With my old graphics card (GTX770) this completed nearly instantly.

Example: I have an image which is 512x600 pixels in size. With this image it takes 12s. If I execute the same code again afterwards without closing the program it works instantaneously. I know that the first time the CUDA code is executed after launching the program, it is compiled on the GPU, so a certain delay is normal. But to me this appears to be inexplicably long, especially because it was much faster with the old card.

Does anyone know what could cause this behaviour? Are there any known issues of the current OpenCV version in connection with GTX970 cards? The version I am using is 2.4.10 which is, apart from the 3.0beta, the latest one. I compliled OpenCV with CUDA when I still had my old Graphics Card. Could compiling it again with the new one help? (I wouldn't think so)

EDIT:

I now discovered that there is a Release of the CUDA Toolkit that specifically supports GTX970 and GTX980 cards:

https://developer.nvidia.com/cuda-dow...

I downloaded it and compiled OpenCV again with that one. Unfortunately, this didn't solve my problem. Somehow I have got the feeling it takes even longer now.

Is there no one here who has any experiences with GTX900 cards and OpenCV?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
3

answered Jan 7 '15

wronglyNeo gravatar image

Ok, I figured it out. You have to tell the nvcc compiler to create binary code for the new device generation (compute capability 5.2 instead of 3.0 for the old card). When building the OpenCV project with cmake there is a variable CUDA_ARCH_BIN in the CUDA group that is currently set to 1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5 per default. I added 5.2 to the list, generated and compiled again. Now it works fine.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Jan 4 '15

Seen: 1,866 times

Last updated: Jan 07 '15