Nvidia CaffeParser is not working with bazel (segmentation fault)


I’m trying to implement traffic light detection model through TensroRT in apollo auto projects ( https://github.com/ApolloAuto/apollo ). They are using google’s bazel build system.

We encountered a run-time error while using NvCaffeParser, for more detail, the run-time error occurs when CaffePaser is trying to build network through IPluginFactory for our custom layer.

The runtime error caused the segmentation fault (SIGSEGV signal), only happened when using bazel to build and execute (cc_binary … etc.). We can run our application directly inside the docker successfully by using Makefile.

The sampling code is similar as the following:
const IBlobNameToTensor* blobNameToTensor = parser->parse(“deploy_file” , “modelFile”, *network, DataType::kFLOAT);

virtual nvinfer1::IPlugin* createPlugin(const char* layerName, const nvinfer1::Weights* weights, int nbWeights) override

Is there any suggestion for this kind of issue? Thanks.
System information

OS Platform and Distribution: Linux Ubuntu 14.04
TensorRT version:
Apollo version: 3.5