Giter VIP home page Giter VIP logo

Comments (4)

SangminLee0828 avatar SangminLee0828 commented on June 16, 2024 1

I still did not solve TensorRT problem ("TF-TRT Warning: Could not find TensorRT")

WSL2, Ubuntu 22.04, RTX 3090, Python 3.11, TensorFlow 2.15.1
(I installed TensorFlow as pip install tensorflow[and-cuda]==2.15.1)

Once I execute

python3 -c "import tensorflow.compiler as tf_cc; \
print(tf_cc.tf2tensorrt._pywrap_py_utils.get_linked_tensorrt_version())"

I get the following error

2024-05-28 11:29:40.984287: 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-28 11:29:40.984330: 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-28 11:29:40.984879: 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-28 11:29:40.988008: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-05-28 11:29:41.499909: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
(8, 6, 1)

So, obviously, I need 8.6.1 version of TensorRT and I downloaded "TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-12.0.tar.gz"
After extract it, moved folder to "~/local/opt/TensorRT-8.6.1.6"

For example,

(tf_215_py_311_wsl) enhorse@DESKTOP-5950X:~/local/opt/TensorRT-8.6.1.6$ ls
bin  data  doc  graphsurgeon  include  lib  onnx_graphsurgeon  python  samples  targets  uff

Following Nvidia's installation instruction (https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-tar)

I did

python3 -m pip install tensorrt-8.6.1-cp311-none-linux_x86_64.whl
python3 -m pip install tensorrt_lean-8.6.1-cp311-none-linux_x86_64.whl
python3 -m pip install tensorrt_dispatch-8.6.1-cp311-none-linux_x86_64.whl
python3 -m pip install onnx_graphsurgeon-0.3.12-py2.py3-none-any.whl

I added followings after open sudo nano ~/.bashrc

export LD_LIBRARY_PATH=/home/enhorse/local/opt/TensorRT-8.6.1.6/lib:$LD_LIBRARY_PATH
export TensorRT_ROOT=/home/enhorse/local/opt/TensorRT-8.6.1.6

When I execute the commend
strace -e open,openat python -c "import tensorflow as tf" 2>&1 | grep "libnvinfer\|TF-TRT"

I got as follows:

openat(AT_FDCWD, "/home/enhorse/local/opt/TensorRT-8.6.1.6/lib/libnvinfer.so.8.6.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/enhorse/local/opt/TensorRT-8.6.1.6/lib/libnvinfer_plugin.so.8.6.1", O_RDONLY|O_CLOEXEC) = 3
2024-05-28 11:41:21.209619: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

I still have no idea what I can do more. Is there something wrong in my installation?

from tensorflow.

sushreebarsa avatar sushreebarsa commented on June 16, 2024

@MohanKrishnaGR The standard approach of installing TensorRT directly on your Windows host might not work for WSL 2. Instead, you'll need to install it within the WSL 2 environment itself. Please make sure to follow these instructions. Within your WSL 2 environment, please print the value of LD_LIBRARY_PATH to confirm it includes the TensorRT directory and let us know?

Thank you!

from tensorflow.

sushreebarsa avatar sushreebarsa commented on June 16, 2024

@MohanKrishnaGR The library paths mentioned (/home/enhorse/local/opt/TensorRT-8.6.1.6/lib) might be incorrect or not set properly in the environment variables.

Kindly verify that and let us know?
Thank you!

from tensorflow.

MohanKrishnaGR avatar MohanKrishnaGR commented on June 16, 2024

Thanks, @sushreebarsa !
for

echo $LD_LIBRARY_PATH

I got:

/usr/local/cuda/lib64:/home/mohan/TensorRT-10.0.1.6/lib:

But still the TRT Warning: Could not find TensorRT exits:

(env) mohan@LAPTOP-INPO8147:~$ python3 -c "import tensorflow.compiler as tf_cc; \
print(tf_cc.tf2tensorrt._pywrap_py_utils.get_linked_tensorrt_version())"

2024-05-30 19:12:05.605386: 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-30 19:12:05.646956: 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-30 19:12:05.647012: 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-30 19:12:05.647739: 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-30 19:12:05.654095: 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-05-30 19:12:06.221625: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
(8, 6, 1)

from tensorflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.