Cannot use IPluginV2Layer inside ILoop in TRT8.4


I build a custom plugin and try to put it inside a loop. The plugin works well without inside ILoop but failed when placed inside ILoop.


    nv::ILoop* loop = network->addLoop();
    loop->addTripLimit(*T, nv::TripLimit::kCOUNT);
    nv::IIteratorLayer* iter = loop->addIterator(*input, 1);

    nv::IConvolutionLayer* conv = network->addConvolutionNd(*iter->getOutput(0),
                                                            nv::Dims2{ size_kernel, size_kernel },
                                                            weightMap[lname + ".weight"], nv::Weights{});
    LOG_ASSERT(conv, "add convlution layer failed.");
    int padding = (size_kernel-1)/2;
    conv->setPaddingNd(nv::Dims2{ padding, padding });
    conv->setStrideNd(nv::Dims2{ stride, stride });

    nv::IPluginV2Layer* slif_neuron = addSLIFLayer(network, conv->getOutput(0), tau, v_threshold, v_reset, reset_mode);
    nv::ILoopOutputLayer* output = loop->addLoopOutput(*slif_neuron->getOutput(0), nv::LoopOutput::kCONCATENATE, 1);
    output->setInput(1, *T);


Skipping tactic 0x0000000000000000 due to Myelin error: PLUGIN_V2 operation not supported within this graph.

Error Code 10: Internal Error (Could not find any implementation for node {ForeignNode[(Unnamed Layer* 0) [Constant]...fc1-shuffle]}.)

Error Code 2: Internal Error (Assertion engine != nullptr failed. )


TensorRT Version: 8.4
GPU Type: Quadro RTX 6000
Nvidia Driver Version: 520.61.05
CUDA Version: 11.8
CUDNN Version:
Operating System + Version: Ubuntu 18.04
Python Version (if applicable):
TensorFlow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):

Relevant Files

Please attach or include links to any models, data, files, or scripts necessary to reproduce your issue. (Github repo, Google Drive, Dropbox, etc.)

Steps To Reproduce

Please include:

  • Exact steps/commands to build your repro
  • Exact steps/commands to run your repro
  • Full traceback of errors encountered

Nvidia tensorrt documentation says

the interior of the loop can have the following kinds of layers:
* IActivationLayer if the operation is one of:
  * kRELU
  * kTANH
  * kELU
* IConcatenationLayer
* IConstantLayer
* IIdentityLayer
* IFullyConnectedLayer
* IMatrixMultiplyLayer
* IElementWiseLayer
* IPluginV2Layer
* IScaleLayer
* ISliceLayer
* ISelectLayer
* IShuffleLayer
* ISoftMaxLayer
* IUnaryLayer if the operation is one of:
  * kABS
  * kCEIL
  * kEXP
  * kFLOOR
  * kLOG
  * kNEG
  * kNOT
  * kRECIP
  * kSQRT

IPluginV2Layer is included.

Could you please try on the latest TensorRT version 8.5.3