cuda::GpuMat using too much memory
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/gpu_mat.cu:71: 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?
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?
I built it specifically for my architecture (Pascal).
Are there any updates on this matter?