Skip to content

Commit 2b00687

Browse files
initial nvidia jetpack building LP checkin
1 parent 215fd10 commit 2b00687

17 files changed

Lines changed: 417 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Build Nvidia Jetpack Yocto Images for Nvidia Orin NX/Orin Nano/Thor platforms
3+
minutes_to_complete: 180
4+
5+
description: Learn how to utilize the new yocto support in Nvidia Jetpack to build a custom linux image for the Jetson Orin NX, Orin Nano, and Thor platforms.
6+
7+
who_is_this_for: This is a moderately advanced topic for engineers who want to construct a highly customizable Jetpack image for the Jetson platforms via Yocto build processes.
8+
9+
learning_objectives:
10+
- Learn about the Yocto custom linux distro creation process and platform
11+
- Utilize scripting to initiate a Yocto build for a give targeted Jetson platform
12+
- Flash and run the custom build on the Jetson platform
13+
14+
15+
prerequisites:
16+
- Experience using Linux on embedded or SBC platforms
17+
- Experience with the Yocto build system
18+
- Experience with Nvidia Jetpack and the Jetson platforms (Orin NX, Orin Nano, and Thor)
19+
20+
author: Doug Anson
21+
22+
### Tags
23+
skilllevels: Advanced
24+
subjects: Jetpack Yocto
25+
26+
cloud_service_providers:
27+
- AWS
28+
29+
armips:
30+
- Neoverse
31+
32+
operatingsystems:
33+
- Linux
34+
35+
shared_path: true
36+
shared_between:
37+
- embedded-and-microcontrollers
38+
- automotive
39+
40+
further_reading:
41+
- resource:
42+
title: OE4T
43+
link: https://oe4t.github.io/master/
44+
type: website
45+
46+
47+
### FIXED, DO NOT MODIFY
48+
# ================================================================================
49+
weight: 1 # _index.md always has weight of 1 to order correctly
50+
layout: "learningpathall" # All files under learning paths have this same wrapper
51+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
52+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: Creating Nvidia Jetpack images with Yocto
3+
4+
weight: 2
5+
6+
layout: "learningpathall"
7+
---
8+
9+
## Introduction to Yocto
10+
11+
The Yocto Project is an open-source collaboration project that provides tools, templates, and processes for creating custom Linux-based systems for embedded products. Rather than being a Linux distribution itself, Yocto gives developers the build framework needed to create a purpose-built Linux distribution tailored to specific hardware, application, security, performance, and lifecycle requirements. It is widely used in embedded systems because it enables reproducible builds, fine-grained image customization, cross-compilation, software package control, and long-term maintainability across different hardware architectures. (The Yocto Project)
12+
13+
At the center of Yocto is the OpenEmbedded build system, which uses BitBake as its task executor. BitBake processes metadata, recipes, configuration files, and layers to fetch source code, apply patches, compile software, package outputs, and assemble bootable Linux images. Yocto’s reference distribution, Poky, provides a working baseline that developers can extend with board support packages, middleware, applications, and product-specific configuration. This layered model is one of Yocto’s main strengths: hardware support, vendor software, open-source packages, and product customizations can be separated cleanly, making the final image easier to maintain and reproduce.
14+
15+
Yocto is especially valuable when a project needs more control than a general-purpose Linux distribution provides. Instead of starting with a full desktop or server operating system and removing unnecessary components, Yocto allows developers to build only what is needed. This can reduce image size, improve boot time, simplify updates, reduce attack surface, and make regulatory or production requirements easier to manage. For embedded AI, robotics, industrial systems, and edge devices, this level of control is often essential.
16+
17+
## Overview of Using Yocto to Build NVIDIA JetPack Images
18+
19+
NVIDIA JetPack is the software stack used on NVIDIA Jetson platforms. It includes Jetson Linux, which provides the board support package, bootloader, Linux kernel, NVIDIA drivers, toolchain, and related platform components, along with accelerated AI and compute libraries such as CUDA, TensorRT, cuDNN, VPI, and other Jetson-specific software. (NVIDIA Developer)
20+
21+
Traditionally, JetPack images are based on NVIDIA’s Ubuntu-based Jetson Linux distribution. However, Yocto can be used to build custom Jetson images that include Jetson Linux and JetPack components while giving developers much greater control over the final root filesystem, packages, services, security configuration, and product-specific software. NVIDIA now documents a Yocto-based path for Jetson platforms, including guidance for selecting machines, building images, flashing devices, and customizing images for production use. (NVIDIA Docs)
22+
23+
The primary Yocto layer used for NVIDIA Jetson support is meta-tegra, maintained under the OpenEmbedded for Tegra, or OE4T, project. This layer integrates NVIDIA Jetson Linux/L4T and JetPack components into the Yocto/OpenEmbedded build system so developers can create custom Linux images for Jetson-based products. (GitHub)
24+
25+
A typical Yocto-based JetPack workflow includes the following steps:
26+
27+
1. Select the Jetson hardware and JetPack/L4T release
28+
The first step is to identify the target Jetson module or developer kit, such as Jetson Orin, Jetson AGX Orin, Jetson Orin Nano, or Jetson Thor, and then choose the matching JetPack and Jetson Linux release. NVIDIA’s current JetPack download notes identify JetPack 7.2 with Jetson Linux 39.2 as a current release and include Yocto-related quick-start material for supported developer kits. (NVIDIA Developer)
29+
2. Set up the Yocto build environment
30+
The build host is prepared with the required Linux packages, source directories, and Yocto build tools. Developers typically start from Poky or an OE4T-supported manifest, then add the required layers, including OpenEmbedded Core, meta-openembedded, and meta-tegra.
31+
3. Choose the correct machine configuration
32+
Yocto builds are driven by a MACHINE setting that identifies the target board. For Jetson platforms, the selected machine configuration determines the kernel, bootloader integration, device tree, firmware, GPU driver components, flashing artifacts, and board-specific image outputs.
33+
4. Configure the image
34+
Developers then decide what should be included in the image. This may include core Linux utilities, networking, SSH, container runtime support, CUDA libraries, TensorRT, multimedia components, robotics middleware, AI applications, security tools, update agents, and custom services. Yocto image recipes and package groups make it possible to define minimal, development, or production image variants.
35+
5. Build the image with BitBake
36+
BitBake processes the selected image recipe and all of its dependencies. It downloads sources, applies patches, cross-compiles packages, assembles the root filesystem, and generates deployable artifacts. For Jetson targets, the output typically includes the root filesystem and supporting boot or flashing files needed to install the image onto the device.
37+
6. Flash the Jetson device
38+
After the build completes, the generated image is flashed to the Jetson module or developer kit. NVIDIA’s Yocto documentation and quick-start materials describe flashing flows for supported Jetson hardware, including prebuilt Yocto images for some JetPack releases and developer kits. (NVIDIA Docs)
39+
7. Customize and productize
40+
Once the image boots, teams usually iterate on kernel configuration, device trees, drivers, system services, application packages, security policies, boot behavior, update strategy, and performance tuning. The Yocto layer model allows these changes to be captured in custom layers instead of being manually applied to a running target, which improves repeatability and makes production releases easier to audit.
41+
42+
Using Yocto for JetPack images is especially useful for production Jetson deployments. It allows a team to move from a general developer-focused JetPack environment to a controlled product image with only the required packages and services. This can improve boot time, reduce storage usage, simplify compliance review, support reproducible builds, and make over-the-air update strategies more manageable.
43+
44+
The main tradeoff is complexity. Yocto has a steep learning curve, and building Jetson images requires understanding both Yocto concepts and NVIDIA’s Jetson software stack. Developers need to manage layer compatibility, JetPack/L4T version alignment, machine configuration, license handling, proprietary NVIDIA components, and flashing workflows. For early prototyping, NVIDIA’s standard JetPack flow may be faster. For production systems, however, Yocto provides a stronger foundation for controlled, repeatable, and highly customized Jetson Linux images.
45+
46+
In summary, Yocto gives embedded developers a powerful framework for creating custom Linux distributions, while NVIDIA’s Jetson Linux, JetPack, and meta-tegra integration make it possible to bring that same level of control to Jetson-based AI and edge-computing systems. The result is a flexible path from prototype to production: developers can use NVIDIA’s accelerated software stack while still owning the structure, contents, and lifecycle of the final embedded Linux image.
47+
48+
## What you've learned and what's next
49+
50+
You have learned about the yocto build system for creating custom linux distributions and how Nvidia makes use of yocto to create custom Jetpack images for its current Jetson platforms.
51+
52+
Next, lets initiate a Google Cloud C4A Axion instance and start our own yocto build!
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: Yocto image build on Arm for Nvidia Jetson
3+
weight: 4
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Overview
10+
11+
In this section, the configured C4A instance will now get further configured to execute a yocto build process to produce a custom linux distribution image for a given Nvidia Jetson platform.
12+
13+
## Initial Setup
14+
15+
Within the SSH shell to your C4A instance, clone this repo:
16+
17+
```bash
18+
cd $HOME
19+
git clone https://github.com/DougAnsonAustinTx/jetpack-yocto-builder
20+
```
21+
22+
## Invoke the build
23+
24+
After cloning the above repo, lets explore the repo contents:
25+
26+
```bash
27+
cd $HOME/jetpack-yocto-builder
28+
chmod 755 *.sh
29+
ls
30+
```
31+
32+
These scripts support building a yocto image for Jetson Thor, Jetson Orin NX, and Jetson Orin Nano/Super Nano:
33+
34+
./build-thor.sh: The build script for Nvidia Jetson Thor
35+
./build-orinnx.sh: The build script for Nvidia Jetson Orin NX
36+
./build-orin-super-nano.sh: The build script for Nvidia Jetson Orin Nano and Super Nano
37+
./build-all.sh: Builds all 3 platforms as 3 independent builds
38+
39+
The primary "build" script is: ./build_oe4t_jetson_multi_platform.sh.
40+
41+
A single argument, "--bundle" is available to collect up into an archive file all of the required contents needed to flash the device later.
42+
43+
Lets initiate the build for the Jetson Thor:
44+
45+
```bash
46+
cd $HOME/jetpack-yocto-builder
47+
./build-thor.sh --bundle 2>&1 1>$HOME/build.log &
48+
```
49+
50+
The script will first install all of the necessary pre-requisites needed for yocto builds
51+
52+
{{% notice Note %}}
53+
You may be prompted initially to restart things during the initial prerequisite installation process... just press "tab" and "Ok" for any of them that are presented.
54+
{{% /notice %}}
55+
56+
Eventually the core "yocto" build process (via Yocto "bitbake") will start:
57+
58+
![Yocto "bitbake" build processor working highlighted#center](images/yocto-build.png "Yocto bitbake creating the Nvidia Thor yocto image")
59+
60+
This script will continue building until the yocto image for Thor is ready.
61+
62+
{{% notice Note %}}
63+
This invocation will take a few hours to complete (sometimes more than 3 hours in fact).
64+
{{% /notice %}}
65+
66+
## Yocto build process - some caveats
67+
68+
#### Building Yocto images takes time
69+
70+
The yocto build process constructs an entire linux distribution by pulling down source code from numerous repos and configuring, compiling, and installing thousands of applications. This takes some time.
71+
72+
{{% notice Note %}}
73+
This invocation will take a few hours to complete (sometimes more than 3 hours.... please be patient).
74+
{{% /notice %}}
75+
76+
#### Yocto builds can occasionally fail
77+
78+
While alternate source code mirrors are checked if needed, occasionally a given source code package is simply not downloadable at a given point in time. This will cause the yocto build process to fail.
79+
80+
{{% notice Note %}}
81+
If the script detects failure, just re-run the script... to ensure the greatest "repeatable" outcome, "re-builds" with this script start from scratch... not from their last build point.
82+
{{% /notice %}}
83+
84+
## Examining the built result
85+
86+
Once the Yocto build is complete, depending on which platform you built (Orin Super Nano, Orin NX, Thor), you should see something similar to this:
87+
88+
![Completed yocto build with bundled package created instance#center](images/completed-build.png "Completed yocto build with bundled result artifact file")
89+
90+
With the "--bundle" option having been supplied to the build script, the following file (again, depending onthe specific platform you compiled for...) is the primary file that will be used to flash our Nvidia device:
91+
92+
![Yocto build result file instance#center](images/created-image.png "Yocto build result file")
93+
94+
Please record the full path of the this file as the file will need to be downloaded in order to be flashed.
95+
96+
## What we learned
97+
98+
In this section, we configured and built out our yocto-based custom linux distribution for a selected Nvidia Jetson platform.
99+
100+
Next, lets flash the created image onto our Nvidia Jetson platform and run the image.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: Flashing the Yocto image onto Nvidia Jetson
3+
weight: 5
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Overview
10+
11+
In this section, we'll prepare a local linux host, running Ubuntu 22.04 or greater, download the completed yocto build artifact file, and use the Nvidia supplied instructions for flashing our Nvidia Jetson device with the newly created yocto image.
12+
13+
### Prepare a local ubuntu host
14+
15+
Ubuntu will be used locally to connect to and flash the Nvidia Jetson device. Ubuntu 22.04 or later is recommended. The following pre-requisites should also be installed:
16+
17+
```bash
18+
sudo apt update
19+
sudo apt upgrade
20+
sudo apt install -y dtc build-essential gdisk gptfdisk udisks2 bmap-tools libxml2-utils
21+
sudo apt-get install -y zstd tar usbutils
22+
```
23+
24+
### Install the Google Cloud SDK
25+
26+
Please following the instructions here: https://docs.cloud.google.com/sdk/docs/install-sdk to install the google cloud SDK on your local Ubuntu host.
27+
28+
Once installed, you must first login in with the SDK CLI:
29+
30+
```bash
31+
gcloud auth login
32+
```
33+
34+
From your localh ubuntu host, you can confirm that SSH works by logging into your C4A cloud instance:
35+
36+
From your Google cloud console, please note down:
37+
38+
- your C4A instance name
39+
- your Google Cloud project name
40+
- the zone your C4A instance is currently executing in
41+
42+
Once these are acquired, you can log into your C4A instance via SSH in the google cloud SDK CLI:
43+
44+
```bash
45+
gcloud compute ssh C4A_INSTANCE_NAME --project GOOGLE_CLOUD_PROJECT_NAME --ssh-flag="-o ServerAliveInterval=60 -o ServerAliveCountMax=9999" --zone=C4A_CURRENT_ZONE
46+
```
47+
48+
### Download the completed Yocto build artifacts
49+
50+
Once confirmed that SSH works above, with the SSH session above, note the location of your bundled artifact file... it should be in $HOME/jetpack-yocto-builder within the C4A instance.
51+
52+
In the SSH shell to your C4A host:
53+
54+
```bash
55+
cd $HOME/jetpack-yocto-builder
56+
ls -al *.tar.gz
57+
pwd
58+
```
59+
60+
Back on your local Ubuntu host, type:
61+
62+
```bash
63+
mkdir $HOME/flashing
64+
cd $HOME/flashing
65+
gcloud compute scp C4A_INSTANCE_NAME:~/jetpack-yocto-builder/demo*tar.gz ./yocto_image.tar.gz --project GOOGLE_CLOUD_PROJECT_NAME --zone=C4A_CURRENT_ZONE
66+
```
67+
68+
You should now see a 3-4GB file on your local Ubuntu host:
69+
70+
```bash
71+
cd $HOME/flashing
72+
ls -al yocto_image.tar.gz
73+
```
74+
75+
Next, extract the contents of this file to acquire the "zst" file (which will be used for flashing):
76+
77+
```bash
78+
cd $HOME/flashing
79+
tar xzpf yocto_image.tar.gz
80+
mkdir $HOME/flashing/image
81+
cd $HOME/flashing/image
82+
tar xzpf ../*.zst
83+
```
84+
85+
You should now have an "initrd_flash" executable in your current directory:
86+
87+
```bash
88+
ls -al ./initrd_flash
89+
```
90+
91+
You are now ready to flash. Please keep this shell (on your local Ubuntu host where ./initrd_flash is located) active as you'll use it in the next section.
92+
93+
### Peforming the flash to the Nvidia Jetson device.
94+
95+
At this point, the instructions for flashing a Nvidia Jetson device varies slightly by device.
96+
97+
Please follow the Nvidia instructions located here: https://oe4t.github.io/master/Flashing.html starting with **Step 2**. Your open shell on youir Ubuntu host (where ./initrd_flash is located) effectively completes your **Step 1** in the Nvidia instructions.
98+
99+
The Nvidia instructions will outline:
100+
101+
- Placing your specific Nvidia Jetson device into "recovery mode"
102+
- Connecting the appropriate USB port from your Nvidia Jetson device to your local Ubuntu host
103+
- Initiating the flashing process by executing "./initrd_flash" on your local Ubuntu host
104+
105+
After completing the above Nvidia flashing instructions on your Ubuntu host, your Nvidia Jetson device is now ready to run your custom Yocto image!
106+
107+
You will need to now connect your Nvidia Jetson device to a monitor and keyboard and optional wired ethernet connection and power it up.
108+
109+
## What we've learned and what's next
110+
111+
In this section we downloaded and flashed our custom Yocto image for our Nvidia Jetson device. Then we followed the specific Nvidia Jetson device instructions to place our device into "recovery mode" followed by fully flashing the device with our custom Yocto image.
112+
113+
In the next section, we'll look at what our Nvidia Jetson device looks and feels like running our custom Yocto image!
297 KB
Loading
352 KB
Loading
1.43 MB
Loading
22.3 KB
Loading
23.5 KB
Loading

0 commit comments

Comments
 (0)