TF-TRT Warning: Could not find TensorRT
I have same issue on python 3.8 image on docker

" tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT" I'm having the same problem, manage to solve it?

tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT i think pip install tensorflow[cuda] will solve the issue but i am not quite sure Did you install TensorRT? You can install from here:
https://developer.nvidia.com/tensorrt Hi @MachinesOnTheRise ,

You might need to install compatible TensorRT version from Nvidia. Since this is a optimization library for Inferences and developed by Nvidia for their specific GPUs, it may not come bundled with TF package. You can use `tensorflow[and-cuda] `package for installing TF with required cuda/cudnn packages as below.But they seems don't have tensorrt bundled.

https://github.com/tensorflow/tensorflow/blob/ced28148be8cec1f234886f21c7e528c374032b8/tensorflow/tools/pip_package/setup.py#L151-L166

 This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
I'm getting this error while running dreambooth lora on colab .
pip install tensorflow[and-cuda] -- This also not solved the problem.
Any solutions ? You need to install TensorRT separately. It's not bundled with tensorflow.  W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
I get this error in docker @MachinesOnTheRise @vinay-colaco @SuryanarayanaY @Dheeraj2002 

Any update? Sadly been getting the same issue for about a month now.

This what i am getting:

```
2024-04-21 08:00:13.414353: I tensorflow/core/util/port.cc:113] 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`.
2024-04-21 08:00:13.552935: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-04-21 08:00:14.655097: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-04-21 08:00:16.735268: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:17:00.0/numa_node
Your kernel may have been built without NUMA support.
2024-04-21 08:00:16.828498: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2251] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
```

I have manually installed TensorRT and still have the same error

Here is my Dockerfile for reference:

```
FROM nvidia/cuda:12.0.0-devel-ubuntu20.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && \
    apt-get install -y git ffmpeg libssl-dev lsb-release wget curl


ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PATH="/root/miniconda3/bin:${PATH}"

RUN wget \
    https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
    && mkdir /root/.conda \
    && bash Miniconda3-latest-Linux-x86_64.sh -b \
    && rm -f Miniconda3-latest-Linux-x86_64.sh s

RUN conda --version
# conda 24.1.2


# CUDNN
RUN apt clean
RUN apt update 
RUN apt autoremove

RUN wget https://developer.download.nvidia.com/compute/cudnn/9.1.0/local_installers/cudnn-local-repo-ubuntu2004-9.1.0_1.0-1_amd64.deb
RUN dpkg -i cudnn-local-repo-ubuntu2004-9.1.0_1.0-1_amd64.deb
RUN cp /var/cudnn-local-repo-ubuntu2004-9.1.0/cudnn-*-keyring.gpg /usr/share/keyrings/
RUN apt-get update
RUN apt-get -y install cudnn-cuda-12


# CUBLASS
RUN curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK |  gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg
RUN echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' |  tee /etc/apt/sources.list.d/nvhpc.list
RUN apt-get update -y
RUN apt-get install -y nvhpc-24-3
RUN apt install -f

#TENSORRT
RUN wget https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/secure/8.6.1/local_repos/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0_1.0-1_amd64.deb
RUN dpkg -i nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0_1.0-1_amd64.deb
RUN cp /var/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0/*-keyring.gpg /usr/share/keyrings/
RUN apt-get update
RUN apt-get install -y tensorrt
RUN apt-get install -y libnvinfer-lean8
RUN apt-get install -y libnvinfer-vc-plugin8
RUN python3 -m pip install numpy

RUN dpkg-query -W tensorrt
#tensorrt	10.0.0.6-1+cuda12.4

RUN conda install python=3.9.18

RUN pip install boto3 spleeter tensorrt cuda-python
RUN pip install git+https://github.com/facebookresearch/audiocraft.git
RUN pip install torch==2.1.0+cu121 --index-url https://download.pytorch.org/whl/cu121

RUN conda install -c nvidia cuda-python cudatoolkit

RUN export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12.0/targets/x86_64-linux/lib

RUN find / -name '*libcudart*'
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/REDIST/cuda/12.3/targets/x86_64-linux/lib/libcudart.so.12.3.101
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/REDIST/cuda/12.3/targets/x86_64-linux/lib/libcudart.so.12
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/REDIST/cuda/12.3/targets/x86_64-linux/lib/libcudart.so
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/12.3/targets/x86_64-linux/lib/libcudart.so.12
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/12.3/targets/x86_64-linux/lib/libcudart.so
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/12.3/targets/x86_64-linux/lib/libcudart.so.12.3.101
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/12.3/targets/x86_64-linux/lib/libcudart_static.a
/root/miniconda3/lib/python3.9/site-packages/nvidia/cuda_runtime/lib/libcudart.so.12
/root/miniconda3/lib/python3.9/site-packages/torch/lib/libcudart-9335f6a2.so.12
/usr/local/cuda-12.0/targets/x86_64-linux/lib/libcudart.so.12
/usr/local/cuda-12.0/targets/x86_64-linux/lib/libcudart.so.12.0.107
/usr/local/cuda-12.0/targets/x86_64-linux/lib/libcudart.so
/usr/local/cuda-12.0/targets/x86_64-linux/lib/libcudart_static.a

RUN find / -name '*tensorrt*'
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/REDIST/cuda/12.3/targets/x86_64-linux/lib/libcudart.so.12.3.101
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/REDIST/cuda/12.3/targets/x86_64-linux/lib/libcudart.so.12
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/REDIST/cuda/12.3/targets/x86_64-linux/lib/libcudart.so
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/12.3/targets/x86_64-linux/lib/libcudart.so.12
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/12.3/targets/x86_64-linux/lib/libcudart.so
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/12.3/targets/x86_64-linux/lib/libcudart.so.12.3.101
/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/cuda/12.3/targets/x86_64-linux/lib/libcudart_static.a
/root/miniconda3/lib/python3.9/site-packages/nvidia/cuda_runtime/lib/libcudart.so.12
/root/miniconda3/lib/python3.9/site-packages/torch/lib/libcudart-9335f6a2.so.12
/usr/local/cuda-12.0/targets/x86_64-linux/lib/libcudart.so.12
/usr/local/cuda-12.0/targets/x86_64-linux/lib/libcudart.so.12.0.107
/usr/local/cuda-12.0/targets/x86_64-linux/lib/libcudart.so
/usr/local/cuda-12.0/targets/x86_64-linux/lib/libcudart_static.a
Expand

=> Step 35: RUN find / -name '*tensorrt*'
/root/miniconda3/lib/python3.9/site-packages/tensorrt_bindings
/root/miniconda3/lib/python3.9/site-packages/tensorrt_bindings/tensorrt.so
/root/miniconda3/lib/python3.9/site-packages/tensorrt_bindings-8.6.1.dist-info
/root/miniconda3/lib/python3.9/site-packages/tensorrt_libs
/root/miniconda3/lib/python3.9/site-packages/tensorrt_libs-8.6.1.dist-info
/root/miniconda3/lib/python3.9/site-packages/tensorrt
/root/miniconda3/lib/python3.9/site-packages/tensorrt-8.6.1.post1.dist-info
/root/miniconda3/lib/python3.9/site-packages/tensorflow/python/compiler/tensorrt
/root/miniconda3/lib/python3.9/site-packages/tensorflow/_api/v2/compat/v2/experimental/tensorrt
/root/miniconda3/lib/python3.9/site-packages/tensorflow/_api/v2/experimental/tensorrt
/root/miniconda3/lib/python3.9/site-packages/tensorflow/compiler/tf2tensorrt
/root/miniconda3/lib/python3.9/site-packages/tensorflow/include/tensorflow/compiler/tf2tensorrt
/root/miniconda3/lib/python3.9/site-packages/torch/_dynamo/backends/tensorrt.py
/root/miniconda3/lib/python3.9/site-packages/torch/_dynamo/backends/__pycache__/tensorrt.cpython-39.pyc
/root/miniconda3/lib/python3.9/site-packages/torch/ao/quantization/backend_config/tensorrt.py
/root/miniconda3/lib/python3.9/site-packages/torch/ao/quantization/backend_config/__pycache__/tensorrt.cpython-39.pyc
/usr/share/doc/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0
/usr/share/doc/tensorrt-10.0.0.6
/usr/share/doc/tensorrt
/usr/share/keyrings/nv-tensorrt-local-9A1EDFBA-keyring.gpg
/usr/lib/python3.8/dist-packages/tensorrt
/usr/lib/python3.8/dist-packages/tensorrt/tensorrt.so
/usr/lib/python3.8/dist-packages/tensorrt-10.0.0b6.dist-info
/usr/lib/python3.8/dist-packages/tensorrt_lean
/usr/lib/python3.8/dist-packages/tensorrt_lean/tensorrt_lean.so
/usr/lib/python3.8/dist-packages/tensorrt_lean-10.0.0b6.dist-info
/usr/lib/python3.8/dist-packages/tensorrt_dispatch
/usr/lib/python3.8/dist-packages/tensorrt_dispatch/tensorrt_dispatch.so
/usr/lib/python3.8/dist-packages/tensorrt_dispatch-10.0.0b6.dist-info
/usr/src/tensorrt
/usr/src/tensorrt/samples/python/yolov3_onnx/onnx_to_tensorrt.py
/etc/apt/sources.list.d/nv-tensorrt-local-ubuntu2004-8.6.1-cuda-12.0.list
/var/lib/apt/lists/_var_nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0_InRelease
/var/lib/apt/lists/_var_nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0_Packages.lz4
/var/lib/dpkg/info/tensorrt.md5sums
/var/lib/dpkg/info/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0.list
/var/lib/dpkg/info/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0.conffiles
/var/lib/dpkg/info/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0.md5sums
/var/lib/dpkg/info/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0.postinst
/var/lib/dpkg/info/tensorrt.list
/var/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0
/var/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0/nv-tensorrt-local-9A1EDFBA-keyring.gpg
/var/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0/tensorrt-dev_8.6.1.6-1+cuda12.0_amd64.deb
/var/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0/tensorrt-libs_8.6.1.6-1+cuda12.0_amd64.deb
/var/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0/tensorrt_8.6.1.6-1+cuda12.0_amd64.deb
/nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-12.0_1.0-1_amd64.deb


RUN python3 -c "import tensorrt; print(tensorrt.__path__)"
RUN python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
RUN python -c "import tensorflow.compiler as tf_cc; print(tf_cc.tf2tensorrt._pywrap_py_utils.get_linked_tensorrt_version())"
RUN pip list

RUN nvcc --version
#nvcc: NVIDIA (R) Cuda compiler driver
#Copyright (c) 2005-2023 NVIDIA Corporation
#Built on Fri_Jan__6_16:45:21_PST_2023
#Cuda compilation tools, release 12.0, V12.0.140
#Build cuda_12.0.r12.0/compiler.32267302_0

RUN lsb_release -a
# No LSB modules are available.
# Distributor ID: Ubuntu
# Description:    Ubuntu 20.04.5 LTS
# Release:        20.04
# Codename:       focal
``` Hi @MachinesOnTheRise ,

Can you confirm the output of this code that is in your docker file?

python3 -c "import tensorrt; print(tensorrt.__path__)" Exact same issue as OP.

Results of attempting to print tensorrt.path results in the following:

```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'tensorrt' has no attribute 'path'
``` > python3 -c "import tensorrt; print(tensorrt.**path**)"

you should better run

python3 -c "import tensorrt; print(tensorrt.\_\_file\_\_)" That works. Here's what I get:

`
/home/azureuser/miniconda3/envs/tensorflow-2.16.1/lib/python3.12/site-packages/tensorrt/__init__.py
` I am having the same issues and have tried all the listed remedies to no avail. I followed nvidia instructions and installed from tar.gz, as per the latest above I do verify the import does see tensorrt. I am trying to run it in a simple anaconda virtual environment. This is the only library I am having issues with, no matter what I do, no change in outcome, I am wondering if we have a real bug here.  Just commenting to say I am experiencing the exact same issue.  Some follow up information.

```
which python3
>>> /home/bplaster/anaconda3/bin/python3
```

```
python3 -c "import tensorrt; print(tensorrt.__file__)"
>>> /home/bplaster/anaconda3/lib/python3.11/site-packages/tensorrt/__init__.py
```

```
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices())"
>>> 2024-05-02 15:35:07.243819: I tensorflow/core/util/port.cc:113] 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`.
2024-05-02 15:35:07.269922: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-05-02 15:35:07.628229: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-05-02 15:35:08.153905: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2024-05-02 15:35:08.156012: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2251] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU')]
```

```
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0
```

```
 nvidia-smi
Thu May  2 15:46:11 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.76.01              Driver Version: 552.22         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA RTX A4000               On  |   00000000:01:00.0 Off |                  Off |
| 41%   37C    P8              6W /  140W |      10MiB /  16376MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
``` Some more information for the devs maintaining Tensorflow.

When attempting to run the following in terminal:
`python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"`

I get the following error:
```
2024-05-03 14:51:51.684995: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-05-03 14:51:52.375372: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2251] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
[]
```

TensorRT is installed and I'm quite certain that I have all required nvidia drivers, CUDA, cuDNN toolkits, etc. installed...

`nvidia-smi` results in:

```
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.54.15              Driver Version: 550.54.15      CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  Tesla V100-PCIE-16GB           Off |   00000001:00:00.0 Off |                  Off |
| N/A   29C    P0             25W /  250W |     102MiB /  16384MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A       926      G   /usr/lib/xorg/Xorg                             87MiB |
|    0   N/A  N/A      1009      G   /usr/bin/gnome-shell                           13MiB |
+-----------------------------------------------------------------------------------------+
```

I am able to run other libraries on the GPU (e.g. XGBoost) with no problem. Consequently, this is a Tensorflow issue.

Here's my very basic dev environment:
```
# packages in environment at /home/azureuser/miniconda3/envs/tensorflow-2.16.1:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
absl-py                   2.1.0                    pypi_0    pypi
astunparse                1.6.3                    pypi_0    pypi
bzip2                     1.0.8                hd590300_5    conda-forge
ca-certificates           2024.2.2             hbcca054_0    conda-forge
certifi                   2024.2.2                 pypi_0    pypi
charset-normalizer        3.3.2                    pypi_0    pypi
flatbuffers               24.3.25                  pypi_0    pypi
gast                      0.5.4                    pypi_0    pypi
google-pasta              0.2.0                    pypi_0    pypi
grpcio                    1.63.0                   pypi_0    pypi
h5py                      3.11.0                   pypi_0    pypi
idna                      3.7                      pypi_0    pypi
keras                     3.3.3                    pypi_0    pypi
ld_impl_linux-64          2.40                 h55db66e_0    conda-forge
libclang                  18.1.1                   pypi_0    pypi
libexpat                  2.6.2                h59595ed_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h77fa898_6    conda-forge
libgomp                   13.2.0               h77fa898_6    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libsqlite                 3.45.3               h2797004_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
markdown                  3.6                      pypi_0    pypi
markdown-it-py            3.0.0                    pypi_0    pypi
markupsafe                2.1.5                    pypi_0    pypi
mdurl                     0.1.2                    pypi_0    pypi
ml-dtypes                 0.3.2                    pypi_0    pypi
namex                     0.0.8                    pypi_0    pypi
ncurses                   6.4.20240210         h59595ed_0    conda-forge
numpy                     1.26.4                   pypi_0    pypi
nvidia-cublas-cu12        12.3.4.1                 pypi_0    pypi
nvidia-cuda-cupti-cu12    12.3.101                 pypi_0    pypi
nvidia-cuda-nvcc-cu12     12.3.107                 pypi_0    pypi
nvidia-cuda-nvrtc-cu12    12.3.107                 pypi_0    pypi
nvidia-cuda-runtime-cu12  12.3.101                 pypi_0    pypi
nvidia-cudnn-cu12         8.9.7.29                 pypi_0    pypi
nvidia-cufft-cu12         11.0.12.1                pypi_0    pypi
nvidia-curand-cu12        10.3.4.107               pypi_0    pypi
nvidia-cusolver-cu12      11.5.4.101               pypi_0    pypi
nvidia-cusparse-cu12      12.2.0.103               pypi_0    pypi
nvidia-nccl-cu12          2.19.3                   pypi_0    pypi
nvidia-nvjitlink-cu12     12.3.101                 pypi_0    pypi
openssl                   3.3.0                hd590300_0    conda-forge
opt-einsum                3.3.0                    pypi_0    pypi
optree                    0.11.0                   pypi_0    pypi
packaging                 24.0                     pypi_0    pypi
pip                       24.0               pyhd8ed1ab_0    conda-forge
protobuf                  4.25.3                   pypi_0    pypi
pygments                  2.17.2                   pypi_0    pypi
python                    3.11.9          hb806964_0_cpython    conda-forge
readline                  8.2                  h8228510_1    conda-forge
requests                  2.31.0                   pypi_0    pypi
rich                      13.7.1                   pypi_0    pypi
setuptools                69.5.1             pyhd8ed1ab_0    conda-forge
six                       1.16.0                   pypi_0    pypi
tensorboard               2.16.2                   pypi_0    pypi
tensorboard-data-server   0.7.2                    pypi_0    pypi
tensorflow                2.16.1                   pypi_0    pypi
tensorflow-io-gcs-filesystem 0.37.0                   pypi_0    pypi
tensorrt                  10.0.1                   pypi_0    pypi
tensorrt-cu12             10.0.1                   pypi_0    pypi
termcolor                 2.4.0                    pypi_0    pypi
tk                        8.6.13          noxft_h4845f30_101    conda-forge
typing-extensions         4.11.0                   pypi_0    pypi
tzdata                    2024a                h0c530f3_0    conda-forge
urllib3                   2.2.1                    pypi_0    pypi
werkzeug                  3.0.2                    pypi_0    pypi
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
wrapt                     1.16.0                   pypi_0    pypi
xz                        5.2.6                h166bdaf_0    conda-forge
```

Note: I'm on Linux (MSFT Azure VM)

Any luck in replicating the issue? Wanted to add more onto this, I spent a day trying various WSL Tensorflow installation methods and still no luck.

For context, I'm on Windows 11, with an i7-13700 and an RTX A4000 Series GPU.

Here are my printouts:

```
nvidia-smi
Fri May  3 09:50:02 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.76.01              Driver Version: 552.22         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA RTX A4000               On  |   00000000:01:00.0 Off |                  Off |
| 45%   37C    P0             35W /  140W |       0MiB /  16376MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
```

```
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0
```

```
 which python
/home/bplaster/anaconda3/bin/python
```

interestingly, after using `pip install tensorflow[and-cuda]` within the WSL environment, I was getting this:
```
python3 -c "import tensorrt; print(tensorrt.__file__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorrt'
```

I attempted to resolve this with: `pip install tensorrt`

```
Collecting tensorrt
  Downloading tensorrt-10.0.1.tar.gz (16 kB)
  Preparing metadata (setup.py) ... done
Collecting tensorrt-cu12 (from tensorrt)
  Downloading tensorrt-cu12-10.0.1.tar.gz (18 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: tensorrt, tensorrt-cu12
  Building wheel for tensorrt (setup.py) ... done
  Created wheel for tensorrt: filename=tensorrt-10.0.1-py2.py3-none-any.whl size=16333 sha256=19d103fecc3bfb19836fe815d369e65171978f61bb476e89ae84b857953f64e7
  Stored in directory: /home/bplaster/.cache/pip/wheels/31/90/ef/53ad98d9a1bd660c0177aa1ea91bde288edfbe4d15621ca472
  Building wheel for tensorrt-cu12 (setup.py) ... done
  Created wheel for tensorrt-cu12: filename=tensorrt_cu12-10.0.1-py2.py3-none-any.whl size=17549 sha256=5877c62938e16384e9c969b00a94dea5bda1bea7de2db0249bcfd8520d5082fd
  Stored in directory: /home/bplaster/.cache/pip/wheels/c5/08/30/a058eaf14eeeabb3799e3abd3a2a534649123824dcd9695876
Successfully built tensorrt tensorrt-cu12
Installing collected packages: tensorrt-cu12, tensorrt
Successfully installed tensorrt-10.0.1 tensorrt-cu12-10.0.1
```

Checking the nvidia compatibility matrrix, this should be good to go:
![image](https://github.com/tensorflow/tensorflow/assets/109623345/32b94431-490d-429c-ad07-679724477315)

Now, we see that TensorRT is there when called:
```
python3 -c "import tensorrt; print(tensorrt.__file__)"
/home/bplaster/anaconda3/lib/python3.11/site-packages/tensorrt/__init__.py
```

Yet we still get the following message when checking the Tensorflow version:

```
python -c "import tensorflow as tf; print(tf.__version__)"
2024-05-03 09:51:40.606740: I tensorflow/core/util/port.cc:113] 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`.
2024-05-03 09:51:40.632018: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-05-03 09:51:41.004536: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2.16.1
```

Finally, confirming that the GPU cannot be seen by Tensorflow for some reason:

```
python -c "import tensorflow as tf; print(tf.config.list_physical_devices())"
2024-05-03 10:01:27.648034: I tensorflow/core/util/port.cc:113] 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`.
2024-05-03 10:01:27.673662: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-05-03 10:01:28.043090: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-05-03 10:01:30.488133: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2024-05-03 10:01:30.501591: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2251] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU')]
```

This is all done on a completely fresh WSL2 Ubuntu environment, all done in the (base) conda environment.  Hope this is helpful.

 Same issue:
```
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"    
2024-05-08 12:14:54.731695: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-05-08 12:14:55.226452: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-05-08 12:14:55.882997: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:2b:00.0/numa_node
Your kernel may have been built without NUMA support.
2024-05-08 12:14:55.911562: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:2b:00.0/numa_node
Your kernel may have been built without NUMA support.
2024-05-08 12:14:55.911640: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:2b:00.0/numa_node
Your kernel may have been built without NUMA support.
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
``` 
My nvidia drivers and cuda version:
```
nvidia-smi
Wed May  8 12:06:07 2024       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.76.01              Driver Version: 552.22         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3060 Ti     On  |   00000000:2B:00.0  On |                  N/A |
| 30%   31C    P0             42W /  200W |     979MiB /   8192MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
``` 
```
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0
```
I've installed tensorflow and tensorrt through pip:
```
pip install tensorflow[and-cuda]
pip install tensorrt
```

I have follow the guide: [Install TensorFlow with pip](https://www.tensorflow.org/install/pip) and added path as in [Install Tensorflow & Pytorch with CUDA [Linux | WSL2]](https://gist.github.com/mantasu/d79d23b58d822d675274f87c46eb7aca) but I'm still getting the same warning (TF-TRT Warning: Could not find TensorRT).

Does any anyone managed to find a solution? Any solution? Same issue here, installed tensorrt with `pip install --extra-index-url https://pypi.nvidia.com tensorrt-libs`,
 followed by `pip install tensorflow[and-cuda]==2.15.0`. It successfully updated the 'nvidia-...' packages.

Yet, I get the following when running it in python (3.10.8):

```
>>> import tensorflow
2024-05-14 17:25:38.312524: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-05-14 17:25:38.312576: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-05-14 17:25:38.314278: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-05-14 17:25:38.322356: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-05-14 17:25:39.497691: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
```
```
>> import tensorrt
>> print(tensorrt.__file__)
/home/bariller/.conda/envs/myenv/lib/python3.10/site-packages/tensorrt/__init__.py
```

Has anyone managed to make it work ?


```
$ nvidia-smi
Tue May 14 17:40:12 2024       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.161.08             Driver Version: 535.161.08   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA TITAN RTX               On  | 00000000:3B:00.0 Off |                  N/A |
| 41%   30C    P8              15W / 280W |      1MiB / 24576MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+
``` I think that the only way is to find the compatible versions for python, tensorflow, nvidia driver, cuda, cudnn and tensorrt. I'll try the tested build configurations from [here](https://www.tensorflow.org/install/source#setup_for_linux_and_macos) in WSL and Ubuntu. Hope it works 🙏  > I think that the only way is to find the compatible versions for python, tensorflow, nvidia driver, cuda, cudnn and tensorrt. I'll try the tested build configurations from [here](https://www.tensorflow.org/install/source#setup_for_linux_and_macos) in WSL and Ubuntu. Hope it works 🙏

So, after trying out pretty much everything else, I can confirm that this worked out and my GPU is now also detected.  I am on Ubuntu  22.0.4.4 running Tensorflow 2.16. 

Many thanks @BigKhalPablo, saved my day ;)

Cheers,
Eric Could you explain how you managed to make it work @eric86y? Did you follow the "build from source" guide for Linux or the "install with pip"? I'm trying in WSL2 but I haven't made any progress yet 😞  **Couldn't resolve TF-TRT Warning: Could not find TensorRT**

I'm using wsl2 in windows 11.

```
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy
```
Previously, I wasn't able to have GPU as the backend, I had tried all the methods in installing tensorflow in wsl. 

But, trying with python3.11 and tensorflow  2.15.1, got me access to the GPU backend. 

```
conda create -n tmpenv python=3.11
conda activate tmpenv
pip install tensorflow[and-cuda]==2.15.1
```

versions:
```
tensorflow                    2.15.1
tensorrt                      10.0.1
```
nvidia-smi:
```
Tue May 21 15:45:23 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.76.01              Driver Version: 552.44         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4080 ...    On  |   00000000:01:00.0 Off |                  N/A |
| N/A   38C    P4             17W /   55W |       0MiB /  12282MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
```
```
2024-05-21 15:46:26.487553: I external/local_xla/xla/service/service.cc:168] XLA service 0x7fcc3f7b2c00 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2024-05-21 15:46:26.487663: I external/local_xla/xla/service/service.cc:176]   StreamExecutor device (0): NVIDIA GeForce RTX 4080 Laptop GPU, Compute Capability 8.9
```
I've tried all ways of installing tensorrt - pip, .deb, .tar;
updated path variable, etc.
Its importing in python shell

```
>>> import tensorrt as trt
>>> trt.__version__
'10.0.1'
>>> trt.__file__
'/home/mohan/miniconda3/envs/tmpenv/lib/python3.11/site-packages/tensorrt/__init__.py'
```
All the files are available (.tar installation method)
```
(tmpenv) mohan@LAPTOP-INPO8147:~$ ls TensorRT-10.0.1.6/
bin  data  doc  include  lib  onnx_graphsurgeon  python  samples  targets

(tmpenv) mohan@LAPTOP-INPO8147:~$ ls TensorRT-10.0.1.6/lib/
libnvinfer.so                          libnvinfer_plugin.so.10.0.1
libnvinfer.so.10                       libnvinfer_plugin_static.a
libnvinfer.so.10.0.1                   libnvinfer_static.a
libnvinfer_builder_resource.so.10.0.1  libnvinfer_vc_plugin.so
libnvinfer_dispatch.so                 libnvinfer_vc_plugin.so.10
libnvinfer_dispatch.so.10              libnvinfer_vc_plugin.so.10.0.1
libnvinfer_dispatch.so.10.0.1          libnvinfer_vc_plugin_static.a
libnvinfer_dispatch_static.a           libnvonnxparser.so
libnvinfer_lean.so                     libnvonnxparser.so.10
libnvinfer_lean.so.10                  libnvonnxparser.so.10.0.1
libnvinfer_lean.so.10.0.1              libnvonnxparser_static.a
libnvinfer_lean_static.a               libonnx_proto.a
libnvinfer_plugin.so                   stubs
libnvinfer_plugin.so.10

(tmpenv) mohan@LAPTOP-INPO8147:~/TensorRT-10.0.1.6/python$ ls
tensorrt-10.0.1-cp310-none-linux_x86_64.whl
tensorrt-10.0.1-cp311-none-linux_x86_64.whl
tensorrt-10.0.1-cp312-none-linux_x86_64.whl
tensorrt-10.0.1-cp38-none-linux_x86_64.whl
tensorrt-10.0.1-cp39-none-linux_x86_64.whl
tensorrt_dispatch-10.0.1-cp310-none-linux_x86_64.whl
tensorrt_dispatch-10.0.1-cp311-none-linux_x86_64.whl
tensorrt_dispatch-10.0.1-cp312-none-linux_x86_64.whl
tensorrt_dispatch-10.0.1-cp38-none-linux_x86_64.whl
tensorrt_dispatch-10.0.1-cp39-none-linux_x86_64.whl
tensorrt_lean-10.0.1-cp310-none-linux_x86_64.whl
tensorrt_lean-10.0.1-cp311-none-linux_x86_64.whl
tensorrt_lean-10.0.1-cp312-none-linux_x86_64.whl
tensorrt_lean-10.0.1-cp38-none-linux_x86_64.whl
tensorrt_lean-10.0.1-cp39-none-linux_x86_64.whl
```

I've also used the files from .tar method to install using pip:
```
(tmpenv) mohan@LAPTOP-INPO8147:~/TensorRT-10.0.1.6/python$ python3 -m pip install tensorrt-10.0.1-cp311-none-linux_x86_64.whl
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing ./tensorrt-10.0.1-cp311-none-linux_x86_64.whl
tensorrt is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.

(tmpenv) mohan@LAPTOP-INPO8147:~/TensorRT-10.0.1.6/python$ python3 -m pip install tensorrt_dispatch-10.0.1-cp311-none-linux_x86_64.whl
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing ./tensorrt_dispatch-10.0.1-cp311-none-linux_x86_64.whl
tensorrt-dispatch is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.

(tmpenv) mohan@LAPTOP-INPO8147:~/TensorRT-10.0.1.6/python$ python3 -m pip install tensorrt_lean-10.0.1-cp311-none-linux_x86_64.whl
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Processing ./tensorrt_lean-10.0.1-cp311-none-linux_x86_64.whl
tensorrt-lean is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
```
But still I get this error

```
2024-05-21 15:46:19.659564: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
``` > W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT I'm getting this error while running dreambooth lora on colab . pip install tensorflow[and-cuda] -- This also not solved the problem. Any solutions ?

I got exactly the same question like you, any ideas?
 > > W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT I'm getting this error while running dreambooth lora on colab . pip install tensorflow[and-cuda] -- This also not solved the problem. Any solutions ?
> 
> I got exactly the same question like you, any ideas?

still no Setting TF_CPP_MAX_VLOG_LEVEL=3 in my environment (WSL2 Ubuntu) gives the following specific error:

```
2024-06-04 15:42:11.291621: I external/local_tsl/tsl/platform/default/dso_loader.cc:70] Could not load dynamic library 'libnvinfer.so.8.6.1'; dlerror: libnvinfer.so.8.6.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/home/zilla/miniconda3/lib/:/home/zilla/miniconda3/lib/python3.12/site-packages/nvidia/cudnn/lib
2024-06-04 15:42:11.291675: I external/local_tsl/tsl/platform/default/dso_loader.cc:70] Could not load dynamic library 'libnvinfer_plugin.so.8.6.1'; dlerror: libnvinfer_plugin.so.8.6.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/home/zilla/miniconda3/lib/:/home/zilla/miniconda3/lib/python3.12/site-packages/nvidia/cudnn/lib
2024-06-04 15:42:11.291687: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
```

While I have TensorRT, and thus libnvinfer, installed, the actual libraries are named libnvinfer.so.10 and libnvinfer_plugin.so.10
Just as a test, I did the following:

```
~/miniconda3/lib$ ln -s python3.12/site-packages/tensorrt_libs/libnvinfer.so.10 libnvinfer.so.8.6.1
~/miniconda3/lib$ ln -s python3.12/site-packages/tensorrt_libs/libnvinfer_plugin.so.10 libnvinfer_plugin.so.8.6.1
```

And the warning about not finding TensorRT diapered.
Of course, if the libraries are not binary compatible, this might lead to further issues down the line, but at least it hints at what the problem is.

 @tilakrayal This issue seems to be related to TensorRT and GPU. Could you inform them? > Setting TF_CPP_MAX_VLOG_LEVEL=3 in my environment (WSL2 Ubuntu) gives the following specific error:
> 
> ```
> 2024-06-04 15:42:11.291621: I external/local_tsl/tsl/platform/default/dso_loader.cc:70] Could not load dynamic library 'libnvinfer.so.8.6.1'; dlerror: libnvinfer.so.8.6.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/home/zilla/miniconda3/lib/:/home/zilla/miniconda3/lib/python3.12/site-packages/nvidia/cudnn/lib
> 2024-06-04 15:42:11.291675: I external/local_tsl/tsl/platform/default/dso_loader.cc:70] Could not load dynamic library 'libnvinfer_plugin.so.8.6.1'; dlerror: libnvinfer_plugin.so.8.6.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/home/zilla/miniconda3/lib/:/home/zilla/miniconda3/lib/python3.12/site-packages/nvidia/cudnn/lib
> 2024-06-04 15:42:11.291687: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
> ```
> 
> While I have TensorRT, and thus libnvinfer, installed, the actual libraries are named libnvinfer.so.10 and libnvinfer_plugin.so.10 Just as a test, I did the following:
> 
> ```
> ~/miniconda3/lib$ ln -s python3.12/site-packages/tensorrt_libs/libnvinfer.so.10 libnvinfer.so.8.6.1
> ~/miniconda3/lib$ ln -s python3.12/site-packages/tensorrt_libs/libnvinfer_plugin.so.10 libnvinfer_plugin.so.8.6.1
> ```
> 
> And the warning about not finding TensorRT diapered. Of course, if the libraries are not binary compatible, this might lead to further issues down the line, but at least it hints at what the problem is.

Yes. It works.
I have the miniconda env "cuda12", cuda 12, tensorrt 10 on Ubuntu 22, WSL2.

That is my commands:
```
cd ~/miniconda3/envs/cuda12/lib/python3.11/site-packages/tensorrt_libs/
ln -s libnvinfer.so.10 libnvinfer.so.8.6.1
ln -s libnvinfer_plugin.so.10 libnvinfer_plugin.so.8.6.1

```

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

2.15.0

### Custom code

No

### OS platform and distribution

Ubuntu 22.04

### Mobile device

_No response_

### Python version

3.11

### Bazel version

_No response_

### GCC/compiler version

11.2

### CUDA/cuDNN version

12.4

### GPU model and memory

RTX 3050 TI

### Current behavior?

Hey everybody,

I have tried installing tensorflow from my ubuntu 22.04 terminal with anaconda environment.  I am getting Can not find TensorRT.  I have a 4 monitor setup with Ubuntu and the 550 NVIDIA driver for the RTX 3050 TI does not work on my machine.  I have to run the 535 driver, and I think 12.4 CUDA is supported.  It installed the 550 driver automatically and I revert back to the 535 driver.  But after all that I still ended up with the error below.

I have tried uninstalling, reinstalling, and can't get it to work.  I am a graduate student taking a Machine Learning course.  I am spending more time debugging this issue then actually coding.  

Could somebody help me resolve?

### Standalone code to reproduce the issue

```shell
+---------------------------------------------------------------------------------------+                                                                                                                          
| NVIDIA-SMI 535.161.08             Driver Version: 535.161.08   CUDA Version: 12.2     |                                                                                                                          
|-----------------------------------------+----------------------+----------------------+                                                                                                                          
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |                                                                                                                          
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |                                                                                                                          
|                                         |                      |               MIG M. |                                                                                                                          
|=========================================+======================+======================|                                                                                                                          
|   0  NVIDIA GeForce RTX 3050 ...    Off | 00000000:01:00.0  On |                  N/A |                                                                                                                          
| N/A   66C    P8               8W /  35W |   1011MiB /  4096MiB |      0%      Default |                                                                                                                          
|                                         |                      |                  N/A |                                                                                                                          
+-----------------------------------------+----------------------+----------------------+                                                                                                                          
                                                                                                                                                                                                                   
+---------------------------------------------------------------------------------------+                                                                                                                          
| Processes:                                                                            |                                                                                                                          
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |                                                                                                                          
|        ID   ID                                                             Usage      |                                                                                                                          
|=======================================================================================|                                                                                                                          
|    0   N/A  N/A      2812      G   /usr/lib/xorg/Xorg                          648MiB |                                                                                                                          
|    0   N/A  N/A      3023      G   /usr/bin/gnome-shell                        148MiB |                                                                                                                          
|    0   N/A  N/A     78082      G   ...az/anaconda3/envs/skynet/bin/python        1MiB |                                                                                                                          
|    0   N/A  N/A     78475      G   ...seed-version=20240329-165146.919000       96MiB |                                                                                                                          
|    0   N/A  N/A     79970      G   ...gnu/webkit2gtk-4.0/WebKitWebProcess       68MiB |                                                                                                                          
+---------------------------------------------------------------------------------------+   
(base) thenaz@Skynet:~/Downloads$ lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation GA107M [GeForce RTX 3050 Ti Mobile] (rev a1)
01:00.1 Audio device: NVIDIA Corporation Device 2291 (rev a1)
(base) thenaz@Skynet:~/Downloads$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver                                                                                                                                                                              
Copyright (c) 2005-2024 NVIDIA Corporation                                                                                                                                                                         
Built on Tue_Feb_27_16:19:38_PST_2024                                                                                                                                                                              
Cuda compilation tools, release 12.4, V12.4.99                                                                                                                                                                     
Build cuda_12.4.r12.4/compiler.33961263_0
```


### Relevant log output

```shell
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"                                                                                  
2024-03-30 14:29:58.668656: I tensorflow/core/util/port.cc:113] 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`.                                                                                                                                 
2024-03-30 14:29:58.691384: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 
2024-03-30 14:29:58.691405: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered  
2024-03-30 14:29:58.692006: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered                                                                                                                                                                                                                 
2024-03-30 14:29:58.695703: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.                         
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-03-30 14:29:59.119119: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-03-30 14:29:59.660586: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2024-03-30 14:29:59.675221: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2024-03-30 14:29:59.675340: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
```
