icub-tech-iit / study-icub-head

Main collector for the design of the iCub head
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

4K Cameras YARP Driver – Deal w/ Xavier NX #25

Closed pattacini closed 2 years ago

pattacini commented 2 years ago

As soon as we receive the Quark CB (see https://github.com/icub-tech-iit/purchases/issues/1768), we're required to:

pattacini commented 2 years ago

Hi @traversaro

Unfortunately, we cannot proceed with installing Ubuntu 20.04 as the Carrier Board doesn't allow for that yet. See https://connecttech.com/product/quark-carrier-nvidia-jetson-xavier-nx/.

We will keep monitoring the situation.

pattacini commented 2 years ago

@Nicogene, the CB has arrived (https://github.com/icub-tech-iit/purchases/issues/1768#issuecomment-1236762123) 🎉

Let's start testing the ensemble tomorrow.

pattacini commented 2 years ago

@Nicogene, @triccyx, tomorrow we have everything to test against the new Xavier NX.

Keep in mind that on Wed morning, PROTO will be mounting the electronics onboard the new head. To this end, @Fabrizio69 will need to get the two CB's:

maggia80 commented 2 years ago

carrier board SN:1464 delivered image

maggia80 commented 2 years ago

from https://connecttech.com/ftp/Drivers/L4T-Release-Notes/Jetson-Xavier-NX/XAVIER-NX-32.7.2.pdf

image

Nicogene commented 2 years ago

Today @sgiraz flashed successfully the Xavier NX with the jetpack 4.6.2, Then we followed the section typical installation section of the manual.

immagine

For the first boot we had to access to the board through the UART port and it was possible thanks to the help of @davidelasagna and @fgarini that made the UART cable

immagine

We selected the default choices and we configured it with username icub and pw icub.

The IP is now taken via DHCP, if it uses the router it should have a 10.0.0.x IP. Right now I am compiling all the dependencies for running the cameras ⌛

Nicogene commented 2 years ago

PS: We also installed cuda 10.2.

Nicogene commented 2 years ago

In the meanwhile I also tried to install opencv + CUDA, but since it is needed to be compiled from sources the 12 GB of HDD are not available, we will be able to compile/use it once we will have an sd expansion.

The good news that cuda is detected and opencv compiles fine (until it didn't finish the space)

Nicogene commented 2 years ago

Yesterday I had issues running the pylonCamera driver with the quark board. The error was related to the fact there are not devices under /dev/video*.

I tried to install the basler-camera-enablement-package-nvidia-jetson.

It contains the driver/kernel modules for making see the camera by the board, with the "automatic" installation I get this error:

>>> Compiling and applying device-tree overlay
Using overlay: tegra194-p3668-all-p3509-0000-basler-camera-overlay.dts
Traceback (most recent call last):
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 125, in <module>
    main()
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 99, in main
    raise RuntimeError("Platform not supported, no headers found!")
RuntimeError: Platform not supported, no headers found!

That it is similar to this issue unfortunately unsolved. I can try with the manual compilation/installation of the kernel modules

maggia80 commented 2 years ago

Yesterday I had issues running the pylonCamera driver with the quark board. The error was related to the fact there are not devices under /dev/video*.

I tried to install the basler-camera-enablement-package-nvidia-jetson.

It contains the driver/kernel modules for making see the camera by the board, with the "automatic" installation I get this error:

>>> Compiling and applying device-tree overlay
Using overlay: tegra194-p3668-all-p3509-0000-basler-camera-overlay.dts
Traceback (most recent call last):
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 125, in <module>
    main()
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 99, in main
    raise RuntimeError("Platform not supported, no headers found!")
RuntimeError: Platform not supported, no headers found!

That it is similar to this issue unfortunately unsolved. I can try with the manual compilation/installation of the kernel modules

try to contact Basler tech support. They are quite fast in replying.

Nicogene commented 2 years ago

I run this script in the Xavier NX:

immagine immagine immagine immagine

I chose 2, 5, 1 and rebooted and then I was able to use the basler cameras:

immagine

We can handle 30fps for FHD resoltion on both cameras with rotation. The only problem is that the rotation introduces some artifacts as already pointed out by @triccyx here

Here is the payload on the board cpu for the double stream + compression + rotation:

immagine

Nicogene commented 2 years ago

By default only 4 cores where enabled, for enabling the remaining 2, you need to run the command

sudo nvpmodel -m 2

With @davidelasagna we quickly check if it was possible to expand the memory with an external sd, we had issues mounting it but in case we will investigate further in the future

Nicogene commented 2 years ago

This PR https://github.com/robotology/yarp-device-pylon/pull/8 fixed the artifacts problems. I basically added a copy, also with this additional copy the fps stay 30.0 for double stream FHD and the payload is ok:

immagine

triccyx commented 2 years ago

Thanks to @sgiraz some notes for cloning the Xavier:

triccyx commented 2 years ago

@sgiraz please correct if needed.

triccyx commented 2 years ago
Some performance tests using jtop @maggia80 CPUs configuration resolution FPS current
20Watt 6 core 1080x1920x2Cams 30fps ~2.1A
15Watt 6 core 1080x1920x2Cams 30fps ~2A
20Watt 4 core 1080x1920x2Cams 24fps ~2A
15Watt 4 core 1080x1920x2Cams 22fps ~1.9A
triccyx commented 2 years ago

First version for install doc: https://github.com/robotology/yarp-device-pylon/blob/main/doc/board-installation-information.md It will be partially rewritten with the next Ubuntu version 20.04 when Connect will release the new version for the carrier.

pattacini commented 2 years ago

Well done 👍🏻