Skip to content

OpenCVビルド情報、CUDA情報取得

atinfinity edited this page Jul 27, 2016 · 13 revisions

OpenCVビルド情報、CUDA情報取得

OpenCVビルド情報取得

cv::getBuildInformationメソッドを使うことでOpenCVビルド時のカスタマイズ情報を取得することができます.詳細は公式APIドキュメントの説明を参照ください.

※このAPIを使うにはopencv2/core/utility.hppをインクルードする必要があります.

CUDA情報取得取得

cv::cuda::printShortCudaDeviceInfoメソッドを使うことで動作環境におけるCUDA情報を取得することができます.より詳細な情報を取得したい場合はcv::cuda::printCudaDeviceInfoメソッドを使ってください.

※このAPIを使うにはopencv2/core/cuda.hppをインクルードする必要があります.

サンプルコード

#include <opencv2/core.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/core/cuda.hpp>
#include <iostream>

int main(int argc, const char* argv[])
{
    // (1) OpenCVビルド情報を表示する
    std::cout << cv::getBuildInformation() << std::endl;

    // (2) CUDA情報を表示する
    cv::cuda::printShortCudaDeviceInfo(cv::cuda::getDevice());
    return 0;
}

出力例

筆者の環境における各関数の出力例を以下に示します.

cv::getBuildInformation出力例

General configuration for OpenCV 3.0.0-rc1 =====================================
  Version control:               unknown

  Platform:
    Host:                        Windows 6.2 AMD64
    CMake:                       3.2.1
    CMake generator:             Visual Studio 11 2012 Win64
    CMake build tool:            C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe
    MSVC:                        1700

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/x86_amd64/cl.exe  (ver 17.0.61030.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 /wd4324 /MP12  /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 /wd4324 /MP12  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 11.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    /MP12  /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    /MP12  /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:                 hal cudev core cudaarithm flann imgproc ml video cudabgsegm cudafilters cudaimgproc cudawarping imgcodecs photo shape videoio highgui objdetect ts features2d calib3d cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo stitching superres videostab python3
    Disabled:                    cudacodec python2 world
    Disabled by dependency:      -
    Unavailable:                 androidcamera java 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.8)
    JPEG:                        build (ver 90)
    WEBP:                        build (ver 0.3.1)
    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)
    GDAL:                        NO

  Video I/O:
    Video for Windows:           NO
    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)
      resample:                  NO
      gentoo-style:              YES
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    OpenNI2:                     NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    DirectShow:                  YES
    Media Foundation:            YES
    XIMEA:                       NO
    Intel PerC:                  NO

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

  NVIDIA CUDA
    Use CUFFT:                   YES
    Use CUBLAS:                  YES
    USE NVCUVID:                 NO
    NVIDIA GPU arch:             30
    NVIDIA PTX archs:
    Use fast math:               NO

  OpenCL:
    Version:                     dynamic
    Include path:                C:/dev/opencv-3.0.0-rc1/3rdparty/include/opencl/1.2
    Use AMDFFT:                  NO
    Use AMDBLAS:                 NO

  Python 2:
    Interpreter:                 C:/Python34/python.exe (ver 3.4.3)

  Python 3:
    Interpreter:                 C:/Python34/python.exe (ver 3.4.3)
    Libraries:                   C:/Python34/libs/python34.lib (ver 3.4.3)
    numpy:                       C:/Python34/lib/site-packages/numpy/core/include (ver 1.9.2)
    packages path:               C:/Python34/Lib/site-packages

  Python (for build):            C:/Python34/python.exe

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

  Matlab:
    mex:                         NO

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

  Install path:                  C:/dev/opencv-3.0.0-rc1/build/install

  cvconfig.h is in:              C:/dev/opencv-3.0.0-rc1/build
-----------------------------------------------------------------

cv::cuda::printShortCudaDeviceInfo出力例

Device 0:  "GeForce GTX 680"  2048Mb, sm_30, 1536 cores, Driver/Runtime ver.6.50/6.50

cv::cuda::printCudaDeviceInfo出力例

*** CUDA Device Query (Runtime API) version (CUDART static linking) *** 

Device count: 1

Device 0: "GeForce GTX 680"
  CUDA Driver Version / Runtime Version          6.50 / 6.50
  CUDA Capability Major/Minor version number:    3.0
  Total amount of global memory:                 2048 MBytes (2147483648 bytes)
  ( 8) Multiprocessors x (192) CUDA Cores/MP:     1536 CUDA Cores
  GPU Clock Speed:                               1.06 GHz
  Max Texture Dimension Size (x,y,z)             1D=(65536), 2D=(65536,65536), 3D=(4096,4096,4096)
  Max Layered Texture Size (dim) x layers        1D=(16384) x 2048, 2D=(16384,16384) x 2048
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per block:           1024
  Maximum sizes of each dimension of a block:    1024 x 1024 x 64
  Maximum sizes of each dimension of a grid:     2147483647 x 65535 x 65535
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and execution:                 Yes with 1 copy engine(s)
  Run time limit on kernels:                     Yes
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Concurrent kernel execution:                   Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support enabled:                No
  Device is using TCC driver mode:               No
  Device supports Unified Addressing (UVA):      Yes
  Device PCI Bus ID / PCI location ID:           2 / 0
  Compute Mode:
      Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) 

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version  = 6.50, CUDA Runtime Version = 6.50, NumDevs = 1

備考

筆者はOpenCV 3.0.0で動作確認しました.


Menu

Computer Vision

GPGPU

AR

ROS

Docker

Jetson

ARM

プログラミング言語

開発環境

勉強会

Clone this wiki locally