|
1 | 1 | # Building a Torch-TensorRT container
|
2 | 2 |
|
3 |
| -* Use `Dockerfile` to build a container which provides the exact development environment that our master branch is usually tested against. |
| 3 | +* Use `Dockerfile` to build a container which provides the exact development environment that our main branch is usually tested against. |
4 | 4 |
|
5 | 5 | * The `Dockerfile` currently uses <a href="https://github.com/bazelbuild/bazelisk">Bazelisk</a> to select the Bazel version, and uses the exact library versions of Torch and CUDA listed in <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a>.
|
6 | 6 | * The desired versions of TensorRT must be specified as build-args, with major and minor versions as in: `--build-arg TENSORRT_VERSION=a.b`
|
7 |
| - * [**Optional**] The desired base image be changed by explicitly setting a base image, as in `--build-arg BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04`, though this is optional |
| 7 | + * [**Optional**] The desired base image be changed by explicitly setting a base image, as in `--build-arg BASE_IMG=nvidia/cuda:11.8.0-devel-ubuntu22.04`, though this is optional. |
8 | 8 | * [**Optional**] Additionally, the desired Python version can be changed by explicitly setting a version, as in `--build-arg PYTHON_VERSION=3.10`, though this is optional as well.
|
9 | 9 |
|
10 |
| -* This `Dockerfile` installs `pre-cxx11-abi` versions of Pytorch and builds Torch-TRT using `pre-cxx11-abi` libtorch as well. |
| 10 | +* This `Dockerfile` installs `cxx11-abi` versions of Pytorch and builds Torch-TRT using `cxx11-abi` libtorch as well. As of torch 2.7, torch requires `cxx11-abi` for all CUDA 11.8, 12.4, and 12.6. |
11 | 11 |
|
12 |
| -Note: By default the container uses the `pre-cxx11-abi` version of Torch + Torch-TRT. If you are using a workflow that requires a build of PyTorch on the CXX11 ABI (e.g. using the PyTorch NGC containers as a base image), add the Docker build argument: `--build-arg USE_CXX11_ABI=1` |
| 12 | +Note: By default the container uses the `cxx11-abi` version of Torch + Torch-TRT. If you are using a workflow that requires a build of PyTorch on the PRE CXX11 ABI, please add the Docker build argument: `--build-arg USE_PRE_CXX11_ABI=1` |
13 | 13 |
|
14 | 14 | ### Dependencies
|
15 | 15 |
|
16 | 16 | * Install nvidia-docker by following https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker
|
17 | 17 |
|
18 | 18 | ### Instructions
|
19 | 19 |
|
20 |
| -- The example below uses TensorRT 10.6.0.26 |
| 20 | +- The example below uses TensorRT 10.7.0.23 |
21 | 21 | - See <a href="https://github.com/pytorch/TensorRT#dependencies">dependencies</a> for a list of current default dependencies.
|
22 | 22 |
|
23 | 23 | > From root of Torch-TensorRT repo
|
24 | 24 |
|
25 | 25 | Build:
|
26 | 26 | ```
|
27 |
| -DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=10.6.0 -f docker/Dockerfile -t torch_tensorrt:latest . |
| 27 | +DOCKER_BUILDKIT=1 docker build --build-arg TENSORRT_VERSION=10.7.0 -f docker/Dockerfile -t torch_tensorrt:latest . |
28 | 28 | ```
|
29 | 29 |
|
30 | 30 | Run:
|
|
0 commit comments