flash.sh gets stuck when flashing OS

Hi

I am trying to flash the Nvidia provided Linux image to a Jetson TX2 (on the dev kit board). As my PC runs Ubuntu 17.x, I am running flash.sh from within a Ubuntu 16.04 VM with USB passthrough. At first, everything works fine, but then it gets stuck:

[  12.2810 ] Writing partition mb1 with mb1_prod.bin.encrypt
[  12.2813 ] [................................................] 100%
[  12.2936 ] Writing partition mb1_b with mb1_prod.bin.encrypt
[  12.3208 ] [................................................] 100%
[  12.3334 ] Writing partition spe-fw with spe_sigheader.bin.encrypt
[  12.3600 ] [................................................] 100%
[  12.3720 ] Writing partition spe-fw_b with spe_sigheader.bin.encrypt
[  12.3854 ] [................................................] 100%
[  12.3995 ] Writing partition mb2 with nvtboot_sigheader.bin.encrypt
[  12.4080 ] [................................................] 100%
[  12.4207 ] Writing partition mb2_b with nvtboot_sigheader.bin.encrypt
[  12.4641 ] [................................................] 100%
[  12.4822 ] Writing partition mts-preboot with preboot_d15_prod_cr_sigheader.bin.encrypt
[  12.5284 ] [................................................] 100%
[  12.5416 ] Writing partition mts-preboot_b with preboot_d15_prod_cr_sigheader.bin.encrypt
[  12.5883 ] [................................................] 100%
[  12.6007 ] Writing partition SMD with slot_metadata.bin
[  12.6578 ] [................................................] 100%
[  12.6840 ] Writing partition SMD_b with slot_metadata.bin
[  12.6949 ] [................................................] 100%
[  12.7043 ] Writing partition master_boot_record with mbr_1_3.bin
[  12.7579 ] [................................................] 100%
[  12.7671 ] Writing partition APP with system.img
[  12.7720 ] [..............                                  ] 029%

lsusb shows the device as still connected in the VM:

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 008: ID 0955:7c18 NVidia Corp. 
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Syslog contains an interesting entry:

May  4 16:54:41 ubuntu16vm kernel: [ 3865.911434] INFO: task tegradevflash_v:4035 blocked for more than 120 seconds.
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911447]       Tainted: G           OE   4.13.0-39-generic #44~16.04.1-Ubuntu
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911451] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911455] tegradevflash_v D    0  4035   1311 0x20020004
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911462] Call Trace:
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911480]  __schedule+0x3d6/0x8b0
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911486]  schedule+0x36/0x80
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911492]  schedule_timeout+0x17a/0x360
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911501]  ? call_timer_fn+0x140/0x140
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911507]  wait_for_completion_timeout+0xad/0x140
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911512]  ? wait_for_completion_timeout+0xad/0x140
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911518]  ? wake_up_q+0x70/0x70
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911526]  usb_start_wait_urb+0x8c/0x170
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911532]  usb_bulk_msg+0xbd/0x160
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911539]  proc_bulk+0x21b/0x380
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911545]  usbdev_do_ioctl+0x993/0x1140
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911551]  ? entry_INT80_compat+0x131/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911556]  ? entry_INT80_compat+0x12a/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911559]  ? entry_INT80_compat+0x123/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911563]  ? entry_INT80_compat+0x11c/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911567]  ? entry_INT80_compat+0x115/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911571]  ? entry_INT80_compat+0x10e/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911575]  ? entry_INT80_compat+0x107/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911579]  ? entry_INT80_compat+0x100/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911583]  ? entry_INT80_compat+0xf9/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911588]  usbdev_compat_ioctl+0x10/0x20
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911596]  compat_SyS_ioctl+0xc5/0x410
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911600]  ? entry_INT80_compat+0xa5/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911607]  do_int80_syscall_32+0x63/0x120
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911612]  entry_INT80_compat+0x142/0x150
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911617] RIP: 0023:0x8076ac4
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911620] RSP: 002b:00000000ff997dd8 EFLAGS: 00000206 ORIG_RAX: 0000000000000036
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911625] RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00000000c0105502
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911628] RDX: 00000000ff997e00 RSI: 0000000000090000 RDI: 000000000953fe00
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911630] RBP: 00000000f7eb1008 R08: 0000000000000000 R09: 0000000000000000
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911633] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
May  4 16:54:41 ubuntu16vm kernel: [ 3865.911635] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

I have tried it several times, and the script gets stuck in the same step every time, although at a different percentage (29%, 64%, and even 0%). The syslog message shows up every time. I am using Virtualbox with USB 3.0 Passthrough.

VMs don’t work (most of the time). It is ok to use flash.sh from any 64-bit PC Linux, so Ubuntu 17 is not a problem for this…but the VM is.

OK. would be nice if Nvidia mentioned this in the docs (I know Ubuntu 17 is not officially supported, but something along the like “You will not get support for Ubuntu 17 but try it instead of Ubuntu 16 in a VM”).

Btw, to get the Jetpack installer running on Ubuntu 17 I had to install libpng12:

wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb

Or if networked:

sudo apt-get install libpng12