Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem solved!

For anyone wanting to know how to speed up opencv initialization, here ya go:

  1. Compile binary CUDA kernels for your compute capability (mine was 3.5) (~20% of the extra time)
  2. Compile the library statically instead of dynamically (~40% of the extra time)
  3. Remove all GUI dependencies (~40% of the extra time)

These three changes took my start time from ~7.5 seconds down to ~0.7 seconds (almost the same as it is without opencv at all). Here's the cmake flags I changed to do the above:

CUDA_ARCH_BIN=3.5
CUDA_ARCH_PTX=
BUILD_SHARED_LIBS=off
CMAKE_CXX_FLAGS=-fPIC
WITH_QT=off
WITH_VTK=off
WITH_GTK=off
WITH_OPENGL=off

Hope this helps someone out in the future - there certainly is little information out there about this.