Open wutheringcoo opened 2 months ago
halo.韩博 请教个问题, 我已经通过trtexec --plugin 生成了带有自定义plugin的engine 那么如何在C++ api中调用该plugin呢, 我把这段:
void* pluginLibraryHandle = dlopen( "/path/to/plugin.so", RTLD_LAZY); nvinfer1::IPluginRegistry* pluginRegistry = getPluginRegistry(); nvinfer1::IPluginCreator* plugincreator = pluginRegistry->getPluginCreator("pluginname", "1"); plugincreator->createPlugin("pluginname", nullptr); initLibNvInferPlugins(&gLogger, ""); runtime_ = nvinfer1::createInferRuntime(gLogger); engine_ = runtime_->deserializeCudaEngine(engine_data.data(), engine_data.size(), nullptr); context_ = engine_->createExecutionContext();
void* pluginLibraryHandle = dlopen( "/path/to/plugin.so", RTLD_LAZY);
nvinfer1::IPluginRegistry* pluginRegistry = getPluginRegistry();
nvinfer1::IPluginCreator* plugincreator = pluginRegistry->getPluginCreator("pluginname", "1");
plugincreator->createPlugin("pluginname", nullptr);
initLibNvInferPlugins(&gLogger, "");
runtime_ = nvinfer1::createInferRuntime(gLogger);
engine_ = runtime_->deserializeCudaEngine(engine_data.data(), engine_data.size(), nullptr);
context_ = engine_->createExecutionContext();
但是推理的时候还是没有看到期望的自定义plugin log,如下: Plugin creator already registered - ::CustomerPluginname version 1
上面的步骤是有啥问题不?
halo.韩博 请教个问题, 我已经通过trtexec --plugin 生成了带有自定义plugin的engine 那么如何在C++ api中调用该plugin呢, 我把这段:
void* pluginLibraryHandle = dlopen( "/path/to/plugin.so", RTLD_LAZY);
nvinfer1::IPluginRegistry* pluginRegistry = getPluginRegistry();
nvinfer1::IPluginCreator* plugincreator = pluginRegistry->getPluginCreator("pluginname", "1");
plugincreator->createPlugin("pluginname", nullptr);
initLibNvInferPlugins(&gLogger, "");
runtime_ = nvinfer1::createInferRuntime(gLogger);
engine_ = runtime_->deserializeCudaEngine(engine_data.data(), engine_data.size(), nullptr);
context_ = engine_->createExecutionContext();
但是推理的时候还是没有看到期望的自定义plugin log,如下: Plugin creator already registered - ::CustomerPluginname version 1
上面的步骤是有啥问题不?