Upgrade Jetson TK1 to Ubuntu 16.04

Steps to upgrade Jetson TK1 to ubuntu 16.04

  • Follow the instructions to download and flash your TK1 with the latest R21.5 (I did not install CUDA stuff)
  • Boot the flashed TK1
  • apt-get update && apt-get upgrade
  • the TK1 is now on Ubuntu 14.04.5 level
  • Backup TK1 using DD if=/dev/mmcblk0 of=/path/tk1.img bs=8M
  • Create bootable SDCARD

    • Format sdcard as ext4
    • Copy the content of rootfs over to sdcard.
    • cp ./boot/extlinux/jetson-tk1_extlinux.conf.sdcard ./boot/extlinux/extlinux.conf (on the sdcard!)
    • You now have a backup system, boot it from SDCARD to see if all works
    • enter "do-release-upgrade" when booted from SDCARD (I did this to protect my flashed system in case the upgrade failed)
    • Follow the upgrade instructions
    • Take a long coffeebreak (this takes several hours to complete)
    • Boot from SDCARD after the upgrade and test the result

    If you want to upgrade your flashed system:

    • Remove SDCARD
    • Boot system
    • do-release-upgrade (takes about 30 min)
    • reboot

    I have not tried this, but will in the future. A few notes maybe to add to this related to improving recovery when an upgrade goes wrong…

    Some newer releases of Linux use 64-bit extensions in ext4 during format…these need to be blocked. To do this (and this won’t interfere on systems which don’t do it anyway), using “/dev/mmcblk1p1” as the example partition (you may need to change this):

    sudo mkfs.ext4 -O ^metadata_csum,^64bit /dev/mmcblk1p1
    

    You would also want to verify the NVIDIA-provided hardware accelerated drivers are in place…do this both before and after the updates:

    sha1sum -c /etc/nv_tegra_release
    

    The apply_binaries.sh script is what adds those hardware accelerated files. Normally it applies them to the rootfs subdirectory of the driver package. Assuming you have mounted your ext4 SD card on “/mnt”, here is a way to apply_binaries to your rescue SD card:

    sudo ./apply_binaries.sh --root /mnt
    # OR:
    sudo ./apply_binaries.sh -r /mnt
    

    The binaries which are related to hardware access (there are also files related to performance and applications), this driver package file is unpacked on the “/” of the SD card or sample rootfs:

    nv_tegra/nvidia_drivers.tbz2
    

    If you have this file in “/” of a running Jetson, then unpacking this will fix any failures of “sha1sum -c /etc/nv_tegra_release”:

    Assumes nvidia_drivers.tbz2 is in “/” of the Jetson…

    sudo tar xvfj nvidia_drivers.tbz2
    

    From past experience, the only file which would need update (except under extraordinary failure) is:

    /usr/lib/xorg/modules/extensions/libglx.so
    

    …this particular file is a symbolic link, not a hard link. Normally this points at:

    # Equal to "/usr/lib/<architecture info of compiler>/tegra/libglx.so",
    # where on TK1 is "arm-linux-gnueabihf"...
    # where on TX1 or TX2 is "aarch64-linux-gnu"...
    /usr/lib/arm-linux-gnueabihf/tegra/libglx.so
    

    If only “/usr/lib/arm-linux-gnueabihf/tegra/libglx.so” is bad, and not other files, then the symbolic link can be forcibly set back in place to get graphics running (it is rare that this happens…99% of graphics failures are unrelated to this…the tip is that the failure only occurs after an update):
    [corrected]

    sudo ln -sf /usr/lib/arm-linux-gnueabihf/tegra/libglx.so /usr/lib/xorg/modules/libglx.so
    <s>sudo ln -sf /usr/lib/arm-linux-gnueabihf/tegra/libglx.so /usr/lib/arm-linux-gnueabihf/tegra/libglx.so</s>
    

    (There are some apt-get upgrade operations which might do this…mostly those have been protected against, and doing “apt update” with “apt-get upgrade” is recommended)

    If you fear this might happen you could just copy “nv_tegra/nvidia_drivers.tbz2” to “/” of the Jetson prior to doing anything risky. Then you just do the above mentioned steps with tar to unpack this and fix any missing drivers…this will fix all drivers, not just libglx.so. Having the file in place ahead of time is “pre-planning” recovery. The file is about half a MB, so it doesn’t take a lot of room. If you don’t want this used on the eMMC, it is a good idea to put it on any rescue SD card such as the one described in the original post.

    I have updated to ubuntu 16.04 with this method.

    Cuda works but no X due to abi incompatibility with nvidia driver.

    What things do not work with tk1 under Ubuntu 16.04 that do work under Ubuntu 14.04? For example, you stated that X was not working due to abi incompatibility. Unfortunately, I need X working. I also need OpenGL and CUDA. Are these not working in 16.04? There are several posts about updating the tk1 to 16.04 some of which say it works and others which say there are problems. What is true?

    Hello Vlemo,

    Thanks for your instructions on how to upgrade from Ubuntu 14.04 to Ubuntu 16.04. I have meticulously followed the instructions up until the point at which I am to boot from the SDCARD.

    [You now have a backup system, boot it from SDCARD to see if all works]

    On booting from the SDCARD, a terminal that covered the entire screen came up.
    I typed “do-release-upgrade”, and over a span of 6 hours, nothing happened i.e.

    ubuntu@tegra-ubuntu:~$ do-release-upgrade
    checking for a new Ubuntu release

    I was trying to be patient, since the process was supposed to take a couple of hours, as per the instruction, but its now obvious to me that something is wrong. I am able to kill this process with Ctrl+C though.

    I wish I could have sent a photoshot of the situation on this forum.

    Please can anyone help?

    I have installed Ubuntu 16.04 on my Tk1.

    I’ve upgraded to 16.04, but on reboot I get the following error:

    rtkit-daemon.service: Failed at step NETWORK spawning /usr/lib/rtkit/rtkit-daemon: Invalid argument
    Failed to start RealtimeKit Scheduling Policy Service

    Any ideas what might have gone wrong?