HI, After i ran docker L4t-tensorrt:r8.2.1-runtime & then tried importing tensorrt , Getting this error :
Python 3.8.0 (default, Dec 9 2021, 17:53:27)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorrt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/tensorrt/__init__.py", line 67, in <module>
from .tensorrt import *
ImportError: libnvmedia.so: cannot open shared object file: No such file or directory
docker default runtime is nvidia. So i didn’t mentioned it in the command.
Same error even with runtime sent to nvidia
root@core-io:/data/home/spot/Desktop# docker run -it --runtime nvidia --network host nvcr.io/nvidia/l4t-tensorrt:r8.2.1-runtime bash
root@core-io:/# python3
Python 3.8.0 (default, Dec 9 2021, 17:53:27)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorrt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/tensorrt/__init__.py", line 67, in <module>
from .tensorrt import *
ImportError: libnvmedia.so: cannot open shared object file: No such file or directory
>>>
Just realized that you are on TX1 - if you have JetPack 4.6, then you can use nvcr.io/nvidia/l4t-tensorrt:r8.0.1-runtime
Otherwise, the newer l4t-tensorrt containers are for JetPack 5.x. But on JetPack 4.x, you can just use l4t-base and that will already include TensorRT (as long as --runtime nvidia is used)
Fixed the issue : Installed nvidia-l4t-core nvidia-l4t-multimedia packages on the host system & then ran tensorrt on the docker & it worked. @dusty_nv : thanks for the Help…
OK yes, on JetPack 4.x you need the CUDA/cuDNN/TensorRT packages to be installed on the host in order for them to get automatically mounted into the container. On JetPack 5.x, CUDA/cuDNN/TensorRT are installed inside the containers themselves. Regardless, glad that you got it working!