Minimal Jetson Nano image (Ubuntu 18.04)

https://mega.nz/#!MBlgGCzA!73aOt24_dsBIQwcY21nhS07gY1GphS-Ion7vrsP8Gp0

I created a minimal Jetson Nano image. It only uses about 5 GB with chromium and a window manager.

Username: terminator
password: qwerty

To start the desktop, type:

startx

wait up to 15 seconds and the awesome window manager will start.

Does anyone know how I could make this image sparse?

The “driver package” (which creates the “Linux_for_Tegra/” subdirectory for flash) has a tool (and if you’ve flashed with SDK Manager, then it would have downloaded this for you) called “mksparse”. Located in “Linux_for_Tegra/bootloader/”. To see options run “./mksparse --help”. The “–fillpattern=0” is what is used for sparse images during flash (this is the default…“bootloader/systme.img.raw” gets turned into “bootloader/system.img” via this utility).

Do be aware that once in sparse format the open source tools for sparse images won’t work with this. Keep your raw image available if you might need to edit the image.

Thanks! I actually just made a Debian version with the kernel. I’ll try and find this mksparse script for use in my new debian based image.

I created an article describing how can you build an image from scratch.

https://pythops.com/post/create-your-own-image-for-jetson-nano-board

2 Likes

Hi pythops, thanks for sharing - that looks like a useful guide!

I’ve just updated the scripts to use ubuntu 20.04 and latest BSP

1 Like

Support for Jetson nano board 2GB has been added :

@pythops Do you apparently still have the image for 18.04?

Is it OK to checkout this commit? Update to latest 18.04 image · pythops/jetson-nano-image@18de125 · GitHub

The current JetPack official image is 18.04 (bionic) with Nvidia software on top. Is there some Ubuntu software that you can’t find? Mostly everything should be apt-get installable.

The current deployment is too fat :) I was trying to install OpenCV 3 from source after having flashed the Nvidia image to a 32 (!!) GB SD card. The compilation process run over night and I found the Jetson claiming to have ran out of disk space this morning.

In such cases something like a USB thumb drive mounted at the output or temp location should work.

Yepp. Meanwhile I was able to roll one of the smart and slim images the @pythops solution provides. 18.04 and 20.04. I’m just a bit anxious with 20.04: As far as I know DS 5.x is not known to be compatible with 20.04 (?)

But I will find out :)

What was the exact error message? More likely during the build process it ran out of memory (RAM). That’s a known issue. I’ve built OpenCV on that card size before. It might help, before you start the build to drop to the command line temporarily with:

sudo systemctl isolate multi-user.target

(and then build via the console or ssh)

That should free up enough ram for the build to complete. If you still want to, by all means, use the pythops repo to create your own image. I looked at @pythops code. It’s simple and to the point, using debootstrap to create a rootfs, ansible to configure it, and seems to follow Nvidia’s instructions to add their software to the rootfs. So good job, @pythops . This is hard stuff and you seem to have nailed it.

@mdegans Well, disk full :) And indeed, 30 GB have been consumed (df -H) I have no clue what happened. I repeated later, but abandoned in favour of @pythops solution (which works great). There are some minor problems (e.g. the ./flash.sh needed to be altered in order to meet my environment and there was a nameserver entry necessary in order to pass the apt updates at build time).

But the basic image is 1.4 GB. And it is blazing fast. I was using the 18.04 branch, because I feared incompatibilities of DS 5.x with 20.04.

Here what I get after installation

ubuntu@tegra-ubuntu:~/kms-test$ jetson_release -v
 - NVIDIA Jetson Nano (Developer Kit Version)
   * Jetpack 4.2.3 [L4T 32.2.3]
   * NV Power Mode: MAXN - Type: 0
   * jetson_stats.service: active
 - Board info:
   * Type: Nano (Developer Kit Version)
   * SOC Family: tegra210 - ID:33
   * Module: P3448-0000 - Board: P3449-0000
   * Code Name: porg
   * Boardids: 3448
   * CUDA GPU architecture (ARCH_BIN): 5.3
   * Serial Number: 1423519045845
 - Libraries:
   * CUDA: NOT_INSTALLED
   * cuDNN: NOT_INSTALLED
   * TensorRT: NOT_INSTALLED
   * Visionworks: NOT_INSTALLED
   * OpenCV: 3.2.0 compiled CUDA: NO
   * VPI: NOT_INSTALLED
   * Vulkan: NOT_INSTALLED
 - jetson-stats:
   * Version 3.1.1
   * Works on Python 3.6.9

I really agree on your thumbs up to @pythops. Same here :) Well done.

Will report how it all behaves together with DS 5.1 or so later

PS: I always build via SSH.

PPS: And it wasn’t by far not my first OpenCV build :) I was astonished as well. Something went incredibly wrong over night

I wouldn’t be surprised if the known ways to create an overlayfs would work with this image too…

My guess would be the swap file took up all the space. You can try this incantation:

 find / -xdev -type f -size +100M -print 2> /dev/null | xargs ls -lh | sort -k5,5 -h -r

From this site and see what it shows.

Also, Docker can take up a ton of space so you could try purging any images and containers you’re not using. If you’re like me you forget --rm a lot and that can quickly fill up a disk so.

(sudo) docker container prune
(sudo) docker image prune (-a)