# Error while loading shared libraries: libnvinfer.so.7: cannot open shared object file: No such file or directory

**URL:** <https://forums.developer.nvidia.com/t/error-while-loading-shared-libraries-libnvinfer-so-7-cannot-open-shared-object-file-no-such-file-or-directory/139889>\
**Category:** TensorRT\
**Created:** [July 1, 2020, 11:38am UTC](https://forums.developer.nvidia.com/t/error-while-loading-shared-libraries-libnvinfer-so-7-cannot-open-shared-object-file-no-such-file-or-directory/139889 "2020-07-01T11:38:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayckulwe](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ayckulwe](https://forums.developer.nvidia.com/u/ayckulwe)\
**Post date:** [July 1, 2020, 11:38am UTC](https://forums.developer.nvidia.com/t/error-while-loading-shared-libraries-libnvinfer-so-7-cannot-open-shared-object-file-no-such-file-or-directory/139889/1 "2020-07-01T11:38:02Z")

</div>

## Description

error while loading shared libraries: libnvinfer.so.7: cannot open shared object file: No such file or directory

This is the error I’m getting while trying to run Tensorrt sample code.  
The libraries are all mapped, which I checked using ldd command.

 ![Screenshot from 2020-07-01 17-10-45](https://global.discourse-cdn.com/nvidia/original/3X/4/c/4ca98056ca41b0ec867ef304e404652324d839c1.png)

## Environment

**TensorRT Version-7.1.3.4** :  
**GPU Type-Nvidia** :  
**Nvidia Driver Version-440.33.01** :  
**CUDA Version-10.2** :  
**CUDNN Version-8.0** :  
**Operating System + Version- Ubuntu 18.04** :  
**Python Version-3.7** :

- Full traceback of errors encountered ![Screenshot from 2020-07-01 16-46-16](https://global.discourse-cdn.com/nvidia/original/3X/a/8/a86b48c8096120e037116a3567d5435127856826.png)

---

<div class="post-metadata">

**Author:** ![AakankshaS](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aakankshas/32/14047_2.png) [@AakankshaS](https://forums.developer.nvidia.com/u/AakankshaS)\
**Post date:** [July 1, 2020, 5:31pm UTC](https://forums.developer.nvidia.com/t/error-while-loading-shared-libraries-libnvinfer-so-7-cannot-open-shared-object-file-no-such-file-or-directory/139889/2 "2020-07-01T17:31:44Z")

</div>

hi @ayckulwe,  
Request you to use [TRT NGC](https://ngc.nvidia.com/catalog/containers?orderBy=modifiedDESC&query=tens&quickFilter=containers&filters=) containers to avoid system dependencies related issues.  
Please follow the below link for reference to run the sampleOnnxMNIST.  
[https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/sampleOnnxMNIST#running-the-sample](https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/sampleOnnxMNIST#running-the-sample)

Thanks!

---

<div class="post-metadata">

**Author:** ![ayckulwe](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ayckulwe](https://forums.developer.nvidia.com/u/ayckulwe)\
**Post date:** [July 2, 2020, 6:44am UTC](https://forums.developer.nvidia.com/t/error-while-loading-shared-libraries-libnvinfer-so-7-cannot-open-shared-object-file-no-such-file-or-directory/139889/3 "2020-07-02T06:44:23Z")

</div>

Thanks for the quick reply but I realized that I was using the wrong version of cudnn which was not compatible. I was using cudnn 8.0 for cuda 11.0 instead of cuda 10.2.

---

<div class="post-metadata">

**Author:** ![erickgomvi27](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@erickgomvi27](https://forums.developer.nvidia.com/u/erickgomvi27)\
**Post date:** [January 27, 2023, 7:59am UTC](https://forums.developer.nvidia.com/t/error-while-loading-shared-libraries-libnvinfer-so-7-cannot-open-shared-object-file-no-such-file-or-directory/139889/4 "2023-01-27T07:59:13Z")

</div>

I have a similar error, the version I installed of cuda was 11.7 and cuDNN v8.7.0

 ![imagen](https://global.discourse-cdn.com/nvidia/original/3X/9/5/9514fd8ff730e2b5fbe7ea6c1113b30e49abba1c.png)
