Failure to get opencv with cuda working

Hello,

I install the latest jetpack using the sdkmanager
Then I ssh into the Xavier and remove all unnecessary software
Then return to sdkmanager and update with runtime components
finally I ssh into the Xavier and compile opencv with cuda (using the correct cuda_arch_bin etc, as the install script shared on this forum)

Yet I still get the “not compiled with cuda” error when I try an opencv GPU instruction such as “upload”

How do I achieve this, thanks

Hi,

Did you use the python interface?
If yes, have you also compiled the python-opencv package and install it?

Thanks.

EDIT: I have posted this in wrong forum - can you move to Xavier NX??

yes its python 3 I will be using, I am not clear what you mean - I assumed the script compiled opencv cuda which was then available as a python library

Could you please share the script used to compile cuda opencv for python, and what version of jetpack it is known to work with it?

I am following the guidance here: Compiling OpenCV on Jetpack 5 - Jetson & Embedded Systems / Jetson AGX Xavier - NVIDIA Developer Forums.

yet when running a GPU function in opencv I get an error (not compiled), I can run image_container = cv2.cuda_GpuMat() command without error, but not image_container.upload(np.array((100,100))) which is where as far as I know the GPU actually kicks in. By what measure was the script confirmed to work?

It is potentially because I delete something between the flash phase and sdk phase? I need to do this as otherwise I get a device full error when transfering the runtime sdk components

Hi,

Please check if you can get the output of below test first:

import cv2
count = cv2.cuda.getCudaEnabledDeviceCount()
print(count)

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.