Skip to content

🐛 [Bug] Does not install correctly on Ubuntu 20.04 #887

Closed

Description

@dignakov

Bug Description

After installing with pip, importing torch_tensorrt results in errors.

To Reproduce

  1. Ubuntu 20.04
  2. Proprietary Nvidia drivers from graphics ppa
  3. New virtual environment
  4. (venv) pip install torch==1.10.2+cu113 torchvision==0.11.3+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
  5. (venv) pip install torch-tensorrt -f https://github.com/NVIDIA/Torch-TensorRT/releases
  6. 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

Activity

  1. added
    bug
    on Feb 20, 2022
  2. narendasan commented on Feb 22, 2022

    @narendasan
    Collaborator

    Is TensorRT in your LD_LIBRARY_PATH?

  3. dignakov commented on Feb 22, 2022

    @dignakov
    Author

    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.

  4. ncomly-nvidia commented on Feb 22, 2022

    @ncomly-nvidia
    Contributor

    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.

  5. dignakov commented on Feb 22, 2022

    @dignakov
    Author

    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.

  6. IamExperimenting commented on Jun 19, 2022

    @IamExperimenting

    @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

  7. IamExperimenting commented on Jun 19, 2022

    @IamExperimenting

    Is TensorRT in your LD_LIBRARY_PATH?

    how do I check? or do I need to install any other dependent packages?

  8. dignakov commented on Jun 19, 2022

    @dignakov
    Author

    @IamExperimenting try these instructions to get everything to work: #1133 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions