I’m trying to make a custom version of the filesystem, following the guide available here:
At one point the guide says to extract the file system into the folder rootfs:
$ tar xf ${L4T_RELEASE_PACKAGE}
$ cd Linux_for_Tegra/rootfs/
$ sudo tar xpf ../../${SAMPLE_FS_PACKAGE}
$ cd ..
$ sudo ./apply_binaries.sh
Before running the last command sudo ./apply_binaries.sh, I added my files. Then I run the apply_binaries.sh command to install all the other packages.
After this, I have flashed the board with the flash.sh utility. The flashing was successful and I have seen my files being flashed as well, when I logged into the Xavier XN. However, I have noticed that, with my “custom” filesystem, the cuda examples (and other things) are not there. For example, the folder /usr/local/cuda-10.2/ does not exist. Am I missing a step?
If I configure the board using the SDK Manager, I see that, after flashing the board, the SDK downloads all the GPU/ Computer Vision / IA libraries (cuda, openCV, Tensorflow, etc.) into the target. I assume I should do the same, but from command line. Is this right? If yes, how can I do that?
I think it’s because they’re so large. The Cuda deb files themselves are over 1G and when expanded they’re over 3G.
You can get them from the sd card image though.
If you haven’t already, download the NX sd card image from https://developer.nvidia.com/jetson-nx-developer-kit-sd-card-image then follow the instructions below…
$ # unzip the download
$ unzip nv-jetson-nx-sd-card-image-r32.4.2.zip
Archive: ./nv-jetson-nx-sd-card-image-r32.4.2.zip
inflating: sd-blob.img
$ # create a directory to mount the card image to...
$ sudo mkdir sdcard
$ # create a block loop device for the card image
$ sudo losetup -fPr --show ./sd-blob.img
/dev/loop4
$ # The actual loop device will vary so use the device reported but there should now be
$ # /dev/loop4p1 .. ./dev/loop4p11
$ # mount loop4p1 on ./sdcard in read-only mode
$ sudo mount -o ro /dev/loop4p1 ./sdcard
You can now copy the following directories and files to the same places in your rootfs:
./sdcard/var/cuda-repo-10-2-local-10.2.89
./sdcard/var/visionworks-repo
./sdcard/var/visionworks-sfm-repo
./sdcard/var/visionworks-tracking-repo
./sdcard/etc/apt/sources.list.d/cuda-10-2-local-10.2.89.list
./sdcard/etc/apt/sources.list.d/visionworks-repo.list
./sdcard/etc/apt/sources.list.d/visionworks-sfm-repo.list
./sdcard/etc/apt/sources.list.d/visionworks-tracking-repo.list
Once you’re finished with the sd card image…
$ sudo umount ./sdscard
$ # Substitute loop4 with the actual loop device used above.
$ sudo losetup -d /dev/loop4
Your rootfs should now be at least 1G larger than it was. :)
The packages will have to be installed with apt once the device is running.
There is another way to install them but it’ll make the rootfs even larger (by about 4G)
Copy all the deb files into your Linux_for_Tegra/nv_tegra/l4t_deb_packages directory.
When you run apply_binaries, the cuda and visionworks should also be installed into the rootfs.
WARNING: I haven’t tried this fully so I’d try it on an unmodified rootfs that you can easily discard.
Many of the files of “/usr/local” are added by SDK Manager after flash and do not populate the flash rootfs content. Did you add those files to “Linux_for_Tegra/rootfs/usr/local/” yourself? If not, then they won’t be there. Typical sample applications are cross compiled on the host PC and then copied over via ssh to a running system, and not added during flash. In more recent releases some content can be added by the apt-get mechanism, but those files would not exist on the PC’s “Linux_for_Tegra/rootfs/” unless you personally put them there. If ssh login fails this will fail. If the Jetson is not fully booted, then this will fail.