Vivado+Vitis 2019.2 Install on Ubuntu 18.04 LTS
Full installation guide for Vivado, Vitis, and PetaLinux 2019.2 on Ubuntu 18.04 LTS.
A new year means new installs! I was long overdue for a computer upgrade, so figured that would be my kickoff for the new decade. While I love new hardware just as much as the next person, I quickly tire of trying to remember all of the little gotcha settings for my various IDE installs. This is actually what got me started writing blogs a couple of years ago, to document IDE install steps so that I didn't have to think about it when I needed to do it again in the future. Xilinx's IDEs are usually my first install on a new machine since they are my heaviest use software tools. Ubuntu is my current host operating system of choice as I have found it is the most friendly Linux distribution to all of the software I use on a regular basis (which is the best way I'd recommend choosing a flavor of Linux).
I first have to preface this blog with that as of right now, Xilinx only supports up to Ubuntu 18.04.02 LTS for Vivado, Vitis, and PetaLinux version 2019.2 while Ubuntu is currently on release 18.04.03. From the digging I’ve done and in my own experience, the differences between Ubuntu versions 18.04.02 and 18.04.03 are minimal enough that there is a fairly good chance that your installation of Vivado/Vitis/PetaLinux will be stable. However, I recommend keeping your projects backed up by committing to a repository like Github at all times (this is a good practice regardless) and just doing a full uninstall+reinstall if you run into any issues. Also, if you didn't catch that, git is one of the very first packages that install on a fresh Linux image on my new machines.
To get started, double-check that your system meets all of the minimum requirements for Vitis here, and PetaLinux here.
Before downloading anything from Xilinx's website, there are some dependencies required by Vivado/Vitis/PetaLinux that need to be installed beforehand. Many of the libraries and tools PetaLinux has dependencies on in the host machine have 32-bit libraries, thus the 32-bit architecture i386 needs to be added to the host to compile them. This is done using the package management system, dpkg:
sudo dpkg --add-architecture i386
PetaLinux also needs a TFTP server setup and service running so that it can support TFTP booting on the target system if you choose so in any of your designs. In the /etc/xinetd.d/ directory create the following file by opening your text editor of choice:
sudo nano /etc/xinetd.d/tftp
Then add the following:
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
Create the directory for the TFTP service to pull files from such as the boot image file (BOOT.bin), kernel, device tree file, etc. to copy to the target during its boot up. Give the directory the appropriate permissions and give ownership to the same user specified in the TFTP service.
sudo mkdir /tftpboot
sudo chmod -R 777 /tftpboot
sudo chown -R nobody /tftpboot
Stop and restart the host machine's extended internet services for these changes to take effect.
sudo /etc/init.d/xinetd stop
sudo /etc/init.d/xinetd start
Ubuntu's default shell is dash, but PetaLinux requires bash. Again using the package management system, dpkg, reconfigure the host system shell from dash to bash.
sudo dpkg-reconfigure dash
Finally, before moving on to the actual Xilinx installation, install all packages listed in Table 2 of UG1144 on pages 10-11 using apt-get or your package manager of choice.
As the last bit of Ubuntu system prep, add your local user to the dial out group if you haven't already so Vivado and Vitis can access the computer's USB ports.
sudo adduser $USER dialout
Finally, turning our attention to Xilinx specific downloads and installations, I started with XRT. Xilinx Runtime (XRT) is a key part of what sets Vitis apart from its predecessor XSDK for FPGA acceleration. If you're not 100% sure on what the term 'FPGA acceleration' refers to, it's simply the new vocabulary term for accelerating software tasks by parallelizing and offloading them onto FPGA hardware. This is not a trivial task, as the code for processes written in software running on a CPU can't simply be copied over in a different syntax. The entire logic behind the software design must be rewritten with FPGA architecture taken into account to really see the efficiency increase on the FPGA. Xilinx's entire point of overhauling its software tools suite and releasing Vitis was to target this type of development on FPGAs. Xilinx Runtime specifically is a runtime environment that provides abstractions for operations that are commonly chosen for FPGA acceleration such as memory management.
To install XRT, start by downloading the deb installer file here, and run it:
sudo apt install /<path to deb installer>/xrt201920.2.3.130118.04-xrt.deb
Then run the following command to validate that the tools are installed:
/opt/xilinx/xrt/bin/xbutil validate
You should see the following output if you have no PCIe FPGAs or MPSoC board connected:
ERROR: No card found
Download Vitis installer here and extract the folder, then run the installer script as root. The installer will allow you to choose whatever directory you prefer for the install, but I always just let it install in the default location the installer chooses.
sudo <Vitis installer extracted folder>/xsetup
Once the installer has completed, I like to double-check the installation by first running Vivado:
source <installation directory>/Vivado/2019.2/settings64.sh
vivado
Then launch Vitis from Vivado by selecting 'Launch Vitis' under the 'Tools' menu. Once it's verified that Vivado and Vitis launch without errors, we can move on to install PetaLinux. Download PetaLinux installer here and create directory for it. Again, you can select any directory that you may prefer, but I always like to create a 'PetaLinux' folder in whatever folder the Vivado/Vitis installer defaulted to, which in my case was '/tools/Xilinx/':
sudo mkdir -p /tools/Xilinx/PetaLinux/2019.2/
Give the directory 755 permissions (making the folder globally read-execute):
sudo chmod -R 755 /tools/Xilinx/PetaLinux/2019.2/
Give the PetaLinux installer 777 permissions:
sudo chmod 777 ./Downloads/petalinux-v2019.2-final-installer.run
Change ownership of the directory you’re installing PetaLinux in to the user:
sudo chown -R <user>:<user> /tools/Xilinx/PetaLinux/2019.2/
Run the PetaLinux installer:
~/Downloads/petalinux-v2019.2-final-installer.run /tools/Xilinx/PetaLinux/2019.2/
It's super important to note you cannot run the PetaLinux installer as root (sudo) and do not move/copy any of the PetaLinux source files after installation. If you decide you want your PetaLinux installation in a different directory, recursively delete the full current installation directory then re-run the installer targeting your new desired directory.
Again, to verify the installation, I source the PetaLinux settings script and run a simple command like the petalinux-util command to toggle webtalk on and off:
Side note: As you can tell from my last screen shot, I am running Ubuntu on Parallels (on a Mac platform). I have had great luck with running Ubuntu VMs on Parallels as far as stability goes and being able to interface with peripherals easily. Just as a heads up though, Parallels 15 requirements you to purchase the Pro/Business subscription in order to let it utilize more than 8GB of your machine's RAM (so far, it's been worth it in my opinion).
At this point, the only things left to do are to download and install your target FPGA board files in Vivado and start your new Vitis projects!