How to use custom plugin factory in python

Our plugin factory are written in c++ and use pybind11 for python. when I upgrade tensorrt from 6 to 7, import plugin factory raise error:
generic_type: type “AllPluginFactory” referenced unknown base type “nvcaffeparser1::IPluginFactoryV2”

code:

PYBIND11_MODULE(pluginsrt, m)
{
  namespace py = pybind11;
  py::module::import("tensorrt");
  py::class_<AllPluginFactory, nvcaffeparser1::IPluginFactoryV2>(
      m, "AllPluginFactory", py::multiple_inheritance())
      // Bind the default constructor.
      .def(py::init<std::string>())
      // The destroy_plugin function does not override the base class, so we
      // must bind it explicitly.
      .def("destroy_plugin", &AllPluginFactory::destroyPlugin);
}

Hi,

Looks like some environment issue. For example, is LD_LIBRARY_PATH correctly set.

Thanks

export LD_LIBRARY_PATH="/usr/local/cuda/lib64:$HOME/library/TensorRT-7.0.0.11/lib:$LD_LIBRARY_PATH"

environment is ok, the issue only exists in trt 7 (works in 5 and 6). when I remove plugin factory from pybind11 module, no error raised during import and plugin creater of python works well.

Hi,

Can you provide the following information so we can better help?
Provide details on the platforms you are using:
o Linux distro and version
o GPU type
o Nvidia driver version
o CUDA version
o CUDNN version
o Python version [if using python]
o Tensorflow version
o TensorRT version
o If Jetson, OS, hw versions

Also, if possible please share the sample repro script and model file.

Thanks