googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.2k stars 722 forks source link

Feature request: To have TensorRT preinstalled in Google Colab. #1844

Open sebastian-sz opened 3 years ago

sebastian-sz commented 3 years ago

Feature request

Given we can have CUDA and cuDNN, it would be amazing to have TensorRT preinstalled in Google Colab. Link

Describe the current behavior:

Currently, tensorRT is unavailble in Colab:

import tensorrt as trt

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-9-0a87b2689341> in <module>()
----> 1 import tensorrt as trt

ModuleNotFoundError: No module named 'tensorrt'

in order for the above to work, one needs to undergo a tedious, and rather long process of manually installing tensorRT in Colab, which not only wastes developer time but also wastes GPU time (GPU is necessary for tensorRT installation to work).

Describe the expected behavior:

It would be amazing if tensorRT came preinstalled by default, and we could straight away do:

import tensorrt as trt

I wouldn't mind this beeing only-pro or only-gpu option.

The web browser you are using (Chrome, Firefox, Safari, etc.):

Google Chrome.

Link (not screenshot!) to a minimal, public, self-contained notebook that

reproduces this issue (click the Share button, then Get Shareable Link): N/A

rafaelbate commented 3 years ago

Feature request

Given we can have CUDA and cuDNN, it would be amazing to have TensorRT preinstalled in Google Colab. Link

Describe the current behavior:

Currently, tensorRT is unavailble in Colab:

import tensorrt as trt

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-9-0a87b2689341> in <module>()
----> 1 import tensorrt as trt

ModuleNotFoundError: No module named 'tensorrt'

in order for the above to work, one needs to undergo a tedious, and rather long process of manually installing tensorRT in Colab, which not only wastes developer time but also wastes GPU time (GPU is necessary for tensorRT installation to work).

Describe the expected behavior:

It would be amazing if tensorRT came preinstalled by default, and we could straight away do:

import tensorrt as trt

I wouldn't mind this beeing only-pro or only-gpu option.

The web browser you are using (Chrome, Firefox, Safari, etc.):

Google Chrome.

Link (not screenshot!) to a minimal, public, self-contained notebook that

reproduces this issue (click the Share button, then Get Shareable Link): N/A

Hello @sebastian-sz, you are absolutely right ... I've been trying to install this and still can't import tensorrt as trt correctly, always giving me some type of error ... Have you found a way to correctly import this? Thank you

sebastian-sz commented 3 years ago

@rafaelbate I used to do this very ugly and hacky approach (hence this Feature Request), where I copied the .deb file into Colab and installed necessary packages via apt-get. This approach doesn't work anymore.

cvpfus commented 3 years ago

yes i really need this feature please

craigcitro commented 3 years ago

Did anyone try the upstream instructions (https://docs.nvidia.com/deeplearning/tensorrt/quick-start-guide/index.html#install)? Where did things go wrong?

styler00dollar commented 2 years ago

I approve of the suggestion. I tried to install TensorRT myself for a few days, but I seemingly am not able to install it correctly and I have no idea why. I tried multiple version, I recompiled various things, but I see warnings.

[01/30/2022-18:13:44] [TRT] [W] TensorRT was linked against cuDNN 8.2.1 but loaded cuDNN 8.0.5

The furthest I got was to being able to run code with warning messages, but I want to run code without getting warning messages. Most likely due to piping of data into ffmpeg, my code does not work if any text gets printed. It would be nice if properly installed TensorRT would be available by default.

RolandSall commented 2 years ago

Is there any update regarding this issue?

sebastian-sz commented 2 years ago

If you're struggling with this - Nvidia recently made it possible to install in Colab via pip (this takes couple of minutes though).

!pip install --upgrade --index-url https://pypi.ngc.nvidia.com nvidia-tensorrt

And in Colab:

import tensorrt as trt

trt.__version__
# 8.4.0.6