tensorflow: TensorFlow 2.10.0 not compatible with TensorRT 8.4.3
Click to expand!
Issue Type
Build/Install
Source
binary
Tensorflow Version
2.10.0
Custom Code
No
OS Platform and Distribution
Ubuntu 22.04 LTS
Mobile device
No response
Python version
3.10.4
Bazel version
No response
GCC/Compiler version
No response
CUDA/cuDNN version
cuda 11.7
GPU model and memory
NVIDIA GeForce RTX 3090
Current Behaviour?
I cannot use TensorRT 8 with the latest version of TensorFlow and CUDA.
Standalone code to reproduce the issue
import tensorflow as tf
Relevant log output
2022-09-13 11:06:57.075736: 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
2022-09-13 11:06:57.075769: 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
2022-09-13 11:06:57.075772: 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.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 57 (10 by maintainers)
So after spending 2 days on this issue… Here’s a solution/workaround to get TF2.10 running with TRT on Ubuntu 20.04 (assuming 22 schould work aswell):
As the Error mentions
Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory-> so you need TensorRT 7.X … to get it installed you have to differ some actions from official Step-by-step instructions as in: https://www.tensorflow.org/install/pipconda create --name tf-py38 python=3.8b)conda activate tf-py38pip install --upgrade setuptools pippip install nvidia-pyindexpip install nvidia-tensorrt==py3.10 -> available from 8.4.0.+ py3.9 -> available from 8.0.+ py3.8 -> available from 7.2.2.+pip install nvidia-tensorrt==7.2.3.4python3 -c "import tensorrt; print(tensorrt.__version__); assert tensorrt.Builder(tensorrt.Logger())"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/python3.8/site-packages/tensorrt/or with recommended automation:echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/python3.8/site-packages/tensorrt/' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.shpython3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"-> no more missing ‘libnvinfer.so.7’ and ‘libnvinfer_plugin.so.7’Hope it helps… Best Regards DiDaMain
Welcome 😄. Now how do I close this issue?
Probably yes.
I have the same issue with TF 2.11.0 and TensorRT 8.5.1-1+cuda11.8.
Same issue here with tensorflow 2.11.0 and TensorRT 8.5.1.7
I solve this problem by downgrading the tf to 2.9.2
ubuntu 22.04 cuda 12.0 tensorrt 8.5.0 cudnn 8.7.0 tf-nightly the error still persists
I’m waiting for the stable release of 2.12.0, there will be TensorRT 8 working.
Until that, I’m using TF 2.9.
TF 2.10 and 2.11 are terrible releases.
I have the same issue with tensorflow 2.11.0.
on Ubuntu 22.04, python 3.10.4, Nvidia driver 515.65.01, cuda 11.2.2, cudnn 8.1.1.33
I tried the workaround proposed by @didamain but the only tensorrt versions displayed by
pip install nvidia-tensorrt==are0.0.1.dev4, 0.0.1.dev5, 8.4.0.6, 8.4.1.5, 8.4.2.4, 8.4.3.1I have no issue when installing tensorflow 2.9.3.
@mshavliuk , It will be part of Tensorflow 2.12, till then you can use nightly version.
tf-nightly 2.12.0.dev20221202 fixed the issue for me.
Works fine with TensorRT 8.5.1-1+cuda11.8.
Hi, After following @didamain detailed instructions (tks for that!), I was able to pass the error about libinfer7 not found. But I still have a error about cublas not been found (I know this was not the original issue, but I think it’s related to Ubuntu 22.04 + CUDA 11.7, etc):
Any hints on this? Could not find a cublas python package to install. Regards
cudnn 8.8 is out for cuda 12.0. Any news for tensorrt
https://docs.nvidia.com/deeplearning/frameworks/tensorflow-release-notes/rel-22-12.html#rel-22-12
@sachinprasadhs ,
tf-nightly-2.12.0.dev20230114, Ubuntu 22.04.1 LTS, Python 3.10.8, miniconda - the issue persists.@learning-to-play I believe it is closed by mistake - the issue still persists
@jthibaut what did you use to install tesnorrt? In case you used @didamain workaround, you need to do this:
Run this from terminal with your environment activated, this will add all the libraries installed by tesnorrt to path as they do not get added automatically, you can also swap out the python3.8 with your python vresion:
If you used pip install tensorrt, the paths may be a little different:
basically you can go check in the site-packages folder where tensorrt is and add it to path accordingly.
pip install nvidia-pyindex(NVIDIA’s version of PyPi) will give you the necessarynvidia-tensorrtversions. But this doesn’t solve the TensorRT 8 not found issue. At least not for me. (I’m not using Conda to manage environments.)Extremely annoying I have to downgrade to RT7 and Py38 (or completely mess with
$LD_LIBRARY_PATH) just to keep Cuda bindings. Could you imagine developing a program, and telling the end-user they must use Python 3.8 and only 3.8? I’m not moving to nightly either. There’s a reason why many of us don’t use nightly builds or alpha releases in production environments.This should “just work” using
pip install *,poetry add *, etc. And it doesn’t.And why is this issue closed anyway? It’s not solved. Not in v2.10. And not in v2.11. Not in the official release versions, anyway. Until it’s back-ported/cherry picked, and available via PyPi, this issue shouldn’t have been closed.
Same issue as earlier commenters with tensorflow 2.10.0 and @pberndt with tf-nightly-2.11.0.dev20221003 although the cublas error is gone as reported in earlier comments.
Downgraded to 2.9.0 and I’m not seeing any libnvinfer.so.7 warnings. It was either that or downgrading to Python 3.8 to install TensorRT 7 since it doesn’t seem to support later python versions.
The only related topics I can find are about TensorRT 8 breaking compilation on some earlier versions of Tensorflow but unclear if that has any relation to this.
OS: Ubuntu 22.04 Python: 3.10.6 CUDA: 11.7 TensorRT: 8.4.3
To note: TensorRT was installed via pip since there is no .deb package for Ubuntu 22.04 at the moment and python3-libnvinfer-dev package installation would fail since it expects Python < 3.9 Also, TensorRT is compiled for CUDA 11.6 and not 11.7 - although Nvidia reports it as compatible in their documentation
Best regards
Hi, any progress on this one?
Latest nightly still appears to be looking for libnvinfer.so.7 :
Kind regards
using python 3.10, tf 2.12:
but
Tried:
No success:
About drivers in cuda:
work for me. python 3.10 with tensorrt 8+
Also can confirm, 2.9.3 works perfectly fine,
@jthibaut this fix by @didamain works perfectly. Scroll up and you’ll see his comment with detailed instructions. Try this only if tf-nightly doesn’t work for you. Good luck.
I know, it’s only optional but I want to use Nvidia’s TensorRT capabilities.
Thanks.
I see the same cuBLAS issue too. Any progress with TensorRT or cuBLAS issues?
Thanks for your time.