Tegra Jetson - GPU accleration in OpenCV?

Initially, OpenCV sample programs showed the following message in the console.

“Tegra platform detected, optimizations are switched ON!”

After I installed python-opencv (and its dependent packages), however, I don’t see the message anymore.

So I tested whether the GPU cores are being utilized with gpu::getCudaEnabledDeviceCount() as shown below and the return value was 0.

printf("CUDA dev count: %d\n", gpu::getCudaEnabledDeviceCount());

Does this mean that the OpenCV doesn’t recognize the CUDA GPU cores? If so, how I can re-enable it?


The OpenCV version in the repository is a different version than what is installed on the TK1. Try reinstalling the OpenCV version available at the support website here: https://developer.nvidia.com/jetson-tk1-support. You’ll need to register as a developer to download it.

Hello, i’m facing to the same problem even if i reinstall the opencv4Tegra from the link, i would like to know if u have fixed th e problem?


Dear GPU lovers,

I have a similar problem!

I have just installed OpenCV on my Jetson. I build the GPU samples and everything works nicely.

I then installed python-opencv, which seemed to install properly.

BUT, and it is a big but, when I go back and build some of the OpenCV GPU samples I get an error message saying: OpenCV Error: No GPU support (The library is compiled without CUDA support).

I may be old fashioned but I don’t want the installation of python to interfere with my ability to build and run GPU code. I am going to guess that there is a path issue but I don’t know how to diagnose the problem. I’d appreciate your help and suggestions.

Interestingly, if I remove python-opencv then I can build the GPU samples again.

[ Ideally, I’d like to be able to use the GPU from python but I need to learn how to crawl first. I see there are other posts on using the GPU from python. I’d be happy to hear the latest advice. ]

Thanks for your help.

If you want to use OpenCV4Tegra from Python, instead of installing python-opencv, install opencv4tegra-python.
(The python-opencv package conflicts with the OpenCV4Tegra installation, and that’s why it won’t work.)

However, as of now, no versions of OpenCV support using the ‘gpu’ module from Python. See this post: http://stackoverflow.com/questions/18552551/python-and-gpu-opencv-functions

Sorry to revive an old thread, but we are working on getting opencv4tegra-python to work.

Currently we have installed the prebuilt cuda and opencv libraries (and the cpp gpu samples are working), python is installed aswell (and working).

However we are unable to get a hold of the “opencv4tegra-python” build you are talking about cn04.
Where is this available ?

Oops, sorry, it’s actually called libopencv4tegra-python, and it can be found in the Ubuntu APT repositories:

sudo apt-get install libopencv4tegra-python

This will let you use the ordinary CPU OpenCV4Tegra functions from Python. However, you still won’t be able to use the ‘gpu’ module from Python, because OpenCV does not have Python bindings for that yet.

To test from Python:

import cv2
print cv2.__version__

Good luck!