Cupy and TensorRT


I am using tensorrt container (tensorrt:19.11-py3) and trying to use CuPy library ( in the script under /opt/tensorrt/samples/python/introductory_parser_samples/. In the script file, I call do_inference() function then do some calculations with CuPy without any problem. However, when I call do_inference() again, the following exception occurs:

[TensorRT] ERROR: ../rtSafe/cuda/cudaElementWiseRunner.cpp (149) - Cuda Error in execute: 400 (invalid resource handle)
[TensorRT] ERROR: FAILED_EXECUTION: std::exception

Is there any solution for this problem ?


Can you share your altered version of the code sample so that I can reproduce and debug a bit further?

same question !!!
did you solve it?