problem while running block matching disparity of openCV in cuda on Xavier


After installing opencv 4.0 with cuda using the script below:
i tried to run a simple code example that uses opencv cuda block matching disparity.
(the code is listed below)
the opencv function compute is getting stuck for unknown reason.
exactly the same code works perfectly on PC and Jetson nano, please advise.

/// code

 cv::Ptr<cv::cuda::StereoBM> bm;
 cv::cuda::GpuMat d_left, d_right;

// Set common parameters
bm =  cv::cuda::createStereoBM(64,11);

 // Prepare disparity map of specified type
cv::Mat dispCuda(cvGrayLeftWithBorder.size(), CV_8U);
cv::cuda::GpuMat d_disp(cvGrayLeftWithBorder.size(), CV_8U);

bm->compute(d_left, d_right, d_disp);;

Can anyone please help?

I have the same problem, even with minimum disparity levels and block size.