Hi, I am trying to run a scrip that requires cuda, I have installed cuda 11 (which is the required version) twice but I am still getting the same error. See below
" W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘libcudart.so.11.0’; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/mujahid/.local/lib/python3.8/site-packages/cv2/…/…/lib64::/home/mujahid/anaconda3/pkgs/cuda-cudart-11.6.55-he381448_0/lib/libcudart.so.11.0
2023-03-26 16:31:41.925638: I tensorflow/compiler/xla/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2023-03-26 16:31:42.468206: 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: /home/mujahid/.local/lib/python3.8/site-packages/cv2/…/…/lib64::/home/mujahid/anaconda3/pkgs/cuda-cudart-11.6.55-he381448_0/lib/libcudart.so.11.0
2023-03-26 16:31:42.468298: 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: /home/mujahid/.local/lib/python3.8/site-packages/cv2/…/…/lib64::/home/mujahid/anaconda3/pkgs/cuda-cudart-11.6.55-he381448_0/lib/libcudart.so.11.0
2023-03-26 16:31:42.468305: 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."
So, I reinstalled tensorflow 2.12, and followed the instructions on the website, now I get this…
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: /home/mujahid/.local/lib/python3.8/site-packages/cv2/…/…/lib64::/home/mujahid/anaconda3/pkgs/cuda-cudar:/home/mujahid/anaconda3/envs/rl_env/lib:/home/mujahid/anaconda3/pkgs/cuda-cudart-11.6.55-he381448_0/lib/libcudart.so.11.0:/home/mujahid/anaconda3/envs/rl_env/lib/python3.8/site-packages/nvidia/cuda_runtime/lib/libcudart.so.11.0
2023-03-27 14:31:13.166417: 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: /home/mujahid/.local/lib/python3.8/site-packages/cv2/…/…/lib64::/home/mujahid/anaconda3/pkgs/cuda-cudar:/home/mujahid/anaconda3/envs/rl_env/lib:/home/mujahid/anaconda3/pkgs/cuda-cudart-11.6.55-he381448_0/lib/libcudart.so.11.0:/home/mujahid/anaconda3/envs/rl_env/lib/python3.8/site-packages/nvidia/cuda_runtime/lib/libcudart.so.11.0
Your LD_LIBRARY_PATH is incorrect, it should point to the actual folder containing .so files.
Can you try setting a symbolic link from libnvinfer version 7 to 8 as shown below:
# the following path will be different for you - depending on your install method
$ cd env/lib/python3.9/site-packages/tensorrt
# create symbolic links
$ ln -s libnvinfer_plugin.so.8 libnvinfer_plugin.so.7
$ ln -s libnvinfer.so.8 libnvinfer.so.7
# add tensorrt to library path
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/env/lib/python3.9/site-packages/tensorrt/