怎么提高MassFlash的烧写速度

我们使用Jetpack5.1.2 在Jetson Agx Xavier开发板上烧写一个rootfs大约为23G的镜像,测试的烧写时间如下:

烧写数量 用时(分)
1 17
2 33
3 45

当数量增加时,单位烧写时间没有明显下降,是不是和主机的硬件配置有关系?

我们当前使用的磁盘性能比较低

顺序读取 1017 MB/s
顺序写入 682 MB/s
随机读写32KQD20 918 MB/s
IOPS 4KQD1 45 MB/s

使用了一个USB Hub连接多个开发套件。

请问,刷写速度瓶颈是什么?

Hi,
Do you use the massflash script? The throughput may be gated by USB interface. Please check if the connection is in USB3 SuperSpeed instead of USB2.

我使用下面的命令烧写

sudo ionice -c 1 -n 0  ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 5 --network usb0 

重新测试USB2.0 和USB3.0,下面是测试结果

数量 USB2.0用时(分) USB3.0用时(分)
3 43 44

二者没有明显差异。
我注意到烧写过程中,会使tar 命令解压img文件,这是不是和主机的磁盘读写速度有关?
可否告知,理论上使用massflash刷写多台设备,会节省多少时间吗,我没有参照,不知上面的速度是否正常。

Hi,
You have 3 devices so please set

--massflash 3

And for first massflash please set –keep:

sudo ionice -c 1 -n 0  ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 3 --network usb0 --keep

And then please set –reuse:

sudo ionice -c 1 -n 0  ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 3 --network usb0 --reuse

Hi,
我会试试

--massflash 3

之前我也试了–keep 和 --reuse ,无论是第一次或再次刷写,并没有减少时间,我换了一块新的固态硬盘,重新试一下,稍后反馈结果。

Hi, DaneLLL
我尝试了所有可能的方法,都不能提高刷写速度。

最后,我使用lsusb -t 发现,新增加了USB设备在USB2.0速度下
插入USB线之前

lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    |__ Port 2: Dev 2, If 1, Class=Communications, Driver=cdc_mbim, 480M
    |__ Port 2: Dev 2, If 2, Class=CDC Data, Driver=cdc_mbim, 480M
    |__ Port 2: Dev 2, If 0, Class=Vendor Specific Class, Driver=, 480M
    |__ Port 3: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 12M
    |__ Port 4: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 2, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 3, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 4, Class=Application Specific Interface, Driver=, 480M
    |__ Port 10: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 10: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/3p, 20000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M

插入USB之后,新增了 Port 5: Dev 68

 lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    |__ Port 2: Dev 2, If 1, Class=Communications, Driver=cdc_mbim, 480M
    |__ Port 2: Dev 2, If 2, Class=CDC Data, Driver=cdc_mbim, 480M
    |__ Port 2: Dev 2, If 0, Class=Vendor Specific Class, Driver=, 480M
    |__ Port 3: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 12M
    |__ Port 4: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 2, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 3, Class=Video, Driver=uvcvideo, 480M
    |__ Port 4: Dev 4, If 4, Class=Application Specific Interface, Driver=, 480M
    |__ Port 5: Dev 68, If 0, Class=Vendor Specific Class, Driver=, 480M
    |__ Port 10: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 10: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/3p, 20000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M

我没有使用USB Hub,使用主机(都是3.0的USB口,或Type C口)直连目标板的方式, 并且尝试了各种USB线(Type C 或 USB3.0 数据线),使用lsusb -t 显示都是480M速度。
我对硬件或USB了解比较少,有办法让它工作在USB3.0模式下吗?

Hi,
It is expected it shows USB2 in lsusb -t. It is USB2 in the beginning while running initrd command. And in the middle Xavier device will be booted and re-enumerated as USB3.

Do you use Xavier developer kit or custom board? If you use Xavier developer kit, please connect the type-C port of developer kit to USB3 type-A port of host PC. If the host PC has multiple USB3 type-A ports, please connect single developer kit to each port. If you use custom board, please make sure the port is correctly set to otg mode and can be enumerated to USB3 device mode.

Hi,
我使用的是Xavier开发套件,连接 是将开发套件的type-C口与主机的USB3 type-A口相连。

现在我注意到,在刷写过程中使用lsusb -t 显示新出现的设备也在USB2.0速度下

下面是接入USB之前的状态:
lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
|__ Port 2: Dev 2, If 1, Class=Communications, Driver=cdc_mbim, 480M
|__ Port 2: Dev 2, If 2, Class=CDC Data, Driver=cdc_mbim, 480M
|__ Port 2: Dev 2, If 0, Class=Vendor Specific Class, Driver=, 480M
|__ Port 3: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 4: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 2, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 3, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 4, Class=Application Specific Interface, Driver=, 480M
|__ Port 10: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 10: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/3p, 20000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M

下面是开发套件进入Recovery模式下,接入USB,多了Dev 79
和 Dev80两个设备
lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
|__ Port 1: Dev 80, If 0, Class=Vendor Specific Class, Driver=, 480M
|__ Port 2: Dev 2, If 1, Class=Communications, Driver=cdc_mbim, 480M
|__ Port 2: Dev 2, If 2, Class=CDC Data, Driver=cdc_mbim, 480M
|__ Port 2: Dev 2, If 0, Class=Vendor Specific Class, Driver=, 480M
|__ Port 3: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 4: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 2, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 3, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 4, Class=Application Specific Interface, Driver=, 480M
|__ Port 7: Dev 79, If 0, Class=Vendor Specific Class, Driver=, 480M
|__ Port 10: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 10: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/3p, 20000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M

下面是进入刷写过程中,多了Dev 81 和Dev 82
lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
|__ Port 1: Dev 81, If 2, Class=Mass Storage, Driver=usb-storage, 480M
|__ Port 1: Dev 81, If 0, Class=Communications, Driver=rndis_host, 480M
|__ Port 1: Dev 81, If 1, Class=CDC Data, Driver=rndis_host, 480M

|__ Port 2: Dev 2, If 1, Class=Communications, Driver=cdc_mbim, 480M
|__ Port 2: Dev 2, If 2, Class=CDC Data, Driver=cdc_mbim, 480M
|__ Port 2: Dev 2, If 0, Class=Vendor Specific Class, Driver=, 480M
|__ Port 3: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 4: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 2, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 3, Class=Video, Driver=uvcvideo, 480M
|__ Port 4: Dev 4, If 4, Class=Application Specific Interface, Driver=, 480M
|__ Port 7: Dev 82, If 0, Class=Communications, Driver=rndis_host, 480M
|__ Port 7: Dev 82, If 1, Class=CDC Data, Driver=rndis_host, 480M
|__ Port 7: Dev 82, If 2, Class=Mass Storage, Driver=usb-storage, 480M

|__ Port 10: Dev 5, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 10: Dev 5, If 1, Class=Wireless, Driver=btusb, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/3p, 20000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M

我在两台笔记本电脑上测试,都是这样。
请问,这种状态正常吗?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.