-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Extra cudaStreamCreate/cudaStreamDestroy #16592
Copy link
Copy link
Closed
Labels
bugcategory: gpu/cuda (contrib)OpenCV 4.0+: moved to opencv_contribOpenCV 4.0+: moved to opencv_contrib
Milestone
Description
System information (version)
- OpenCV => 4.2.0-dev
- Operating System / Platform => Ubuntu 18.04
- Compiler => GNU G++ 7.4.0
- Python => 3.6.9
Detailed description
When I run self.frame_device.upload(self.frame, stream) I'm getting an extra cudaStreamCreate and cudaStreamDestroy right before the cudaMemcpy2DAsync. (See attached)

Steps to reproduce
import os
import sys
import glob
import numpy as np
import time
import cv2
import cudasift
class PreCuda:
def __init__(self, size):
print("__init__")
self.rows = size
self.cols = size
self.stream = cv2.cuda_Stream( )
self.frame = np.zeros((size,size,3),np.uint8)
cv2.cuda.registerPageLocked(self.frame)
self.frame_device = cv2.cuda_GpuMat(size,size,cv2.CV_8UC3)
def __del__(self):
print("unregisterPageLocked")
cv2.cuda.unregisterPageLocked(self.frame)
def ProcessFrame(self):
print("ProcessFrame")
self.frame_device.upload(self.frame, self.stream) # <-- issue
def Frame(self, img):
print("Frame")
img = cv2.imread(image_name)
img.resize(self.rows, self.cols, 3)
np.copyto(self.frame,img)
image_names = glob.glob('images/*')
size = 512
image_data = PreCuda(size)
for image_name in image_names:
image_data.Frame(image_name)
image_data.ProcessFrame()
-->
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugcategory: gpu/cuda (contrib)OpenCV 4.0+: moved to opencv_contribOpenCV 4.0+: moved to opencv_contrib