Uninstalling TensorRT#
Using pip#
When installing TensorRT using the Python Package Index (pip), you must explicitly remove the Python module dependencies to uninstall it. For a CUDA 13.x installation, remove all TensorRT Python modules using the following example command.
python3 -m pip uninstall tensorrt tensorrt-cu13 tensorrt-cu13-bindings tensorrt-cu13-libs
For a CUDA 12.x installation, remove the CUDA 12 dependency packages instead.
python3 -m pip uninstall tensorrt tensorrt-cu12 tensorrt-cu12-bindings tensorrt-cu12-libs
If you installed the lean or dispatch runtime wheels, remove them along with their CUDA-specific dependency packages. Replace cu13 with cu12 for a CUDA 12.x installation.
python3 -m pip uninstall tensorrt-lean tensorrt-lean-cu13
python3 -m pip uninstall tensorrt-dispatch tensorrt-dispatch-cu13
Using a Debian or RPM File#
To uninstall TensorRT using the Debian or RPM packages, uninstall libnvinfer11 and other related packages.
sudo apt-get purge "libnvinfer*"
sudo apt-get purge "tensorrt*"
sudo apt-get purge "libnvonnxparsers*"
sudo apt-get purge "nv-tensorrt-local-repo*"
sudo dnf erase "libnvinfer*"
sudo dnf erase "tensorrt*"
sudo dnf erase "libnvonnxparsers*"
sudo dnf erase "nv-tensorrt-local-repo*"
Using a Tar or Zip File#
To uninstall TensorRT using the tar file, delete the untarred files and reset LD_LIBRARY_PATH to its original value.
To uninstall TensorRT using the zip file, delete the unzipped files and remove the newly added path from the PATH environment variable.
When installing the Python TensorRT wheel files using a tar file, use the following commands to uninstall them.
python3 -m pip uninstall tensorrt
python3 -m pip uninstall tensorrt-lean
python3 -m pip uninstall tensorrt-dispatch
When installing the Python TensorRT wheel files using a zip file on Windows, use the following commands to uninstall them.
python.exe -m pip uninstall tensorrt
python.exe -m pip uninstall tensorrt-lean
python.exe -m pip uninstall tensorrt-dispatch
Using a Container#
To remove a TensorRT NGC container, stop and remove any container created from the image, then remove the image itself.
docker rm <container-name-or-id>
docker rmi nvcr.io/nvidia/tensorrt:<container-tag>
Containers started with --rm are removed automatically on exit, so only the image removal step applies to them.
Verifying Removal#
Confirm that no TensorRT packages or Python wheels remain. Each of the following commands should report nothing for the installation method you removed.
dpkg-query -W "*nvinfer*"
rpm -qa | grep nvinfer
python3 -m pip list | grep tensorrt