Repository navigation
Closed
Labels
bugSomething isn't working
Description
Bug Description
After installing with pip, importing torch_tensorrt results in errors.
To Reproduce
- Ubuntu 20.04
- Proprietary Nvidia drivers from graphics ppa
- New virtual environment
- (venv)
pip install torch==1.10.2+cu113 torchvision==0.11.3+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html - (venv) pip install torch-tensorrt -f
https://github.com/NVIDIA/Torch-TensorRT/releases - import torch_tensorrt
import torch_tensorrt
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Input In [46], in <module>
----> 1 import torch_tensorrt
File ~/.virtualenvs/devel/lib/python3.8/site-packages/torch_tensorrt/__init__.py:11, in <module>
8 import torch
10 from torch_tensorrt._version import __version__
---> 11 from torch_tensorrt._compile import *
12 from torch_tensorrt._util import *
13 from torch_tensorrt import ts
File ~/.virtualenvs/devel/lib/python3.8/site-packages/torch_tensorrt/_compile.py:2, in <module>
1 from typing import List, Dict, Any
----> 2 from torch_tensorrt import _enums
3 import torch_tensorrt.ts
4 from torch_tensorrt import logging
File ~/.virtualenvs/devel/lib/python3.8/site-packages/torch_tensorrt/_enums.py:1, in <module>
----> 1 from torch_tensorrt._C import dtype, DeviceType, EngineCapability, TensorFormat
ImportError: libnvinfer_plugin.so.8: cannot open shared object file: No such file or directory
Environment
Build information about Torch-TensorRT can be found by turning on debug messages
- Torch-TensorRT Version: current release as of 2022-02-19
- PyTorch Version: 1.10.2
- CPU Architecture: x86_64
- OS (e.g., Linux): Ubuntu 20.04
- How you installed PyTorch (
conda,pip,libtorch, source): - (venv) pip install torch==1.10.2+cu113 torchvision==0.11.3+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
- Python version: 3.8.10
- CUDA version: comes with pytorch (11.3)
- GPU models and configuration: rtx 3050
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
narendasan commentedon Feb 22, 2022
Is TensorRT in your LD_LIBRARY_PATH?
dignakov commentedon Feb 22, 2022
Sorry, I ended up getting it to work. It looks like I needed TensorRT installed separately.
From the instructions it seemed (to me) like all of the dependencies would come with the wheel.
Would it be possible in the future to package TensorRT and all the deps together with the wheel? It would make working with this a lot easier I think.
ncomly-nvidia commentedon Feb 22, 2022
You can use the PyTorch NGC Container which already has all dependencies together. If you need master of Torch-TRT, you'll either have to build it yourself (with dependencies) or wait until the relevant change is in NGC: end of the next month on average.
dignakov commentedon Feb 22, 2022
Thanks @ncomly-nvidia. I had the same idea when I first started. But then ran into a decent amount of difficulty getting ROS working inside the container. With the default python being conda, and ROS installing everything into system python packages couldn't find each other.
I'm planning to give it another try when I've got some time to compile ROS from source in the container.
I'm actually not necessarily looking for the master of Torch-TRT. I'm just trying to find a way to get up and running quickly. So being able to just install the wheel (like what PyTorch does), would be amazing. I get that it's a probably a lot of work though.
IamExperimenting commentedon Jun 19, 2022
@ncomly-nvidia @narendasan, I'm facing the same issue,
I'm using Python 3.7.13 ubnutu 20.04 ,GPU RTX2060, CUDA: 11.3.1
IamExperimenting commentedon Jun 19, 2022
how do I check? or do I need to install any other dependent packages?
dignakov commentedon Jun 19, 2022
@IamExperimenting try these instructions to get everything to work: #1133 (comment)