Is there a way to deregister a plugin creator? I see no such function on IPluginRegistry : [url]https://github.com/NVIDIA/TensorRT/blob/07ed9b57b1ff7c24664388e5564b17f7ce2873e5/include/NvInferRuntimeCommon.h#L834[/url]. While there is a global registry from getPluginRegistry, I as a user may not want my creators to be statics (for example, we can run into the static initialization order fiasco, we might throw exceptions which cannot be caught, or might want to more tightly control lifetimes). And I can’t have non-static creators if there’s no way to deregister them from the global registry (we’d hit use-after-free). Alternatively, instead of having a global plugin registry, TensorRT could have a model closer to the old factory model: users would create their own registry, and pass that in to the functions which need it (for example parsers).
Looks like not something we want in regular TRT, but if it’s a request within the context of automotive safety, you should create a formal request through NV program manager.
One more point about the global IPluginRegistry: since we register creators with it, our creators basically have to be global too (to avoid use-after-free), but mutable globals (like creators) mean clients have to be weary of thread-safety issues. If we could create our own IPluginRegistry, none of this would be an issue.