Hi,
We have followed as per your guide in the modification of the codes, but we have noticed that inputTypes passed in to configurePlugin always seems to be nvinfer1::DataType::kFLOAT.
bool CustomPlugin::supportsFormat(nvinfer1::DataType type, PluginFormat format) const {
return ((type == nvinfer1::DataType::kFLOAT || type == nvinfer1::DataType::kHALF)
&& (format == PluginFormat::kNCHW));
}
void CustomPlugin::configurePlugin(const nvinfer1::Dims* inputDims, int nbInputs, const nvinfer1::Dims* outputDims, int nbOutputs,
const nvinfer1::DataType* inputTypes, const nvinfer1::DataType* outputTypes, const bool* inputIsBroadcast,
const bool* outputIsBroadcast, PluginFormat floatFormat, int maxBatchSize) {
ASSERT(*inputTypes == nvinfer1::DataType::kFLOAT || *inputTypes == nvinfer1::DataType::kHALF);
ASSERT(*inputTypes == *outputTypes);
ASSERT(floatFormat == PluginFormat::kNCHW);
...
data_type = *inputTypes;
...
}
While doing the conversion from .uff file with FP16 mode enabled, it crashes somewhere in the TensorRT library. The callstack is given below:
(cuda-gdb) info stack
#0 0x000000005f351e70 in ?? ()
#1 0x00007fffef41b6d3 in nvinfer1::cudnn::selectTactic(nvinfer1::rt::EngineBuildContext const&, nvinfer1::rt::Layer&, nvinfer1::builder::Node*) ()
from /home/klass/nvidia/tensorrt-5.1.5.0/x86_64-linux-gnu/lib/libnvinfer.so.5
#2 0x00007fffef42f556 in nvinfer1::builder::buildSingleLayer(nvinfer1::rt::EngineBuildContext&, nvinfer1::builder::Node&, std::unordered_map<std::string, std::unique_ptr<nvinfer1::rt::Region, std::default_delete<nvinfer1::rt::Region> >, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, std::unique_ptr<nvinfer1::rt::Region, std::default_delete<nvinfer1::rt::Region> > > > > const&, std::unordered_map<std::string, std::vector<float, std::allocator<float> >, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, std::vector<float, std::allocator<float> > > > >*, bool) () from /home/klass/nvidia/tensorrt-5.1.5.0/x86_64-linux-gnu/lib/libnvinfer.so.5
#3 0x00007fffef43098e in nvinfer1::builder::EngineTacticSupply::getBestTactic(nvinfer1::builder::Node&, nvinfer1::query::Ports<nvinfer1::RegionFormatL> const&, bool) ()
from /home/klass/nvidia/tensorrt-5.1.5.0/x86_64-linux-gnu/lib/libnvinfer.so.5
#4 0x00007fffef4688d1 in nvinfer1::builder::makeReformattingTensor(nvinfer1::builder::Tensor&, std::string const&, nvinfer1::RegionFormatL const&, std::unordered_map<std::string, std::vector<float, std::allocator<float> >, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, std::vector<float, std::allocator<float> > > > >*, bool) ()
from /home/klass/nvidia/tensorrt-5.1.5.0/x86_64-linux-gnu/lib/libnvinfer.so.5
#5 0x00007fffef4637fa in nvinfer1::builder::chooseFormatsAndTactics(nvinfer1::builder::Graph&, nvinfer1::builder::TacticSupply&, std::unordered_map<std::string, std::vector<float, std::allocator<float> >, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, std::vector<float, std::allocator<float> > > > >*, bool) ()
from /home/klass/nvidia/tensorrt-5.1.5.0/x86_64-linux-gnu/lib/libnvinfer.so.5
#6 0x00007fffef4328a6 in nvinfer1::builder::EngineTacticSupply::timeReformat(std::shared_ptr<nvinfer1::builder::Tensor>&, bool, nvinfer1::RegionFormatL const&, nvinfer1::RegionFormatL const&, std::unordered_map<std::string, std::vector<float, std::allocator<float> >, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, std::vector<float, std::allocator<float> > > > >*) () from /home/klass/nvidia/tensorrt-5.1.5.0/x86_64-linux-gnu/lib/libnvinfer.so.5
#7 0x00007fffef437212 in nvinfer1::builder::buildEngine(nvinfer1::CudaEngineBuildConfig&, nvinfer1::rt::HardwareContext const&, nvinfer1::Network const&) ()
from /home/klass/nvidia/tensorrt-5.1.5.0/x86_64-linux-gnu/lib/libnvinfer.so.5
#8 0x00007fffef4cce5d in nvinfer1::builder::Builder::buildCudaEngine(nvinfer1::INetworkDefinition&) () from /home/klass/nvidia/tensorrt-5.1.5.0/x86_64-linux-gnu/lib/libnvinfer.so.5
#9 0x000000000044fedf in klassfr::trt::Model<klassfr::trt::IMTCNN_PNet>::InitializeFromUff (this=0x1117e60, uff_stream=..., max_batch_size=4)
at /home/klass/tensor_rt/src/model.hpp:116
Even if we modify the enqueue function to do nothing (e.g. no modification of input/outputs ), it still crashes in the same place as described above.
Truncated logs from stdout shown below:
[INFO] --------------- Timing custom1(34)
[INFO] Tactic 0 time 3.78656
Segmentation fault (core dumped)
OR
[INFO] --------------- Timing custom1(34)
[INFO] Tactic 0 time 3.77376
Bus error (core dumped)