Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to build CUDA library into app

Hello,

currently I have opencv 2.4.9 compiled with WITH_CUDA=ON and Visual Sutdio 2013.

I have a little program :

int ngpus = cv::gpu::getCudaEnabledDeviceCount();
    if (ngpus > 0) {
             ...
        }
printf("error\n");
return -1;

So this work good when I compile in VS, but if i take the myprog.exe and move it in another folder i get this error :

the library is compiled without CUDA support

I was wondering how I can build the library into the app so it will be able to run anywhere instead of just in the bin/release folder.

How to build CUDA library into app

Hello,

currently I have opencv 2.4.9 2.4.10 compiled with WITH_CUDA=ON and Visual Sutdio 2013.

I have a little program :

int ngpus = cv::gpu::getCudaEnabledDeviceCount();
    if (ngpus > 0) {
             ...
        }
printf("error\n");
return -1;

So this work good when I compile in VS, but if i take the myprog.exe and move it in another folder i get this error :

the library is compiled without CUDA support

I was wondering how I can build the library into the app so it will be able to run anywhere instead of just in the bin/release folder.

How to build CUDA library into app

Hello,

currently I have opencv 2.4.10 compiled with WITH_CUDA=ON and Visual Sutdio 2013.

I have a little program :

int ngpus = cv::gpu::getCudaEnabledDeviceCount();
    if (ngpus > 0) {
             ...
        }
printf("error\n");
return -1;

So this work good when I compile in VS, but if i take the myprog.exe and move it in another folder i get this error :

the library is compiled without CUDA support

I was wondering how I can build the library into the app so it will be able to run anywhere instead of just in the bin/release folder.

Here is my cmake configure output :

Checking for Windows (Phone) Platform SDK 8.0/8.1
Checking for Visual Studio 2012/2013
CUDA detected: 6.5
CUDA NVCC target flags: -gencode;arch=compute_11,code=sm_11;-gencode;arch=compute_12,code=sm_12;-gencode;arch=compute_13,code=sm_13;-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_30,code=compute_30
Could NOT find PythonInterp (missing:  PYTHON_EXECUTABLE) (Required is at least version "2.0")
Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
Assume that non-module dependency is available: cudart (for module opencv_core)
Assume that non-module dependency is available: nppc (for module opencv_core)
Assume that non-module dependency is available: nppi (for module opencv_core)
Assume that non-module dependency is available: npps (for module opencv_core)

General configuration for OpenCV 2.4.10 =====================================
  Version control:               unknown

  Platform:
    Host:                        Windows 6.1 AMD64
    CMake:                       3.1.0
    CMake generator:             Visual Studio 12 2013 Win64
    CMake build tool:            C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe
    MSVC:                        1800

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe  (ver 18.0.30501.0)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /wd4251 /MD /O2 /Ob2 /D NDEBUG  /Zi
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /wd4251 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /MD /O2 /Ob2 /D NDEBUG  /Zi
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    Linker flags (Release):      /machine:x64  /INCREMENTAL:NO  /debug
    Linker flags (Debug):        /machine:x64  /debug /INCREMENTAL 
    Precompiled headers:         YES

  OpenCV modules:
    To be built:                 core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib stitching superres ts videostab
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 androidcamera dynamicuda java python viz

  Windows RT support:            NO

  GUI: 
    QT:                          NO
    Win32 UI:                    YES
    OpenGL support:              NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.2.7)
    JPEG:                        build (ver 62)
    PNG:                         build (ver 1.5.12)
    TIFF:                        build (ver 42 - 4.0.2)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     build (ver 1.7.1)

  Video I/O:
    Video for Windows:           YES
    DC1394 1.x:                  NO
    DC1394 2.x:                  NO
    FFMPEG:                      YES (prebuilt binaries)
      codec:                     YES (ver 55.18.102)
      format:                    YES (ver 55.12.100)
      util:                      YES (ver 52.38.100)
      swscale:                   YES (ver 2.3.100)
      gentoo-style:              YES
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    DirectShow:                  YES
    Media Foundation:            NO
    XIMEA:                       NO
    Intel PerC:                  NO

  Other third-party libraries:
    Use IPP:                     NO
    Use Eigen:                   NO
    Use TBB:                     NO
    Use OpenMP:                  NO
    Use GCD                      NO
    Use Concurrency              YES
    Use C=:                      NO
    Use Cuda:                    YES (ver 6.5)
    Use OpenCL:                  YES

  NVIDIA CUDA
    Use CUFFT:                   YES
    Use CUBLAS:                  NO
    USE NVCUVID:                 NO
    NVIDIA GPU arch:             11 12 13 20 21 30 35
    NVIDIA PTX archs:            30
    Use fast math:               NO

  OpenCL:
    Version:                     dynamic
    Include path:                C:/opencv/sources/3rdparty/include/opencl/1.2
    Use AMD FFT:                 NO
    Use AMD BLAS:                NO

  Python:
    Interpreter:                 NO

  Java:
    ant:                         NO
    JNI:                         NO
    Java tests:                  NO

  Documentation:
    Build Documentation:         NO
    Sphinx:                      NO
    PdfLaTeX compiler:           NO

  Tests and samples:
    Tests:                       YES
    Performance tests:           YES
    C/C++ Examples:              NO

  Install path:                  C:/Binaries/ConsoleApplication1/install

  cvconfig.h is in:              C:/Binaries/ConsoleApplication1
-----------------------------------------------------------------

Configuring done