0

Steps to recreate:

nvidia-docker run --rm nvcr.io/nvidia/pytorch:19.05-py3 python3 -c "import tensorrt"

Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'tensorrt'

Other potentially useful info:

nvidia-docker run --rm nvcr.io/nvidia/pytorch:19.05-py3 nvcc -V

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Thu_Apr_18_19:10:59_PDT_2019
Cuda compilation tools, release 10.1, V10.1.163

nvidia-docker run --rm nvcr.io/nvidia/pytorch:19.05-py3 nvidia-smi

Sun Jun 9 06:05:01 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.67 Driver Version: 418.67 CUDA Version: 10.1 | |-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 208... On | 00000000:01:00.0 Off | N/A |
| 0% 37C P0 65W / 260W | 105MiB / 10989MiB | 2% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce RTX 208... On | 00000000:02:00.0 Off | N/A |
| 0% 35C P8 19W / 260W | 1MiB / 10989MiB | 0% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
+-----------------------------------------------------------------------------+

I can confirm the TensorRT samples (only checked sampleMNIST) work. I installed samples via nv-tensorrt-repo-ubuntu1804-cuda10.1-trt5.1.5.0-ga-20190427_1-1_amd64.deb.

Also:

dpkg -l | grep libnvinfer

ii libnvinfer-dev 5.1.5-1+cuda10.1 amd64 TensorRT development libraries and headers

ii libnvinfer-samples 5.1.5-1+cuda10.1 all TensorRT samples and documentation

ii libnvinfer5 5.1.5-1+cuda10.1 amd64 TensorRT runtime libraries

Bilal Siddiqui
  • 349
  • 3
  • 17

1 Answers1

3

There is a separate TensorRT image that comes with the python bindings. The nvcr.io/nvidia/pytorch images don't come with TensorRT by default.

You can try the TensorRT image instead:

nvidia-docker run --rm nvcr.io/nvidia/tensorrt:19.09-py3 \
        python3 -c "import tensorrt as trt; print(trt.__version__)"
Ryan McCormick
  • 246
  • 4
  • 14
  • The images are too modular in the sense that developing often requires many different libraries. I ended up building my own container from the cuda10.0 image that nvidia provides (that or I install cuda myself too) since I needed python3.6 among other things and back then your containers were shipping with 3.5. – Bilal Siddiqui Oct 14 '19 at 19:23