Lesson 01: Setting Up SSD for Docker on Jetson
SSD Installation
- Physical Installation:
- Power off the Jetson and remove the peripherals.
- Install the NVMe SSD card on the carrier board and secure it.
- Reconnect peripherals and power up the Jetson.
- Verify the SSD installation with lspci command. The output should look like the following:
0007:01:00.0 Non-Volatile memory controller: Marvell Technology Group Ltd. Device 1322 (rev 02)
- Format SSD and Create a Mount Point
- Find the SSD device name using lsblk command.
The output should look like the following:
In this case, the SSD name is nvme0n1. - Format the SSD:
- Create and mount the directory:
- Find the SSD device name using lsblk command.
- Auto-Mount after boot
Add the SSD to fstab to ensure it auto-mounts on boot.- First, identify the UUID for your SSD:
- Then, add a new entry to the fstab file:
- Insert the following line, replacing the UUID with the value found from lsblk -f:
UUID=************-****-****-****-******** /ssd/ ext4 defaults 0 2
- First, identify the UUID for your SSD:
- Finally, change the ownership of the /ssd directory.
Docker Configuration
- Install Docker:
If you used an NVIDIA-supplied SD card image to flash your SD card, all necessary JetPack components (including nvidia-containers) and Docker are already pre-installed so that step 1 can be skipped.- Update and install necessary packages:
- Update and install necessary packages:
- Adding User to Docker Group:
As Ubuntu users are not in the docker group by default, they must run docker commands with sudo (the build tools automatically do this when needed). Hence, you could be periodically asked for your sudo password during builds. Instead, you can add your user to the docker group like below:
Restart Docker and add your user to the docker group so you do not need to use the command with sudo - Docker Default Runtime:
If you are building containers, you need to set Docker's default-runtime to nvidia, so that the NVCC compiler and GPU are available during docker build operations. Add "default-runtime": "nvidia" to your /etc/docker/daemon.json configuration file before attempting to build the containers:
Insert the "default-runtime": "nvidia" line as follows:
- Restart Docker
Then restart the Docker service (or reboot your system before proceeding).
- You can then confirm the changes by looking under docker info
Migrate the Docker directory to SSD
- Stop the Docker service:
- Move the existing Docker directory to SSD:
- Edit /etc/docker/daemon.json:
Insert "data-root" line like the following.
- Rename the old Docker directory and restart the service:
- Restart the docker daemon
- You can then confirm the changes by looking under docker info That directory will also now have had it is permissions changed to root-access only by the Docker daemon.
Test Docker on SSD
- [Terminal 1] First, open a terminal to monitor the disk usage while pulling a Docker image.
- [Terminal 2] Next, open a new terminal and start Docker pull.
- [Terminal 1] Observe that the disk usage on /ssd goes up as the container image is downloaded and extracted.
Final Verification
Reboot your Jetson, and verify that you observe the following:
Your Jetson is now set up with the SSD!