How to install lib on the linux host

HI,

SDK Manager seems install cudda tensorFlow etc over ssh on to the target. Could you tell how to install them on the host . then when I create sd card image it is already part of the image.

We also need install some other thirdparty lib besides these two.

Thanks

SDK Manager/JetPack is used to add extra packages, including to host (just don’t mix versions of JetPack base flash with different package versions when installing to the Jetson). You can just uncheck all operations except host package install. SDK Manager versions (you may need to log in there, and click on the link a second time):
https://developer.nvidia.com/embedded/jetpack-archive

Okay thanks. I will try.

What are the steps to integrate other third party lib on the host ?

Thanks

Libraries are no different in terms of development or installation on a PC or Nano. The difference is that they are compiled for the arm64/aarch64/ARMv8-a architecture instead of the PC x86_64 (or similar) architectures.

Typically you’ll see additional library search locations in “/etc/ld.so.conf.d/”.

Thanks.

Understood this. on the target i can do apt-get install library name. Now my question is that i want to preinstall them in rootfs. I can download the correspoding lib. then how to deploy them into rootfs ?

appreciate if you can give a example.

Do you use dpkg to install target package on the host rootfs ?
Also I saw a script called nv-apply-debs.sh used in apply_binaries.sh. what is used for ? i can not find this script.

One example is that I can run following command on the Nano. The question how to preinstall them on the linux host as part of rootfs. so when I create them it is in the image already.

wget https://nvidia.box.com/shared/static/j2dn48btaxosqp0zremqqm8pjelriyvs.whl -O torch-1.1.0-cp36-cp36m-linux_aarch64.whl
sudo pip3 install numpy torch-1.1.0-cp36-cp36m-linux_aarch64.whl
sudo apt-get install libjpeg-dev zlib1g-dev

Personally I just install everything I want, update it, and then clone (or with SD card you can just make a dd copy of the partition).

thanks . we thought about it . but it’s not going to scale as we want to develop as a product which require indiviual developer can build a compelte image . also our SD card is 256G dd take a lot of time. so need your help to see how to install them on the host

any suggestions ?

Thanks

I don’t know of any way to use apt/dpkg tools directly on the host for an independent package system not part of the host. Sorry.

dd speed is only limited by the SD card speed, though options may speed it up. The “block size” argument (for example, “bs=512” for half a kbyte) can be increased and buffering within the host PC will likely improve performance (not all devices work well with larger block sizes, but SD cards do). So for example, compare “bs=512” and “bs=1M” (1 Mbyte). Perhaps even “bs=10M”.

Btw, if you have a master image from an SD card, then you don’t read again from the SD. You perform your SD writes from reading that image off of a fast PC hard drive/SSD. Don’t copy directly from one SD to another, copy SD1->PC->SD2.

thanks. dd is for a short solution.

but for production software i guess there must be a way to intall lib on the host as apply_binary.sh does similar thing but only install Nvidia package. could you help to ask internal team ?

Hi terry8uwg2, apply_binaries unarchives the L4T drivers on top of the Ubuntu rootfs image. You can do a similar thing if you have files which you want to include in the rootfs image before it is flashed. However I am unaware of a way to install debian packages or Python pip wheels to the image outside from running it on the Jetson.

Two potential ideas for your consideration:

  • Create a base image with your dependencies installed on a smaller SD card or partition and then resize it to your full SD card. I am guessing the 256GB SD card is mostly empty at first.

  • Create a Docker image that includes your dependencies and application(s), which could be more portable and easier/quicker for you to copy around.

could you elaborate “Create a base image with your dependencies installed on a smaller SD card or partition and then resize it to your full SD card. I am guessing the 256GB SD card is mostly empty at first”

1.Install everything into smaller S card
2.dd to clone the image ?
3.dd to copy to larger sd card ?
4.how to resize it afterwards ?

This maybe a temp solution for us to deploy software to mutiple devices for now.

but I still need a way to be able to cross-install package on the host to prepare a full image.

Really appericate

See here for info about creating the image, then using Etcher tool which will allow the partition to resize itself upon first boot: https://devtalk.nvidia.com/default/topic/1050105/jetson-nano/jetson-nano-sd-card-partitions-can-not-extend-/post/5344654/#5344654

It doesn’t seem possible to cross-install apt packages before flashing except by manually extracting their contents. What you could do is put the deb packages into the image, and then create a service on the Nano that will install the packages upon first boot: https://devtalk.nvidia.com/default/topic/1058745/jetson-nano/how-to-build-a-jetson-nano-sd-card-image-containing-specific-software-and-libraries-/post/5368683/#5368683

Thanks i know this tool.

But still dont know your first suggestion install a base image on a small sdcard then resize to large sdcard

  1. I can create a base image and flash to small sd card and manual install dependencies
  2. Now i am missing the step how to clone the image fron small sdcard and how to install to bigger sdcard and resize

Note my base image on yhe host is missing the dependencies

First flash the smaller SD card using the official image using Etcher tool, so the user partition is at the end. You would clone the image with dd, as per this post by linuxdev: https://devtalk.nvidia.com/default/topic/1052633/jetson-nano/how-to-back-up-current-state-of-system-sd-card-image-/post/5343259/#5343259

Then flash it to larger SD card, and you should be able to expand the partition to full size using GParted tool or similar, because the user partition is at the end since it was originally based on the Etcher image (which puts the user partition at the end). Or since the first boot has already occurred on the smaller SD card, you may need to manually re-enable the nvresizefs service if you would rather use that tool.

I think either creating a Docker image or creating a service to install your packages onboard the Nano at first boot can be more straightforward to do.

if it deb package I probably can pre-download and put it in nv_tegra/l4t_deb_packages/ let os to install. however there are some lib we install on the target it’s hard to figure out what’s the corresponding deb pkg. The goal for me is to pre-install all the package on the host rootfs to create a productin image as the device may not have network connection to auto install itself.

can you share the steps how nvdia create the prebuild rootfs ? I would like explore if I can customize rootfs by following that process.

Hi terry8uwg2, see here in the L4T docs for setting up your root filesystem:

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Frootfs_custom.html%23

The apply_binaries script is what adds files on top of the vanilla Ubuntu image.