Can't use GPU resizing. 'Illegal instruction'

Hello i am trying to resize an image in cuda/openCV.
Basically i am getting an image that is way bigger than i need and i wish to downscale it before processing. right now i am using the cpu to do so but i feel like that the whole thing would run way better if i would do it on the gpu before downloading to cpu.

Here is the line that works with CPU Mat:

//get the img into a gpu mat ...

// download (copy) to cpu mat
cv::UMat cpuFrame;;
cv::UMat cpuFrameResized(w, h, CV_8UC1);

cv::resize(cpuFrame, cpuFrameResized, cv::Size(w,h), 0, 0, cv::INTER_NEAREST);

// etc ...

but for this i need to download my gpu mat to cpu space. It works but is slow.

Here is what i tried in gpu space:

//resizing the images
#include "opencv2/cudawarping.hpp"

//get the img into a gpu mat ...

//use gpu downscaling
cv::cuda::resize(gpuFrame,gpuFrameResized, cv::Size(w, h), 0, 0, cv::INTER_NEAREST);

// download (copy) to cpu mat
cv::UMat cpuFrame;;

// etc ...

i am getting the informative error of:
Illegal instruction

What is missing to make the gpu resizing legal?

the cuda definition states i need some sort of stream but that the default is just null. I don’t understand if i do need a ‘stream’ and what is it for? I don’t think i need it …

the following doesn’t work either:


cv::cuda::resize(gpuFrame,gpuFrameResized, cv::Size(w, h), 0, 0, cv::INTER_NEAREST, cv::cuda::Stream::Null()  );

Not sure why the API does not work. This would need other users to share experience.

There is a hardware converter in Jetson platforms and we have software implementation in gstreamer and jetson_multimedia_api. Would suggest use the engine for downscaling, cropping, format conversion. It is nvvidconv plugin in gstreamer, and NvBufferTransform() in jetson_multimedia_api.

There are samples for running with OpenCV. Please check
Nano not using GPU with gstreamer/python. Slow FPS, dropped frames - #8 by DaneLLL
LibArgus EGLStream to nvivafilter - #14 by DaneLLL