After used `import pycuda.autoinit`, vpi stops working properly


After I used import pycuda.autoinit earlier, vpi stops working properly.
For example, all the values of vpi.rescale output became ‘0’.

sample code:

import pycuda.autoinit  # If commented out this line, the program will execute normally.

import cv2
import vpi

path = "test.png"

img_cv = cv2.imread(path)
input_data = vpi.asimage(img_cv)

with vpi.Backend.CUDA:
    temp = input_data.convert(vpi.Format.NV12_ER)
    temp = temp.rescale((224, 140))
    output = temp.convert(input_data.format)
cv2.imshow("test", output.cpu())

How can I fix it?


TensorRT Version: TensorRT 8.4
GPU Type: GeForce 3080
Nvidia Driver Version: 525.116.04
CUDA Version: 11.7
CUDNN Version: 8.2
Operating System + Version: Ubuntu 20.04
Python Version (if applicable): 3.8

Please refer to the installation steps from the below link if in case you are missing on anything

Also, we suggest you to use TRT NGC containers to avoid any system dependency related issues.


1 Like

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