Minimizing Storage Usage on Jetson

Originally published at: https://developer.nvidia.com/blog/minimizing-storage-usage-on-jetson/

Some NVIDIA Jetson modules have limited storage space, which imposes a challenge in packing applications and libraries. Here are ways to cut down on disk usage.

This breaks everything. Tried to install python3.8 packages, got this:

$ sudo apt install python3-pip python3.8-dev python3.8-venv -y

Reading package lists... 4%
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cuda-command-line-tools-10-2 : Depends: cuda-cupti-dev-10-2 (>= 10.2.89) but it is not going to be installed
 cuda-cupti-10-2 : Depends: cuda-cudart-dev-10-2 (>= 10.2.89) but it is not going to be installed
 cuda-toolkit-10-2 : Depends: cuda-samples-10-2 (>= 10.2.89) but it is not going to be installed
                     Depends: cuda-documentation-10-2 (>= 10.2.89) but it is not going to be installed
                     Depends: cuda-libraries-dev-10-2 (>= 10.2.89) but it is not going to be installed
                     Depends: cuda-nvml-dev-10-2 (>= 10.2.89) but it is not going to be installed
 libcudnn8-doc : Depends: libcudnn8-dev but it is not going to be installed or
                          libcudnn8-dev-cross-aarch64 but it is not installable
 libvisionworks-sfm-dev : Depends: libvisionworks-samples (>= 1.6.0) but it is not going to be installed
 libvisionworks-tracking-dev : Depends: libvisionworks-samples (>= 1.6.0) but it is not going to be installed
 nvidia-l4t-jetson-multimedia-api : Depends: cuda-cudart-dev-10-2 but it is not going to be installed
 python3-pip : Depends: python-pip-whl (= 9.0.1-2.3~ubuntu1.18.04.5) but it is not going to be installed
               Recommends: python3-dev (>= 3.2) but it is not going to be installed
               Recommends: python3-setuptools but it is not going to be installed
               Recommends: python3-wheel but it is not going to be installed
 python3.8-dev : Depends: python3.8 (= 3.8.0-3ubuntu1~18.04.2) but it is not going to be installed
                 Depends: libpython3.8-dev (= 3.8.0-3ubuntu1~18.04.2) but it is not going to be installed
                 Depends: libpython3.8 (= 3.8.0-3ubuntu1~18.04.2) but it is not going to be installed
 python3.8-venv : Depends: python3.8 (= 3.8.0-3ubuntu1~18.04.2) but it is not going to be installed
                  Depends: python-pip-whl (>= 8.1.0-2) but it is not going to be installed
 tensorrt : Depends: libnvinfer-dev (= 7.1.3-1+cuda10.2) but it is not going to be installed
            Depends: libnvinfer-plugin-dev (= 7.1.3-1+cuda10.2) but it is not going to be installed
            Depends: libnvparsers-dev (= 7.1.3-1+cuda10.2) but it is not going to be installed
            Depends: libnvonnxparsers-dev (= 7.1.3-1+cuda10.2) but it is not going to be installed
            Depends: libnvinfer-samples (= 7.1.3-1+cuda10.2) but it is not going to be installed
            Depends: libnvinfer-doc (= 7.1.3-1+cuda10.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Impossible to deploy our applications here (currently using internal limited emmc memory as stated in your example).

1 Like

@jwitsoe how do we use minimized configuration for adding wifi network auto-connection to the filesystem of e.g. jetson sdcard without OS booted?

Hi @Andrey1984,
Unfortunately, there is no specifically built scheme to do that like how it is on RPi.
If it is using Network Manager, one may be able to manually create the .nmconnection file under /etc/NetworkManager/system-connections/, but I’m not sure how default user creation through the OEM-config affects it.

For our reference, if possible, would you explain what situation you think such wifi auto-connection configuration scheme is needed?

Hi @cyato
Thank you for your reply.
I think I have tried just copying existing /etc/NetworkManager/system-connections/ to nvidia supplied sdcard image filesystem after writing it to sdcard. It did not seem that the robot appeared on the wifi network after the boot. Maybe more files need to be edited or copied?

Our use case:

Remote team has a robot that got jetson nx devkit deep inside.
Kind of no serial or usb or other cables or ports are accessible of the nx devkit.
The only somehow accessible thing is sdcard slot. The robot does need to boot from sdcard
The need is to prepare sdcard at Host PC in a way, so once it is added to the robot the robot on the first boot can be accessed via wifi already. As otherwise there is no way to access it at all.

Moreover, people in remote factory [ robot deployment location] can not do more complex action than to insert sdcard to HostPC or to nx devkit[robot] in case OS needs to be deployed. The rest is remote operation.

Reference findings include but are not limited to listed below:

  1. section 3.3 - step 12 https://community.infineon.com/t5/Knowledge-Base-Articles/Bring-up-of-AIROC-CYW54591-with-Jetson-Xavier-NX-from-NVIDIA-KBA235062/ta-p/341842
    It shows How to
    Add the following line to disable the NetworkManager service controlling the wlan0 interface.
  2. more specific step for jetson duckietown sdcard image [ doesn’t seem applicable to default nvidia sdcard image] https://docs.duckietown.org/daffy/opmanual_duckiebot/out/duckiebot_network.html [ wpa supplicant section for nano]

Hi @Andrey1984,
Thank you for explaining your use-case.

How about setting up another Xavier NX Developer Kit by flashing the NVIDIA-provided SD card image, setting up the WLAN connection, then making the whole image of the SD card?
You can flash another microSD card using the image, send the new microSD card to your remote team, and let them boot the robot with the new microSD card, and it should connect to the wireless AP on site.

When you download the NVIDIA-provided SD card image for the Xavier NX Developer Kit, be sure to select the same version of JetPack as the one that is currently running on the robot.

If you need guidance on cloning the SD card, please let us know.

I think I have tried just copying existing /etc/NetworkManager/system-connections/ to nvidia supplied sdcard image filesystem after writing it to sdcard. It did not seem that the robot appeared on the wifi network after the boot. Maybe more files need to be edited or copied?

Thank you also for providing the result of what you tested.
According to this post, the file actually contains the MAC address of the NIC of the unit, so that needs to be replaced.
A hack would be to perform this sed operation on the first boot.

Hi @cyato
Thank you for pointing out the sdcard clone method. We used it. It is known.

However, it is not easily remotely applicable due to existing constraints.

We are trying to figure out how to add wifi entry using nvidia sdcard image filesystem edits, or rootfs edits / BSP edits specifically. Without a need to use a second nx devkit unit. So that all edits ca be done at Host PC already , then written to sdcard. So that sdcard can be used for one-time-bringup of a robot once added to nx devkit without a need to interface anyhow with the system but for wireless connection.
Like as it is implemented in rpi wpa_supplicant or jetson sdcard for duckietown wpa_supplicant. So that just after editing files on the sdcard filesystem first boot reqults in connection already. Without need to use second reference hardware devkit somehow.

Could you confirm that you were able to combine the sed + copying the system-connection so that sdcard does boot up with connection activated already if using the nvidia supplied sdcard image for nx devkit?

Hi,
we followed the procedure on the blog post to remove gnome and the gui.
We have one problem with wifi, the device disappeared, and lsusb it’s showing nothing instead of the usual two devices :

What should we restore to make the wifi device work again ?
Thanks

@cyato I encountered the issue of unmet dependencies.

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cuda-command-line-tools-10-2 : Depends: cuda-cupti-dev-10-2 (>= 10.2.89) but it is not installed
 cuda-cupti-10-2 : Depends: cuda-cudart-dev-10-2 (>= 10.2.89) but it is not installed
 cuda-toolkit-10-2 : Depends: cuda-samples-10-2 (>= 10.2.89) but it is not installed
                     Depends: cuda-documentation-10-2 (>= 10.2.89) but it is not installed
                     Depends: cuda-libraries-dev-10-2 (>= 10.2.89) but it is not installed
                     Depends: cuda-nvml-dev-10-2 (>= 10.2.89) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

How do I overcome the issue? ‘apt --fix-broken install’ will install samples and dev packages back.