Skip to content

Commit b4a2df0

Browse files
authored
Merge pull request #808 from NVIDIA/sven
Changed the recommended Docker environment to NGC PyTorch container
2 parents 442a953 + 8511c73 commit b4a2df0

File tree

5 files changed

+523
-407
lines changed

5 files changed

+523
-407
lines changed

notebooks/EfficientNet-example.ipynb

Lines changed: 80 additions & 98 deletions
Large diffs are not rendered by default.

notebooks/README.md

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,73 @@ First, clone the repository:
1111
git clone https://github.com/NVIDIA/Torch-TensorRT
1212
```
1313

14-
Next, build the NVIDIA Torch-TensorRT container (from repo root):
14+
Next, navigate to the repo's root directory:
1515

1616
```
1717
cd Torch-TensorRT
18+
```
19+
20+
### a. Using the NGC PyTorch container
21+
22+
At this point, we recommend pulling the [PyTorch container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch)
23+
from [NVIDIA GPU Cloud](https://catalog.ngc.nvidia.com/) as follows:
24+
25+
```
26+
docker pull nvcr.io/nvidia/pytorch:21.12-py3
27+
```
28+
29+
Replace ```21.12``` with a different string in the form ```yy.mm```,
30+
where ```yy``` indicates the last two numbers of a calendar year, and
31+
```mm``` indicates the month in two-digit numerical form, if you wish
32+
to pull a different version of the container.
33+
34+
The NGC PyTorch container ships with the Torch-TensorRT tutorial notebooks.
35+
Therefore, you can run the container and the notebooks therein without
36+
mounting the repo to the container. To do so, run
37+
38+
```
39+
docker run --gpus=all --rm -it --net=host --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 nvcr.io/nvidia/pytorch:21.12-py3 bash
40+
```
41+
42+
If, however, you wish for your work in the notebooks to persist, use the
43+
```-v``` flag to mount the repo to the container as follows:
44+
45+
```
46+
docker run --gpus=all --rm -it -v $PWD:/Torch-TensorRT --net=host --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 nvcr.io/nvidia/pytorch:21.12-py3 bash
47+
```
48+
49+
### b. Building a Torch-TensorRT container from source
50+
51+
Alternatively, to build the container from source, run
52+
53+
```
1854
docker build -t torch_tensorrt -f ./docker/Dockerfile .
1955
```
2056

21-
Then launch the container with:
57+
To run this container, enter the following command:
58+
59+
```
60+
docker run --gpus=all --rm -it -v $PWD:/Torch-TensorRT --net=host --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 torch_tensorrt:latest bash
61+
```
62+
63+
### c. Running the notebooks inside the container
64+
65+
Within the docker interactive bash session, proceed to the notebooks.
66+
To use the notebooks which ship with the container, run
2267

2368
```
24-
docker run --gpus=all --rm -it -v $PWD:/Torch-TensorRT --net=host --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 torch_tensorrt bash
69+
cd /workspace/examples/torch_tensorrt/notebooks
2570
```
2671

27-
Within the docker interactive bash session, start Jupyter with
72+
If, however, you mounted the repo to the container, run
2873

2974
```
3075
cd /Torch-TensorRT/notebooks
76+
```
77+
78+
Once you have entered the appropriate ```notebooks``` directory, start Jupyter with
79+
80+
```
3181
jupyter notebook --allow-root --ip 0.0.0.0 --port 8888
3282
```
3383

0 commit comments

Comments
 (0)