tensorflow: Could not load dynamic library 'libnvinfer_plugin.so.6'
Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
- TensorFlow installed from (source or binary): wheel
- TensorFlow version: 2.1.0
- Python version: 3.7
- Installed using virtualenv? pip? conda?: pip in virtualenv
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version: 10.1
- GPU model and memory: Titan XP
Describe the problem
2020-01-16 20:21:32.912603: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libnvinfer.so.6
2020-01-16 20:21:32.912768: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory
2020-01-16 20:21:32.912782: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] 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.
Provide the exact sequence of commands / steps that you executed before running into the problem
import tensorflow
Any other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
cuda-10-1/unknown,now 10.1.243-1 amd64 [installed]
cuda-command-line-tools-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-compiler-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cudart-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cudart-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cufft-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cufft-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cuobjdump-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cupti-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-curand-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-curand-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cusolver-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cusolver-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cusparse-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-cusparse-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-demo-suite-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-documentation-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-driver-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-drivers/unknown,now 440.33.01-1 amd64 [installed,automatic]
cuda-gdb-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-gpu-library-advisor-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-libraries-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-libraries-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-license-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-license-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-memcheck-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-misc-headers-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-npp-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-npp-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nsight-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nsight-compute-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nsight-systems-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvcc-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvdisasm-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvgraph-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvgraph-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvjpeg-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvjpeg-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvml-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvprof-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvprune-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvrtc-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvrtc-dev-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvtx-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-nvvp-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-repo-ubuntu1604/unknown,now 10.1.243-1 amd64 [installed,upgradable to: 10.2.89-1]
cuda-runtime-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-samples-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-sanitizer-api-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-toolkit-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-tools-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
cuda-visual-tools-10-1/unknown,now 10.1.243-1 amd64 [installed,automatic]
libcuda1-440/unknown,now 440.33.01-0ubuntu1 amd64 [installed,automatic]
libcudnn7/unknown,now 7.6.4.38-1+cuda10.1 amd64 [installed,upgradable to: 7.6.5.32-1+cuda10.2]
libcudnn7-dev/unknown,now 7.6.4.38-1+cuda10.1 amd64 [installed,upgradable to: 7.6.5.32-1+cuda10.2]
libnvinfer-dev/unknown,now 6.0.1-1+cuda10.1 amd64 [installed,upgradable to: 7.0.0-1+cuda10.2]
libnvinfer6/unknown,now 6.0.1-1+cuda10.1 amd64 [installed,upgradable to: 6.0.1-1+cuda10.2]
Note this doesn’t occur on nightly
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 39
- Comments: 52 (3 by maintainers)
Almost exactly the same issue with fresh install of Ubuntu.
I followed this guide almost to the letter but ran into issues with nvidia-drm, which I used tty3 to work around as suggested by one of the comments.
When I run
tf.test.is_gpu_available()
…When I encountered this issue, I was able to get tf to detect my card with
pip install tensorflow-gpu==2.0
.I got the same error as well. When I downgraded to TensorFlow 2.0.0 (with
pip install tensorflow-gpu==2.0.0
) it solved the issue.The solution isn’t to downgrade tensorflow (there is no problem with tensorflow 2.1, just the install docs). Install the missing library:
There is a PR to fix the docs.
Just to clarify, the install instructions for Ubuntu 16.04 should be updated; there are several errors, one being that cuda-10-1 is the appropriate cuda package, the other is that libnvinfer-plugin6=6.0.1-1+cuda10.1 is missing.
Ok, figured mine out. Here’s an outline of what i did. I was running multiple TF versions, so I wanted to go the manual route. I’ve had bad experiences with NVIDIA and Ubuntu nixing each others packages.
checked the version of tensorflow I had installed by starting the venv and then
pip list | grep tensorflow
tensorflow-gpu 2.1.0 tensorflow-estimator 2.1.0Checked https://www.tensorflow.org/install/source#tested_build_configurations for the versions required.
Downloaded local installer of CUDA 10.1 from NVIDIA and ran the installer. Carefully navigated the menus so that it only copied the files to /usr/local/cuda-10.1 directory (ie: if it wanted to “help” me, i told it “no thanks”). Downloaded cuDNN 7.6.5.32.tar.gz and tar xvf’d it to my download directory, it created a “cuda” directory backed up /usr/local/cuda-10.1 by copying it Copied the cuda/include/cudnn.h to /usr/local/cuda-10.1/include Copied the contents of cuda/lib to /usr/local/cuda-10.1 Downloaded TensorRT 6 tarball Extracted TensorRT 6 to my download directory. Opened my .venv/bin/activate script
Added /usr/local/cuda-10.1 and TensorRT 6 to the LD_LIBRARY_PATH and EXPORT
then sourced the environment
python
Wah lah…
2020-02-28 19:39:35.895538: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1241] Created TensorFlow device (/device:GPU:0 with 7386 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080 SUPER, pci bus id: 0000:08:00.0, compute capability: 7.5)
Then I went into my living room, sat on the lounge, drank a bottle of vodka, and passed out.
Now I feel much better 😃
It leads to another error
This also arise when tensorflow-gpu is not installed, which is surprising
@ai-starter basically you need to upgrade to cuda 10.1 and install the correct version CUDNN and TensorRT libraries
You should be able to follow https://github.com/tensorflow/tensorflow/issues/35968#issuecomment-577329399
If it doesn’t work this is what worked for me - I suspect what works may depend on what you currently have installed / how you installed it.
I think this thread summarizes very well what it’s like working with cuda/tensorflow
I have the same problem. How to slove it? Too many answers confuse me .Can someone summarize the solution to this problem?
That is correct. if you install tensorrt, the problem should go away. But otherwise, TF should continue running.
@sharonwoo
Try
ls /usr/local/cuda-10.0/lib64
orls /usr/local/cuda/lib64
and see if the libraries are foundand try exporting the path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
Now try
tf.test.is_gpu_available()
The above worked for me and my tensorflow-gpu version is 2.0
@mjlbach yes, reporting for tf 2.1.
I downgraded to 2.0 to get a working version of tf, and added in the note as info to anyone coming here after encountering the error. I have edited the wording to make it less confusing.
Had the same issue on Linux, Ubuntu 18.04.3, using Python 3.7.3, within virtual environment, when running in the console :
python -c; import keras;print(keras.__version__)
The problem occurs when trying to import keras or tensorflow.
I had to add --allow-downgrade flag to apt-get to install Tensorflow RT libnvinfer6. I.e.:
The problem went away.
2 hours into troubleshooting this error. What the hell is TensorRT and why do we even need it? Seems like more trouble than it’s worth to me.
I get the same problem as well. Had to downgrade to
2.0
.I am using anaconda with Ububtu and tensorflow-2.1, as mentioned above
worked for me too
Does not explain why “import tensorflow” works in tensrflow 2.0 but attempts to invoke a cuda library in tensorflow 2.1. On a laptop with an AMD card no less.
it is a warning, i found that TensorRT is a nVidia developed library to improve the CNN performance, but i think it is not needed, I’m working with
tensorflow 2.0
in Colab and it is working very good.You can find a tutorial here: https://medium.com/@ardianumam/installing-tensorrt-in-ubuntu-dekstop-1c7307e1dcf6
I get the same problem, but because other reason:
It is because
GLIBC
.Just to reiterate, this is a problem with tensorflow 2.1, not nightly or 2.0.
@gnthibault tensorflow and tensorflow-gpu now point to the same package as of 2.1
@behdadforghani-cbre’s solution to add --allow-downgrades , solved my issue in ubuntu 18.04
@jchwenger I installed all my environment using pip install, and when i tried to execute my program i had the same issue, so i added cudatoolkit=10.1 and cudnn=7.6.4 in my env using conda install -c anaconda cudatoolkit=10.1 cudnn=7.6.4, and it work for me.
@gunan: @behdadforghani-cbre’s solution to add
--allow-downgrades
to the last batch of installs solved the issue on two Ubuntu 18.04 machines, it might be good to add it to the install page?@Black-Behemoth Tensorflow 2.1 is no longer split into a gpu and non-gpu package
See: https://github.com/tensorflow/docs/pull/1403 . Also, still unclear why nightly is not showing this error.