cudnnRNNBaseLayer.cpp (297) - Cuda Error in RNNDescriptorState: 8

Description

Build engine throw the “cudnnRNNBaseLayer.cpp (297) - Cuda Error in RNNDescriptorState: 8” when i constructed my GRU network by TensorRT4.0.

Environment

TensorRT Version: 4.0.2
GPU Type: gtx2080ti
Nvidia Driver Version: 465.27
CUDA Version: 9.0
CUDNN Version: 7.5.1.10
Operating System + Version: ubuntu16.04
Python Version (if applicable): 3.7
TensorFlow Version (if applicable):
PyTorch Version (if applicable): 1.6
Baremetal or Container (if container which image + tag):

could you give some tips to help me resolve the issue? thanks !!!

mycode

ILayer* addGRUEncoder(INetworkDefinition network, std::map<std::string, Weights>& weightMap, ITensor& input, int index, int nHidden,ITensor hiddenIn, std::string lname) {
splitLstmWeights(weightMap, lname + “.weight_ih_l0”);
splitLstmWeights(weightMap, lname + “.weight_hh_l0”);
splitLstmWeights(weightMap, lname + “.bias_ih_l0”);
splitLstmWeights(weightMap, lname + “.bias_hh_l0”);
Dims dims = input.getDimensions();
std::cout <<index<< “encoder gru input shape: " << dims.nbDims << " [” << dims.d[0] << " " << dims.d[1] << " " << dims.d[2] << “]”<< std::endl;
auto gru = network->addRNNv2(input, 1, nHidden, dims.d[1], RNNOperation::kGRU);
gru->setDirection(RNNDirection::kUNIDIRECTION);
gru->setWeightsForGate(0, RNNGateType::kRESET, true, weightMap[lname + “.weight_ih_l00”]);
gru->setWeightsForGate(0, RNNGateType::kUPDATE, true, weightMap[lname + “.weight_ih_l01”]);
gru->setWeightsForGate(0, RNNGateType::kHIDDEN, true, weightMap[lname + “.weight_ih_l02”]);

gru->setWeightsForGate(0, RNNGateType::kRESET, false, weightMap[lname + ".weight_hh_l00"]);
gru->setWeightsForGate(0, RNNGateType::kUPDATE, false, weightMap[lname + ".weight_hh_l01"]);
gru->setWeightsForGate(0, RNNGateType::kHIDDEN, false, weightMap[lname + ".weight_hh_l02"]);

gru->setBiasForGate(0, RNNGateType::kRESET, true, weightMap[lname + ".bias_ih_l00"]);
gru->setBiasForGate(0, RNNGateType::kUPDATE, true, weightMap[lname + ".bias_ih_l01"]);
gru->setBiasForGate(0, RNNGateType::kHIDDEN, true, weightMap[lname + ".bias_ih_l02"]);

gru->setBiasForGate(0, RNNGateType::kRESET, false, weightMap[lname + ".bias_hh_l00"]);
gru->setBiasForGate(0, RNNGateType::kUPDATE, false, weightMap[lname + ".bias_hh_l01"]);
gru->setBiasForGate(0, RNNGateType::kHIDDEN, false, weightMap[lname + ".bias_hh_l02"]);

if (hiddenIn != NULL) gru->setHiddenState(*hiddenIn);

return gru;

}

ILayer* addGRUDecoder(INetworkDefinition network, std::map<std::string, Weights>& weightMap, ITensor& input,int index, int nHidden,ITensor hiddenIn, std::string lname) {
splitLstmWeights(weightMap, lname + “.weight_ih_l0”);
splitLstmWeights(weightMap, lname + “.weight_hh_l0”);
splitLstmWeights(weightMap, lname + “.bias_ih_l0”);
splitLstmWeights(weightMap, lname + “.bias_hh_l0”);
Dims dims = input.getDimensions();
std::cout << “decoder gru input shape: " << dims.nbDims << " [” << dims.d[0] << " " << dims.d[1] << " " << dims.d[2] << “]”<< std::endl;
auto gru = network->addRNNv2(input, 1, nHidden, dims.d[1], RNNOperation::kGRU);
gru->setDirection(RNNDirection::kUNIDIRECTION);
gru->setWeightsForGate(0, RNNGateType::kRESET, true, weightMap[lname + “.weight_ih_l00”]);
gru->setWeightsForGate(0, RNNGateType::kUPDATE, true, weightMap[lname + “.weight_ih_l01”]);
gru->setWeightsForGate(0, RNNGateType::kHIDDEN, true, weightMap[lname + “.weight_ih_l02”]);

gru->setWeightsForGate(0, RNNGateType::kRESET, false, weightMap[lname + ".weight_hh_l00"]);
gru->setWeightsForGate(0, RNNGateType::kUPDATE, false, weightMap[lname + ".weight_hh_l01"]);
gru->setWeightsForGate(0, RNNGateType::kHIDDEN, false, weightMap[lname + ".weight_hh_l02"]);

gru->setBiasForGate(0, RNNGateType::kRESET, true, weightMap[lname + ".bias_ih_l00"]);
gru->setBiasForGate(0, RNNGateType::kUPDATE, true, weightMap[lname + ".bias_ih_l01"]);
gru->setBiasForGate(0, RNNGateType::kHIDDEN, true, weightMap[lname + ".bias_ih_l02"]);

gru->setBiasForGate(0, RNNGateType::kRESET, false, weightMap[lname + ".bias_hh_l00"]);
gru->setBiasForGate(0, RNNGateType::kUPDATE, false, weightMap[lname + ".bias_hh_l01"]);
gru->setBiasForGate(0, RNNGateType::kHIDDEN, false, weightMap[lname + ".bias_hh_l02"]);

if (hiddenIn != NULL) gru->setHiddenState(*hiddenIn);
return gru;

}

Hi ,
We recommend you to check the supported features from the below link.
https://docs.nvidia.com/deeplearning/tensorrt/support-matrix/index.html
You can refer below link for all the supported operators list.
For unsupported operators, you need to create a custom plugin to support the operation

Thanks!

Thanks for your reply! But, my network is constructed by the api of TensorRT4.0, not the onnx model to trt model.

Hi @CudaError,

Please refer Developer guide for more details on RNN layer,
https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#rnnv2-layer

We recommend you to please use latest TensorRT version. You can install/upgrade latest TRT version by following installation guide. Please make sure dependencies are satisficed before installation. Installation Guide :: NVIDIA Deep Learning TensorRT Documentation

Please let us know if you still face issue on latest TRT version.

Thank you.