OpenCV crash with validate_fixed_buffer: overlapping buffer map requested

Hello,

I’m writing a 24/7 program with camera and OpenCV with GPU, sometime my program crash and I have this kernel log:

Feb  5 10:58:56 T004 kernel: [1790718.096870] gk20a gk20a.0: validate_fixed_buffer: overlapping buffer map requested
Feb  5 10:58:56 T004 kernel: [1790718.096900] gk20a gk20a.0: gk20a_vm_unmap_user: invalid addr to unmap 0x0

Someone already have this problem, or some idea to debug ?

mdauphin,

Could you share your sample?

This is my GPU code, work well during days :

//upload image to GPU
cv::gpu::GpuMat gpu_im ;
gpu_im.upload( im_in ); // RAM => GPU

//Rotate counter clockwize
cv::Size size = im_in.size();
cv::gpu::GpuMat gpu_im_rot ;
cv::gpu::rotate( gpu_im, gpu_im_rot, cv::Size( size.height, size.width ), -90, size.height-1, 0, cv::INTER_LINEAR  );

gpu_im_rot.download(im_in);

//Check if background is initialize
if ( refreshBackground || ( m_gpu_im_bkg.cols == 0 )  ) {		
	m_gpu_im_bkg = cv::gpu::GpuMat(gpu_im_rot);
}
	
cv::gpu::GpuMat gpu_im_thresh ;

if ( m_useBackground )
{
	cv::gpu::GpuMat gpu_im_diff ;
	cv::gpu::subtract( m_gpu_im_bkg, gpu_im_rot, gpu_im_diff );
	cv::gpu::threshold( gpu_im_diff, gpu_im_thresh, THRESHOLD_LEVEL, 255.0, cv::THRESH_BINARY );
} else {
	cv::gpu::threshold( gpu_im_rot, gpu_im_thresh, THRESHOLD_LEVEL, 255.0, cv::THRESH_BINARY );		
}
	
gpu_im_thresh.download( im_threshold ); //GPU => RAM

Hi mdauphin,

Are you sure which API call causes the error?

I not sure but gk20a is the gpu driver, and each time I have a crash I have this log:

Feb  5 10:58:56 T004 kernel: [1790718.096870] gk20a gk20a.0: validate_fixed_buffer: overlapping buffer map requested
Feb  5 10:58:56 T004 kernel: [1790718.096900] gk20a gk20a.0: gk20a_vm_unmap_user: invalid addr to unmap 0x0