Could not load dynamic library 'libnvinfer.so.7'

Description

I have a laptop with Ubuntu 20 Geforce RTX 3060, drivers 470, cuda 11.4, CUDNN 8.1, Python 3.8 and Tensorflow 2.10, I hace also instaled tensoRT using:

pip install nvidia-pyindex
pip install nvidia-tensorrt
When I try to run tensorflow I have te next messages:

2023-05-28 22:08:39.240187: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘libnvinfer.so.7’; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64
2023-05-28 22:08:39.240222: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘libnvinfer_plugin.so.7’; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64
2023-05-28 22:08:39.240226: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.

I read a lot of blog however I could not solve this problema.

Environment

TensorRT Version:
GPU Type:
Nvidia Driver Version:
CUDA Version:
CUDNN Version:
Operating System + Version:
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

Hi,

It looks like some TensorRT is not correctly installed.
Please refer to the installation steps from the below link if in case you are missing on anything

Also, we suggest you use TRT NGC containers to avoid any system dependency related issues.

Thanks!

Thank you very much for your support. Before I try to install by Installation Guide :: NVIDIA Deep Learning TensorRT Documentation , I check if I have installed tensorrt obtaining:

:~$ python3
Python 3.8.10 (default, Mar 13 2023, 10:26:41)
[GCC 9.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import tensorrt
print(tensorrt.version)
8.4.3.1
assert tensorrt.Builder(tensorrt.Logger())

It looks like I have installed Tensorrt. However, running Python 3 with tensorflow I obtained the following error message:

2023-06-06 19:58:53.291121: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘libnvinfer.so.7’; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64
2023-06-06 19:58:53.291192: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘libnvinfer_plugin.so.7’; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib64
2023-06-06 19:58:53.291198: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.

What can I do?

Hi,

We recommend you to uninstall existing and reinstall TensorRT correctly, also please use the latest version of the TensorFlow.

Thank you.