Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if OpenCV was compiled with TBB, CUDA or Qt support?

Tags:

windows

opencv

How can I find out whether OpenCV library was compiled with TBB or CUDA or QT on Windows 7 machine? Should I use dependency walker, and if so, how? Or is there another way to find out?

like image 865
Alexey Avatar asked Jun 27 '13 15:06

Alexey


People also ask

Does OpenCV use CUDA?

OpenCV GPU module is written using CUDA, therefore it benefits from the CUDA ecosystem. There is a large community, conferences, publications, many tools and libraries developed such as NVIDIA NPP, CUFFT, Thrust. The GPU module is designed as host API extension.

How do I check my OpenCV build configuration?

You can check the build information of OpenCV with getBuildInformation() . getBuildInformation() returns build information as a string.

How do I know if python OpenCV is installed?

After installation, it is recommended that you can check the version of OpenCV that Python is using: import cv2 print cv2. __version__ # Should print 3.0. 0-rc1 or newer.


2 Answers

You can know it by opening a python3 REPL in cmdline:

python3

Then importing opencv:

import cv2

Then printing build information:

print(cv2.getBuildInformation())

And look for CUDA and related GPU information.

like image 186
dpetrini Avatar answered Sep 19 '22 17:09

dpetrini


following up on dpetrini's answer, You can add whatever support to want to regex search in this to pretty-fy the outputs, instead of searching for it in the build-info outputs.

import cv2
import re

cv_info = [re.sub('\s+', ' ', ci.strip()) for ci in cv2.getBuildInformation().strip().split('\n') 
               if len(ci) > 0 and re.search(r'(nvidia*:?)|(cuda*:)|(cudnn*:)', ci.lower()) is not None]
print(cv_info)
['NVIDIA CUDA: YES (ver 10.0, CUFFT CUBLAS FAST_MATH)', 'NVIDIA GPU arch: 75', 'NVIDIA PTX archs:', 'cuDNN: YES (ver 7.6.5)']
like image 26
MintyPython Avatar answered Sep 21 '22 17:09

MintyPython