Skip to content

Commit d86a321

Browse files
authored
Merge pull request #265 from tokk-nv/dev-docker-guide
Add oneline for modifying daemon.json
2 parents 8447538 + 24a3c7e commit d86a321

File tree

1 file changed

+46
-35
lines changed

1 file changed

+46
-35
lines changed

docs/tips_ssd-docker.md

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Tips - SSD + Docker
22

3-
Once you have your Jetson set up by flashing the latest Jetson Linux (L4T) BSP on it or by flashing the SD card with the whole JetPack image, before embarking on testing out all the great generative AI application using `jetson-containers`, you want to make sure you have a huge storage space for all the containers and the models you will download.
3+
Once you have your Jetson set up by flashing the latest Jetson Linux (L4T) BSP on it or by flashing the SD card with the whole JetPack image, before embarking on testing out all the great generative AI application using `jetson-containers`, you want to make sure you have a huge storage space for all the containers and the models you will download.
44

55
We are going to show how you can install SSD on your Jetson, and set it up for Docker.
66

@@ -35,27 +35,27 @@ We are going to show how you can install SSD on your Jetson, and set it up for D
3535

3636
```log
3737
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
38-
loop0 7:0 0 16M 1 loop
39-
mmcblk1 179:0 0 59.5G 0 disk
38+
loop0 7:0 0 16M 1 loop
39+
mmcblk1 179:0 0 59.5G 0 disk
4040
├─mmcblk1p1 179:1 0 58G 0 part /
41-
├─mmcblk1p2 179:2 0 128M 0 part
42-
├─mmcblk1p3 179:3 0 768K 0 part
43-
├─mmcblk1p4 179:4 0 31.6M 0 part
44-
├─mmcblk1p5 179:5 0 128M 0 part
45-
├─mmcblk1p6 179:6 0 768K 0 part
46-
├─mmcblk1p7 179:7 0 31.6M 0 part
47-
├─mmcblk1p8 179:8 0 80M 0 part
48-
├─mmcblk1p9 179:9 0 512K 0 part
49-
├─mmcblk1p10 179:10 0 64M 0 part
50-
├─mmcblk1p11 179:11 0 80M 0 part
51-
├─mmcblk1p12 179:12 0 512K 0 part
52-
├─mmcblk1p13 179:13 0 64M 0 part
53-
└─mmcblk1p14 179:14 0 879.5M 0 part
41+
├─mmcblk1p2 179:2 0 128M 0 part
42+
├─mmcblk1p3 179:3 0 768K 0 part
43+
├─mmcblk1p4 179:4 0 31.6M 0 part
44+
├─mmcblk1p5 179:5 0 128M 0 part
45+
├─mmcblk1p6 179:6 0 768K 0 part
46+
├─mmcblk1p7 179:7 0 31.6M 0 part
47+
├─mmcblk1p8 179:8 0 80M 0 part
48+
├─mmcblk1p9 179:9 0 512K 0 part
49+
├─mmcblk1p10 179:10 0 64M 0 part
50+
├─mmcblk1p11 179:11 0 80M 0 part
51+
├─mmcblk1p12 179:12 0 512K 0 part
52+
├─mmcblk1p13 179:13 0 64M 0 part
53+
└─mmcblk1p14 179:14 0 879.5M 0 part
5454
zram0 251:0 0 1.8G 0 disk [SWAP]
5555
zram1 251:1 0 1.8G 0 disk [SWAP]
5656
zram2 251:2 0 1.8G 0 disk [SWAP]
5757
zram3 251:3 0 1.8G 0 disk [SWAP]
58-
nvme0n1 259:0 0 238.5G 0 disk
58+
nvme0n1 259:0 0 238.5G 0 disk
5959
```
6060

6161
Identify the device corresponding to your SSD. In this case, it is `nvme0n1`.
@@ -66,7 +66,7 @@ We are going to show how you can install SSD on your Jetson, and set it up for D
6666
sudo mkfs.ext4 /dev/nvme0n1
6767
```
6868

69-
> You can choose any name for the mount point directory. We use `/ssd` here, but in `jetson-containers`' [setup.md](https://github.com/dusty-nv/jetson-containers/blob/master/docs/setup.md) documentation, `/mnt` is used.
69+
> You can choose any name for the mount point directory. We use `/ssd` here, but in `jetson-containers`' [setup.md](https://github.com/dusty-nv/jetson-containers/blob/master/docs/setup.md) documentation, `/mnt` is used.
7070
7171
```bash
7272
sudo mkdir /ssd
@@ -138,23 +138,34 @@ We are going to show how you can install SSD on your Jetson, and set it up for D
138138

139139
3. Add default runtime in `/etc/docker/daemon.json`
140140

141-
```bash
142-
sudo vi /etc/docker/daemon.json
143-
```
141+
=== "One-liner"
144142

145-
Insert the `"default-runtime": "nvidia"` line as following:
143+
```bash
144+
sudo apt install -y jq
145+
jq '. + {"default-runtime": "nvidia"}' /etc/docker/daemon.json | sudo tee /etc/docker/daemon.json > /dev/null
146+
```
146147

147-
```json
148-
{
149-
"runtimes": {
150-
"nvidia": {
151-
"path": "nvidia-container-runtime",
152-
"runtimeArgs": []
153-
}
154-
},
155-
"default-runtime": "nvidia"
156-
}
157-
```
148+
=== "Manual"
149+
150+
Use your editor to open the following JSON file.
151+
152+
```bash
153+
sudo vi /etc/docker/daemon.json
154+
```
155+
156+
Insert the `"default-runtime": "nvidia"` line as following:
157+
158+
```json
159+
{
160+
"runtimes": {
161+
"nvidia": {
162+
"path": "nvidia-container-runtime",
163+
"runtimeArgs": []
164+
}
165+
},
166+
"default-runtime": "nvidia"
167+
}
168+
```
158169

159170
4. Restart Docker
160171

@@ -178,7 +189,7 @@ Now that the SSD is installed and available on your device, you can use the extr
178189
sudo du -csh /var/lib/docker/ && \
179190
sudo mkdir /ssd/docker && \
180191
sudo rsync -axPS /var/lib/docker/ /ssd/docker/ && \
181-
sudo du -csh /ssd/docker/
192+
sudo du -csh /ssd/docker/
182193
```
183194

184195
3. Edit `/etc/docker/daemon.json`
@@ -221,7 +232,7 @@ Now that the SSD is installed and available on your device, you can use the extr
221232
1. \[Terminal 1\] First, open a terminal to monitor the disk usage while pulling a Docker image.
222233

223234
```bash
224-
watch -n1 df
235+
watch -n1 df
225236
```
226237

227238
2. \[Terminal 2\] Next, open a new terminal and start Docker pull.

0 commit comments

Comments
 (0)