I want to create context in every thread.
for every thread,I create cuda context by pycuda.driver.Device.make_context and use the same engine to create trt context:
self.context = self.engine.create_execution_context() self.context.active_optimization_profile=0
it’s works fine for fixed shapes(the second line is not used)．
but for dynamic shapes,
ｗhen I execute the code second time in the second thread,the first line of code causes a warning:
[TensorRT] WARNING: Could not set default profile 0 for execution context. Profile index must be set explicitly.
and the second line of the code causes a error:
....... self.context.active_optimization_profile=0 IndexError: Profile index 0 is out of bounds.
TensorRT 220.127.116.11 ga