I have the problem where the Tensorflow Python package wants version 7 of libnvinfer.so when all I can find to install is version 8 (libnvinfer.so.7 versus libnvinfer.so.8). Like these people:
/forums.developer.nvidia.com/t/tensorflow-looking-for-libnvinfer-so-7-when-i-have-libnvinfer-so-8-installed/200007
and others on StackOverflow, but I’m new and can only put in one link.
Here’s what Tensorflow says:
$ python3.9
Python 3.9.13 (main, Nov 16 2022, 15:31:39)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] on linux
>>> import tensorflow
2023-02-17 16:35:54.999214: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F AVX512_VNNI FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-02-17 16:35:55.092436: I tensorflow/core/util/port.cc:104] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-02-17 16:35:55.570116: W tensorflow/compiler/xla/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-11.2/lib64
2023-02-17 16:35:55.570163: W tensorflow/compiler/xla/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-11.2/lib64
2023-02-17 16:35:55.570168: 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 have libnvinfer.so.8:
$ find /usr/lib64 -name "libnvinfer*"
/usr/lib64/libnvinfer_plugin.so.8
/usr/lib64/libnvinfer_plugin.so.8.5.3
/usr/lib64/libnvinfer_builder_resource.so.8.5.3
/usr/lib64/libnvinfer.so.8.5.3
/usr/lib64/libnvinfer.so.8
Details of my platform and installations below.
Can someone help?
Thanks,
Platform Details:
ThinkStation P520 Workstation with a Nvidia GeForce RTX 3080 GPU.
I installed Rocky Linux 8 on it:
cat /etc/os-release
NAME="Rocky Linux"
VERSION="8.6 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.6"
I followed the instructions to install CUDA at CUDA Installation Guide for Linux and I seem to have done that correctly (several times, in fact).
$ update-alternatives --display cuda
cuda - status is manual.
link currently points to /usr/local/cuda-11.2
/usr/local/cuda-11.6 - priority 116
/usr/local/cuda-12.0 - priority 120
/usr/local/cuda-11.8 - priority 118
/usr/local/cuda-11.2 - priority 112
Current `best' version is /usr/local/cuda-12.0.
The cuda-samples/Samples/1_Utilities/deviceQuery program says:
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "NVIDIA GeForce RTX 3080"
CUDA Driver Version / Runtime Version 12.0 / 11.2
CUDA Capability Major/Minor version number: 8.6
. . .
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.0, CUDA Runtime Version = 11.2, NumDevs = 1
Result = PASS
If I search for libnvinfer, I get:
$ dnf search libnvinfer
libnvinfer-bin.x86_64 : TensorRT development binaries
libnvinfer-devel.x86_64 : TensorRT development libraries and headers
libnvinfer-plugin-devel.x86_64 : TensorRT development plugin libraries and headers
libnvinfer-plugin8.x86_64 : TensorRT runtime plugin libraries
libnvinfer-samples.x86_64 : TensorRT samples
libnvinfer8.x86_64 : TensorRT runtime libraries
python3-libnvinfer.x86_64 : Python 3 bindings for TensorRT
python3-libnvinfer-devel.x86_64 : Python 3 development package for TensorRT
And the contents of libnvinfer8 are not what Tensorflow wants:
$ rpm -ql libnvinfer8
/usr/lib64/libnvinfer.so.8
/usr/lib64/libnvinfer.so.8.5.3
I’m happy to update this with any additional information you need.