Chris Dye edited this page Jan 5, 2018 · 9 revisions

This page describes how to set up your Jetson TX1, install docker, and build & run docker images on the Jetson.

If you're just getting started...

To start with a brand spankin' new Jetson, read the intro and setup guide on the Jetson TX series, and return here after initial hardware and Jetpack software setup.

Now that you are running the latest JetPack

  1. Add storage. The TX1 Jetpack 3.1 with all packages does not leave enough space for kernel download and build. Add storage (SATA or USB) and mount as /ssd.

  2. Update TX1 kernel with Docker support

    From the TX1, run these commands to obtain, prep, and make the kernel (heavily based on https://github.com/jetsonhacks/buildJetsonTX1Kernel):

    sudo -s
    
    JHURL=https://raw.githubusercontent.com/jetsonhacks/buildJetsonTX1Kernel/master
    
    SRC=$(curl -s $JHURL/scripts/getKernelSources.sh | grep wget | awk '{print $NF}')
    test "$SRC" && echo $SRC || echo "Did not get source URL!"
    mkdir /ssd/src
    curl $SRC | tar jxvOf - sources/kernel_src-tx1.tbz2 | tar jxvpf - -C /ssd/src # ETA: 5 min
    cd /usr/src
    ln -s -f /ssd/src/kernel .
    ln -s -f /ssd/src/hardware .
    
    curl -s $JHURL/diffs/devfreq/devfreq.patch | patch --verbose /usr/src/kernel/kernel-4.4/drivers/devfreq/Makefile
    curl -s $JHURL/diffs/nvgpu/nvgpu.patch | patch --verbose /usr/src/kernel/nvgpu/drivers/gpu/nvgpu/Makefile
    curl -s $JHURL/diffs/tegra-alt/tegra-alt.patch | patch --verbose /usr/src/kernel/kernel-4.4/sound/soc/tegra-alt/Makefile
    cp -vf /usr/src/kernel/kernel-4.4/drivers/media/platform/tegra/mipical/mipi_cal.h /usr/src/kernel/kernel-4.4/drivers/media/platform/tegra/mipical/vmipi/mipi_cal.h
    
    curl -s https://raw.githubusercontent.com/open-horizon/cogwerx-jetson-tx1/master/tx1.docker.config.L4T28.1.gz | gunzip | tee /usr/src/kernel/kernel-4.4/.config
    
    cd /usr/src/kernel/kernel-4.4
    
    # if you want to make any .config changes type: make menuconfig
    
    make olddefconfig
    make prepare
    make modules_prepare
    make -j4 Image && make -j4 modules && make modules_install && cp -vf arch/arm64/boot/Image /boot/Image # ETA 12 min
    
    reboot
    
  3. Install Docker (ignore error, will be fixed in next step):

    sudo apt-get update
    sudo apt-get -y install docker.io
    
  4. Now, edit /etc/default/docker and all this line (sudo first):

    DOCKER_OPTS="--storage-driver=overlay"
    
  5. Clean up failed docker.io install and restart Docker:

    sudo apt-get -f install
    sudo systemctl restart docker 
    
  6. We highly recommended this option: Attach a USB3 drive or SATA-connected SSD, however, if you're attaching a USB drive:

    systemctl stop docker
    mv /var/lib/docker /media/nvidia/theidofurdrive
    ln -s /media/nvidia/theidofyourdrive/docker /var/lib/docker
    systemctl start docker
    

    If attaching an SSD via SATA interface:

    # Attach SSD
    lsblk, should be /dev/sda1
    fdisk, delete partition 1, create new partition, will default to linux, write it out
    mkfs.ext4 /dev/sda1
    append to  /etc/fstab: /dev/sda1 /ssd ext4 errors=remount-ro,noatime 0 1
    mkdir /ssd
    mount -a
    systemctl stop docker
    cd /var/lib
    cp -r docker /ssd/
    rm -rf docker
    ln -s -f /ssd/docker .
    systemctl restart docker
    
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.