Skip to content

Commit 9cf7b34

Browse files
committed
Augmented the notebook README file
Added instructions to help users choose from the following 3 options: 1. Run the notebooks as provided in the NGC PyTorch container 2. Mount the repo to the NGC PyTorch container, then run the repo notebooks 3. Build the container from source, mount the repo to that container, then run the repo notebooks Signed-off-by: Sven Chilton <[email protected]>
1 parent c50fd52 commit 9cf7b34

File tree

1 file changed

+47
-2
lines changed

1 file changed

+47
-2
lines changed

notebooks/README.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,61 @@ Next, navigate to the repo's root directory:
1717
cd Torch-TensorRT
1818
```
1919

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

2249
```
2350
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
2451
```
2552

26-
Within the docker interactive bash session, start Jupyter with
53+
If you're using a container built from source, run this instead:
54+
55+
```
56+
docker run --gpus=all --rm -it -v $PWD:/Torch-TensorRT --net=host --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 torch_tensorrt:latest bash
57+
```
58+
59+
Within the docker interactive bash session, proceed to the notebooks.
60+
To use the notebooks which ship with the container, run
61+
62+
```
63+
cd /workspace/examples/torch_tensorrt/notebooks
64+
```
65+
66+
If, however, you mounted the repo to the container, run
2767

2868
```
2969
cd /Torch-TensorRT/notebooks
70+
```
71+
72+
Once you have entered the appropriate ```notebooks``` directory, start Jupyter with
73+
74+
```
3075
jupyter notebook --allow-root --ip 0.0.0.0 --port 8888
3176
```
3277

0 commit comments

Comments
 (0)