How to create an image for PYNQ Bootcamp


This guide will walk you through the process of setting up your SD card and the KRIA-SOM board for the PYNQ-DPU environment. If your SD card already has a suitable image installed, you can skip directly to the (Getting Started with PYNQ Bootcamp) step.

The KRIA-SOM AI Starter Kit is designed to help you get started with AI projects by leveraging the PYNQ-DPU environment. The KRIA-SOM module uses an Ubuntu-based image, which you can download from the AMD website and flash onto an SD card.

Once you have the KRIA-SOM image installed on your SD card, you can enhance your development experience by installing the PYNQ-DPU package. This package is available on GitHub and comes with easy-to-use install scripts. The PYNQ-DPU environment provides access to a wide range of AI models, example projects, and PYNQ peripherals, enabling you to quickly get started with your AI and machine learning projects.

Troubleshooting:

Setting Up Your SD Card


  1. Download Balena Etcher from https://etcher.balena.io/
  2. Download the latest Ubuntu image for AMD-Xilinx from https://ubuntu.com/download/amd-xilinx
  3. Insert the SD card into your computer.
  4. Run BalenaEtcher as Administrator.
  5. Flash the image to your SD card using Balena Etcher. (This may take a second try if the flash fails the first time.)

Update the KRIA Boot Binary


Preparation

  • The upcoming steps will require a USB UART connection. If you are using Windows 11, you will need to download the USB-UART drivers.

  1. Download the 2022.1 boot binary at: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1641152513/Kria+K26+SOM (Search the page for "Boot Firmware Updates")
  2. Follow the steps to set up UART found here: KRIA-SOM UART Setup
  3. Connect Ethernet cable from KRIA board to a Windows host laptop or PC.
  4. Configure host network settings:
    • Press Win+R, type ncpa.cpl and press OK.
    • Click on the unidentified ethernet connection.
    • Select Properties.
    • Double Click on "Internet Protocol Version 4".
    • Configure with the following settings:
      • IP address: 192.168.0.220
      • Subnet mask: 255.255.255.0
      • Default gateway: 192.168.0.1
    • Click OK or close on all network windows.
Instructional Image
  1. Hold down the FWUEN button (located about 2 inches below the power connector) and power cycle the KRIA by unplugging/plugging it back in to enter recovery mode.
  2. You should see a message on the UART terminal directing you to point your browser to an IP.
  3. Select settings:
    • Image A: Bootable
    • Image B: Bootable
    • Request Boot Image: Image A
    • Select Image to be recovered: Image A
    • Browse to and select the image downloaded earlier.
  4. Press upload, and address any pop-ups during download. If the Upload fails, simply reselect the settings again and retry until it works. (It might fail and take 2 or 3 tries.)
  5. Press the reset button on the board, and the process is complete!
Instructional Image

Software Setup


Preparation

  • There are two methods to set up the development software:
    • Using the board itself, necessitating a monitor, mouse, and keyboard connection.
    • Using a computer, requiring a UART connection to the board. KRIA-SOM UART Setup
  • Once a connection has been established, connect the power adaptor to boot the KRIA. Login using the following credentials:
    • Username: ubuntu
    • Password: ubuntu
      • Optional: change the password to pynqbootcamp
  • Connect board to network for internet access:
    • Connect an ethernet cable between the board and a port in your router
    • Make sure network is established using ifconfig or ping 8.8.8.8


Xilinx Development and Demonstration Set Up

  1. Install the xlnx-config snap using:
    sudo snap install xlnx-config --classic --channel=2.x
  2. Now run the following command to install KRIA Specific PPAs:
    sudo xlnx-config.sysinit

    Select Y for all of the [Y/n] questions and press enter to continue when prompted.

    Towards the end, windows may appear. On the "Configuring flash-kernel" window, select the first option "install the package maintainer's version".

    Note: the second option is selected in the photo. DO NOT CHOOSE THE YELLOW HIGHLIGHTED OPTION FROM THE PHOTO. You want the option above it circled in red.

    For any other windows, the default settings are fine so simply hit enter.
    Instructional Image

Setting up Wi-Fi Driver

Running the following commands will install the driver for the EW-7811UTC Dual Band WIFI Adapter.

  1. Run the following commands to clone and install PYNQ:
  2. sudo apt install -y dkms git build-essential iw
    • Press enter if prompted with a pop up menu
    git clone https://github.com/morrownr/8821au-20210708.git
    cd 8821au-20210708
  3. This final command will prompt you for two [Y/n] inputs. Enter "n" for the first and "Y" for the second.
  4. sudo ./install-driver.sh
    • This will trigger a reboot and the WiFi adapter should work.

PYNQ Install

  1. Run the following commands to clone and install PYNQ:
    git clone https://github.com/skalade/Kria-PYNQ -b bootcamp 
    Kria-PYNQ
    sudo bash ./install.sh -b KV260

Getting PYNQ Bootcamp Training Material

  1. All PYNQ Bootcamp training content is available on github. Run the following commands to clone the repository:
  2. sudo su - 
    cd /home/root/jupyter_notebook
    git clone https://github.com/Xilinx/PYNQ_Bootcamp.git
    cd PYNQ_Bootcamp

Accessing the Jupyter Notebooks

  • For local access (on the board), on a browser navigate to
  • kria:9090
  • For remote access (from a different computer), ensure the computer is connected to the same internet as the board and on a browser navigate to
  • <ip-address>:9090
Instructional Image

Setup Network Configurations


There are three ways you can setup you host and board communication:
  1. Ethernet Connection
  2. WiFi Dongle
  3. Local LAN using Static IP

Ethernet Connection

This is how the board was accessed during setup:

  1. Connect the Ethernet cable you got with your kit to the Ethernet port on the board.
  2. Connect the other side of the Ethernet cable to a port in your router.
  3. Note: Make sure your laptop is on the same network as the board.

Wi-Fi Dongle (Netplan)

  1. Connect a USB Wi-Fi dongle to the USB port on your board.
    • Wait for the blinking blue LED on the Wi-Fi Dongle to indicate it is active.
  2. Create a new file at /etc/netplan/01-wifi-setup.yaml but set the SSID and password to your actual values. Note: that this file is indentation/whitespace sensitive:

  3. network:
      version: 2
      renderer: NetworkManager
      wifis:
        wlan0:
          match:
            name: wl*
          dhcp4: true
          dhcp6: true
          access-points:
            "MY_SSID":
              password: "MY_PASSWORD"
  4. Run the following command to apply your netplan configuration:
  5. sudo netplan apply
  6. Check to see that you can see the IP address for an interface with a name starting in wl. This may take a while (probably a few seconds, but best to wait a minute or two)
  7. ifconfig
  8. Check to see if you have routes configured for the subnet of the IP your see (first three octets or so should be the same of the IP you noted in ifconfig):
  9. route -n
  10. Check to see if you can connect to the DNS server, if name resolution is working, and if you can access a webpage:
  11. ping www.google.com
  12. After you have done this initial setup, if you need to add a new access point or edit an existing access point, you can add or update access points using the wifi setup notebook (https://github.com/Xilinx/PYNQ_Bootcamp/blob/master/wifi-setup.ipynb) or by editing the netplan file(s) in /etc/netplan directly using any editor with root (sudo) access.

Local LAN using Static IP

Follow the steps detailed below or refer this guide to setup Static IP for your board: https://www.freecodecamp.org/news/setting-a-static-ip-in-ubuntu-linux-ip-address-tutorial/

Create a new netplan

  1. Create a new netplan file:
  2. sudo vim /etc/netplan/01-static-ip.yaml
  3. Add following settings to the file and save it (for vim, press i for insert, then copy/paste the code below, and then press escape, then type :wq) Note: that this file is indentation/whitespace sensitive:
  4. network:
      version: 2
      renderer: NetworkManager
      ethernets:
        eth0:
          dhcp4: false
          dhcp6: false
          addresses:
          - 192.168.1.2/24
          routes:
          - to: default
            via: 192.168.1.1
            metric: 10
          nameservers:
            addresses: [8.8.8.8,8.8.4.4]

Restart the netplan service

    sudo netplan try
  1. Press enter to accept the changes. To sanity check, you can run:
  2. ip a
  3. You should see that you have an IP address of 192.168.1.2 on the Kria board. If you type:
  4. route -n
  5. You should see a route to/from the gateway 192.168.1.1

Configure Ethernet Adaptor on your windows laptop

  1. Connect a Ethernet cable between the KRIA-SOM board and your laptop.
  2. Open Network and Sharing center on your windows laptop.
  3. Navigate to "Change adaptor settings" :
  4. Instructional Image
  5. Right click on the Ethernet adaptor associated with the ethernet cable connect to board and select properties.
  6. Double click on "Internet Protocol Version 4 (TCP/IPv4) and configure it using following settings:
  7. Instructional Image
  8. Click OK and save the settings.

Bridging

To enable bridging from the kria board through your local machine to the internet (tested on Windows 11 Enterprise only). Note: some networks have settings or firewalls that may disallow bridging in this way.

  1. Plug an ethernet cable from the Kria board into your computer, connect your computer to wifi.
  2. Follow the instructions from step 3.
  3. Open the settings for internet by typing Windows+r and then typing ncpa.cpl and hitting Enter.
  4. Open the settings for the wifi, and (on the sharing tab), select enable sharing.
  5. Double check that your settings for the ethernet remain what they are supposed to be for step 3, ignore any warning boxes that may appear. Be especially careful to remove any DNS server information that may appear.

Check to see if it worked by:

  1. On your windows machine, make sure you can still ping/ssh into the kria board using 192.168.1.2
  2. On the kria board, ping 8.8.8.8 (which checks to see if you can access a DNS server). You can also ping www.google.com or curl www.google.com to ensure resolution is working.

Troubleshooting - KRIA-SOM UART Setup


  1. Unplug the power cable from KRIA-SOM
  2. Plug in Micro USB to KRIA-SOM and the USB end to your computer
  3. Find the KRIA-SOM under the Ports tab on the Device Manager on Windows (Might not be COM4)
  4. Run PuTTY. Under sessions, change the highlighted fields. (For serial line field use whatever port was found in step 3. It may not be the first port displayed.) Putty Download
  5. Instructional Image
  6. Change the highlighted sections under the serial tab
  7. Instructional Image
  8. Plug back in the power cable into the KRIA-SOM
  9. Select open and log into the KRIA-SOM

More Information for Getting Started


AMD's KRIA Getting Started Page

Frequently Asked Questions


Frequently Asked Questions