It's that time of year: a new Vitis/Vivado and PetaLinux version has been released and it's time for another installation! While I've documented past installations, I always find little tweaks and differences for each new version that makes it worth a new write up. I also know from past experience that when you're completely new to the world of FPGA development, having a specific installation guide for the exact version you're trying to install is more than *helpful*.
I am installing Vivado/Vitis/PetaLinx 2023.1 on Ubuntu 22.04 LTS. And while I haven't explicitly tested it at the time of this writing, the same steps below should work fine on Ubuntu 20.04 LTS. I will update this writing once I verify this for sure.
System DependenciesIf you're starting with a fresh Ubuntu image that doesn't have any other verisons of AMD tools installed, start by enabling the 32-bit architecture in the system and setting the shell to bash (by default it's configured to dash on a fresh install of Ubuntu):
~$ sudo dpkg --add-architecture i386
~$ sudo dpkg-reconfigure dash
Next install the following package dependencies. I've put them in the most optimal copy+paste order here (you're welcome) as well as broken them up into manageable apt install chunks. Of the 100s of times I've installed AMD tools on a fresh Ubuntu image, I've never had it be anything short of a three-ring circus if I try to install all of the packages in the same apt install command.
~$ sudo apt-get install iproute2 make libncurses5-dev tftpd libselinux1 wget diffstat chrpath socat tar unzip gzip tofrodos
~$ sudo apt-get install debianutils iputils-ping libegl1-mesa libsdl1.2-dev pylint python3 python2 cpio tftpd gnupg zlib1g:i386 haveged perl
~$ sudo apt-get install lib32stdc++6 libgtk2.0-0:i386 libfontconfig1:i386 libx11-6:i386 libxext6:i386 libxrender1:i386 libsm6:i386
~$ sudo apt-get install xinetd gawk gcc net-tools ncurses-dev openssl libssl-dev flex bison xterm autoconf libtool texinfo zlib1g-dev cpp-11 patch diffutils
~$ sudo apt-get install gcc-multilib build-essential automake screen putty pax g++ python3-pip xz-utils python3-git python3-jinja2 python3-pexpect
~$ sudo apt-get install liberror-perl mtd-utils xtrans-dev libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
~$ sudo apt-get install openssh-server util-linux sysvinit-utils google-perftools
~$ sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev libncurses5:i386 libtinfo5
~$ sudo apt-get install libstdc++6:i386 libgtk2.0-0:i386 dpkg-dev:i386
~$ sudo apt-get install ocl-icd-libopencl1 opencl-headers ocl-icd-opencl-dev
It's also worth noting in case anyone runs across it. In the excel file list of package dependencies for Petalinux, the package linselinux1-3.3-1build2
is actually a typo and should be libselinux1-3.3-1build2
, which was clearly a copy+paste errors across the whole spreadsheet for all the various versions of Ubuntu.
One of the options for a PetaLinux project on a target AMD device is to have it boot from a TFTP server instead of from local storage. And through trial and error, I've found that the infrastructure for this TFTP boot option is a requirement for PetaLinux's installation even if you don't plan to configure any project to utilize it.
So to create the TFTP service for PetaLinux, open the TFTP configuration file in the Linux internet services directory (if you already did this for a previous installation, then skip to the section for downloading the installers):
~$ sudo gedit /etc/xinetd.d/tftp
And configure it as such:
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
Then create the directory for the files to be transferred to/from on the host PC during the TFTP boot process and give it the appropriate permissions:
~$ sudo mkdir /tftpboot
~$ sudo chmod -R 777 /tftpboot
~$ sudo chown -R nobody /tftpboot
~$ sudo /etc/init.d/xinetd stop
~$ sudo /etc/init.d/xinetd start
Update and upgrade the system for good measure:
~$ sudo apt update
~$ sudo apt upgrade
External USB Access for LinuxFinally, add the user to the dial out group so Vitis/Vivado can access the USB ports of the computer (again, skip this if already done previously):
~$ sudo adduser $USER dialout
Download InstallerAs with previous versions of Vitis/Vivado, there are the options for self-extracting web installers and a single-file download. And despite the fact that the compressed single-file download has grown to 111GB in size, I still recommend it over the web installers (because honestly, if you don't have about 300GB - 400GB of free space to temporarily deal with these large files then you don't have enough space to create more than a few projects anyways).
I won't tout this as absolute gospel, but my old grouchy self has been burned by an internet hiccup during a web installation one too many times to have any trust/patience left for it.
After I extract the compressed single file installer, I move it to an external hard drive so I don't have to download it again if I need it in the future. Then you can delete the extracted directory of the installer once the installation is complete, so you ultimately aren't losing any extra space to it in the long run.
Once downloaded, extract the installation folder and run the installer, xsetup
, within it:
~$ cd ./Downloads/Xilinx_Unified_2023.1_0507_1903/
~/Downloads/Xilinx_Unified_2023.1_0507_1903$ sudo ./xsetup
Select Vitis as the product to install as it's the superset option that will include Vivado (but not PetaLinux, that's a separate install in a later step).
I also chose to install the IP cache for Vitis (because what's an extra 1.09 GB in a 160GB install?). Then you'll be asked to agree to all of the fine print as with any software.
By default, the installer wants to install Vitis and Vivado to /tools/Xilinx
. You can choose elsewhere, but I've found a lot of scripts from vendors such as Avnet to build their BSPs assume this /tools/Xilinx
default directory so I highly recommend selecting it.
At the end of the installation, a prompt will pop up to run an installation script to fill in any missing libraries for Versal ACAP tools. For the sake of completeness, run the installation script:
~/Downloads/Xilinx_Unified_2023.1_0507_1903$ cd /tools/Xilinx/Vitis/2023.1/scripts/
/tools/Xilinx/Vitis/2023.1/scripts$ sudo ./installLibs.sh
Install the various Xilinx programmer cable drivers next. Be sure to disconnect any that are currently connected to the host machine prior to running the installation script:
~$ cd /tools/Xilinx/Vivado/2023.1/data/xicom/cable_drivers/lin64/install_script/install_drivers/
/tools/Xilinx/Vivado/2023.1/data/xicom/cable_drivers/lin64/install_script/install_drivers$ sudo ./install_drivers
And again, Vitis and Vivado take up quite a bit of hard drive space in 2023.1 as well. But I'll say it again: given all of the libraries and packages necessary for AI development and hardware acceleration at the moment, there is not a way to avoid this if you want to be able to do anything offline like build bitstreams.
Finally, to test the installation and launch Vivado and/or Vitis:
~$ source /tools/Xilinx/Vivado/2023.1/settings64.sh
~$ vivado
~$ source /tools/Xilinx/Vitis/2023.1/settings64.sh
~$ vitis
While there is an option for downloading the PetaLinux installer in the Vitis installer, I've found that it's easier to just download it straight from the AMD website since it's a separate installation process anyways:
Since PetaLinux's installer doesn't automatically create the installation directory and give it the appropriate permissions for us like the Vitis installer does, we have to do it manually prior to running the installer. I recommend installing it where you installed Vitis and Vivado, following the same directory setup:
~$ sudo mkdir -p /tools/Xilinx/PetaLinux/2023.1/
~$ sudo chmod -R 755 /tools/Xilinx/PetaLinux/2023.1/
~$ sudo chown -R <user>:<user> /tools/Xilinx/PetaLinux/2023.1/
Then give the installer the appropriate permissions and run it.
~$ sudo chmod 777 ./Downloads/petalinux-v2023.1-05012318-installer.run
~$ ./Downloads/petalinux-v2023.1-05012318-installer.run --dir /tools/Xilinx/PetaLinux/2023.1/
When the license agreement appears in the command line, up the up and down arrow keys if you'd like to scroll through and read it. Then press q to exit and Y to agree.
Once the installation is complete, source the PetaLinux tools and run a command to verify:
~$ source /tools/Xilinx/PetaLinux/2023.1/settings.sh
~$ petalinux-util --help
You can ignore the error this command throws about not being within a PetaLinux project since we're just making sure the PetaLinux tools can be sourced in the environment and don't immediately explode upon being called.
And that's it! You're ready to conquer your next FPGA design with version 2023.1!
Comments
Please log in or sign up to comment.