Nvidia CaffeParser is not working with bazel (segmentation fault)

Hello,

I’m trying to implement traffic light detection model through TensroRT 4.0.1.6 in apollo auto projects ( GitHub - ApolloAuto/apollo: An open autonomous driving platform ). 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: 4.0.1.6
Apollo version: 3.5