Understanding Error Messages#

If an error occurs during execution, TensorRT reports an error message intended to help debug the problem. The following sections discuss some common error messages that developers can encounter.

ONNX Parser Error Messages

The following table captures the common ONNX parser error messages. For specific ONNX node support information, refer to the Operators’ support document.

Table 17 Common ONNX Parser Error Messages#

Error Message

Description

<X> must be an initializer!

These error messages signify that an ONNX node input tensor is expected to be an initializer in TensorRT. A possible fix is to run constant folding on the model using TensorRT’s Polygraphy tool: polygraphy surgeon sanitize model.onnx --fold-constants --output model_folded.onnx

!inputs.at(X).is_weights()

getPluginCreator() could not find Plugin <operator name> version 1

This is an error stating that the ONNX parser does not have an import function defined for a particular operator and did not find a corresponding plugin in the loaded registry for the operator.

TensorRT Core Library Error Messages

The following table captures the common TensorRT core library error messages.

Table 18 Common TensorRT Core Library Error Messages#

Error Message

Description

Installation Errors

CUDA initialization failure with error <code>. Please check the CUDA installation: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html.

This error can occur if the CUDA or NVIDIA driver installation corrupts. Refer to the URL for instructions on installing CUDA and the NVIDIA driver on your OS.

Builder Errors

Internal error: could not find any implementation for node <name>. Try increasing the workspace size with IBuilderConfig::setMemoryPoolLimit().

This error occurs because there is no layer implementation for the given node in the network that can operate with the given workspace size. This usually occurs because the workspace size is insufficient, but could also indicate a bug. If increasing the workspace size as suggested does not help, report a bug (refer to Reporting TensorRT Issues).

<layer-name>: (kernel|bias) weights have non-zero count but null values <layer-name>: (kernel|bias) weights have zero count but non-null values

This error occurs when a mismatch between the values and count fields in a Weights data structure is passed to the builder. If the count is 0, the values field must contain a null pointer; otherwise, the count must be non-zero, and values must contain a non-null pointer.

Builder was created on a device different from the current device. | This error can occur if you create an IBuilder targeting one GPU, called cudaSetDevice(), to target a different GPU and then attempt to use the IBuilder to create an engine.
Ensure you only use the IBuilder when targeting the GPU used to create the IBuilder.

You can encounter error messages indicating that the tensor dimensions do not match the semantics of the given layer. Carefully read the documentation on NvInfer.h on the usage of each layer and the expected dimensions of the tensor inputs and outputs to the layer.

Engine Compatibility Errors

The engine plan file is not compatible with this version of TensorRT, expecting (format|library) version <X> got <Y>; please rebuild.

This error can occur if you are running TensorRT using an engine PLAN file that is incompatible with the current version of TensorRT. Ensure you use the same TensorRT version when generating and running the engine.

The engine plan file is generated on an incompatible device, expecting compute <X> to get compute <Y>; please rebuild.

This error can occur if you build an engine on a device with a computing capability different from the device used to run the engine.

Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.

This warning can occur if you build an engine on a device with the same computing capability but not identical to the engine running. As the warning indicates, using a device of the same model is highly recommended when generating the engine and deploying it to avoid compatibility issues.

Out Of Memory Errors

GPU memory allocation failed during initialization of (tensor|layer): <name> GPU memory.

These error messages can occur if insufficient GPU memory is available to instantiate a TensorRT engine. Verify that the GPU has sufficient memory to contain the required layer weights and activation tensors.

Allocation failed during the deserialization of weights.

GPU does not meet the minimum memory requirements to run this engine ...

FP16 Errors

The network needs native FP16, and the platform does not have native FP16.

This error message can occur if you attempt to deserialize an engine that uses FP16 arithmetic on a GPU that does not support FP16 arithmetic. You either must rebuild the engine without FP16 precision inference or upgrade your GPU to a model that supports FP16 precision inference.

Plugin Errors

Custom layer <name> returned non-zero initialization.

This error can occur if a plugin layer’s initialize() method returns a non-zero value. Refer to the implementation of that layer to debug this error further. For more information, refer to the NVIDIA TensorRT Operator’s.