cuda::GpuMat using too much memory

asked 2016-09-07 20:28:08 -0500

chpatrick gravatar image

I'm using cudafeatures2d to do ORB feature matching. I want to upload all of the descriptor sets that I want to match against, but I'm finding that for some reason each GpuMat takes up 16x as much GPU memory as it should.

For example, if I upload a descriptor Mat of 20107x32 bytes (should be 628.3 KiB), I can see in nvidia-smi that my process's memory usage increases by 10 MiB. This goes on until my total process GPU memory use reaches about 2 GiB, when it crashes with the following exception:

opencv-3.1.0/modules/core/src/cuda/ error: (-217) out of memory in function allocate

This is also weird because my GPU has 6 GB of RAM, not 2.

Any idea what's going on?

edit retag flag offensive close merge delete


Best guess, your opencv installation is not running the compute capability specifically for your card, and thus gets the 2GB upper limit wrong. Can your rebuild your OpenCV specifically for your architecture only?

StevenPuttemans gravatar imageStevenPuttemans ( 2016-09-08 05:59:15 -0500 )edit

I built it specifically for my architecture (Pascal).

chpatrick gravatar imagechpatrick ( 2016-09-08 08:22:05 -0500 )edit

Are there any updates on this matter?

ClaudioF gravatar imageClaudioF ( 2017-08-18 07:41:05 -0500 )edit