Run X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (LibMali)

Introduction

The author provides Debian GNU / Linux for Ultra96 / Ultra96-V2 (ZynqMP) [1]. The Debian GNU / Linux provided is CUI-based, but this time we have made the X Window System run on Ultra96 / Ultra96-V2 to support the GUI.

Therefore, the procedure for operating the X Window System on Ultra96 / Ultra96-V2 is explained in several parts.

This article provides steps to build the Debian Package for LibMali and to install the X Window System with libMali on ZynqMP-FPGA-Linux.

What is LibMali (User Space Libraries for Mali)?

libMali is a user-space library for 3D rendering on the GPU (Mali-400). It supports OpenGL ES 2.0. This library is required for 3D rendering using the GPU. This library is provided in binary by ARM.

Fig.1 LibMali(User Space Libraries for Mali)

Fig.1 LibMali(User Space Libraries for Mali)


Debian Package build procedure

This chapter describes the steps to create a Debian Package for libMali.

The repository generated by the procedure explained here is available at the following URL. If you have trouble creating a repository, please use the following repository.

LibMali is a binary library provided by Xilinx. It is not provided by source code. This article describes the steps to turn a binary-provided library into a Debian Package. The purpose of the Debian Package is to make it easier to install on Debian by packaging it.

We also have a pre-built libMali Debian Package in the following repositories: If you have trouble building, please use this.

Create a repository

shell$ mkdir libmali-zynqmp
shell$ cd libmali-zynqmp 
shell$ git init

Get a binary library

The binary library uses the library provided by Xilinx. Please refer to the following web page to accept the software license and then download mali-400-userspace.tar.

You can also download it by the following method. However, please accept the software license.

shell$ wget https://www.xilinx.com/publications/products/tools/mali-400-userspace.tar
--2019-12-08 21:39:58--  https://www.xilinx.com/publications/products/tools/mali-400-userspace.tar
-UUU:----F1  Readme.md<libmali-zynqmp>   49% L37   Git-master  (Fundamental) ---
HTTP request sent, awaiting response... 200 OK
Length: 572887040 (546M) [application/x-tar]
Saving to: ‘mali-400-userspace.tar’
mali-400-userspace. 100%[==================>] 546.35M  1.27MB/s    in 9m 2s
2019-12-24 16:54:47 (1.01 MB/s) - ‘mali-400-userspace.tar’ saved [572887040/572887040]

Extract mali / rel-v2019.1 / r8p0-01rel0 from mali-400-userspace.tar.

shell$ tar xf mali-400-userspace.tar mali/rel-v2019.1/r8p0-01rel0.tar
shell$ tar xf mali/rel-v2019.1/r8p0-01rel0.tar

Add files to create Debian Package

Create a debian directory and add the following files: These files are not described here. See https://github.com/ikwzm/libmali-zynqmp for more information.

Add a file for pkgconfig

The Debian Package for libMali development (libgbm-zynqmp-dev_1.6-3_arm64.deb and libmali-zynqmp-dev_1.6-3_arm64.deb) also includes files for pkgconfig. Add the file for pkgconfig to install. These files are not described here. See https://github.com/ikwzm/libmali-zynqmp for more information.

Add CMakeLists.txt

Use cmake when building the Debian Package. Add CMakeLists.txt for that.

Build Debian Package

The repository created by the procedure explained in the previous section is prepared at the following URL. If you have trouble creating a repository, please clone this repository.

https://github.com/ikwzm/libmali-zynqmp

Run debian / rule binary to build the Debian Package. The built package will be created in the directory one level above.

shell$ sudo debian/rule binary
	:
Omission

Installation

Introducing the Debian Package

This chapter describes the steps to install the X Window System with libMali on ZynqMP-FPGA-Linux.

The pre-built Debian Package is available in the following repositories. You can install this.

important point

When installing the libMali Debian Package, the order in which they are installed is important. This is because libMali's Debian Package partially overwrites the contents of the Debian Package, which is installed by default with the X Window System. I'm not very familiar with Debian Package, so I couldn't make a Debian Package that could be installed in one shot. Please note.

Installation procedure

Specifically, install it according to the following procedure.

  1. Install Mali Driver
  2. Install X Window System
  3. Install libMali
  4. Install the Video Driver (xserver-xorg-video-armsoc-xilinx)
  5. Edit xorg.conf
  6. Install development packages (if needed)

If you have already installed the X Window System, you must uninstall the X Window System once by following the steps below.

1. Install Mali Driver

The Mali Driver is a Kernel Module for controlling the GPU (Mali-400) installed in ZynqMP. See the following articles for installing the Mali Driver.

2. Install X Window System

Install the X Window System.

shell$  apt install x-window-system-core
	:
Omission

3. Install libMali

Install __ libMali after installing the X Window System. Install libMali's Debian Package in the following order.

shell$ sudo dpkg -i libmali-zynqmp_1.7-0_arm64.deb 
Selecting previously unselected package libmali-zynqmp:arm64.
(Reading database ... 85064 files and directories currently installed.)
Preparing to unpack libmali-zynqmp_1.7-0_arm64.deb ...
Unpacking libmali-zynqmp:arm64 (1.7-0) ...
Setting up libmali-zynqmp:arm64 (1.7-0) ...
Processing triggers for libc-bin (2.28-10) ...
shell$ sudo dpkg -i libegl1-zynqmp_1.7-0_arm64.deb 
Selecting previously unselected package libegl1-zynqmp:arm64.
(Reading database ... 85072 files and directories currently installed.)
Preparing to unpack libegl1-zynqmp_1.7-0_arm64.deb ...
Unpacking libegl1-zynqmp:arm64 (1.7-0) ...
Replacing files in old package libegl1:arm64 (1.1.0-1) ...
Setting up libegl1-zynqmp:arm64 (1.7-0) ...
shell$ sudo dpkg -i libgles1-zynqmp_1.7-0_arm64.deb 
Selecting previously unselected package libgles1-zynqmp:arm64.
(Reading database ... 85076 files and directories currently installed.)
Preparing to unpack libgles1-zynqmp_1.7-0_arm64.deb ...
Unpacking libgles1-zynqmp:arm64 (1.7-0) ...
Setting up libgles1-zynqmp:arm64 (1.7-0) ...
shell$ sudo dpkg -i libgles2-zynqmp_1.7-0_arm64.deb
Selecting previously unselected package libgles2-zynqmp:arm64.
(Reading database ... 85081 files and directories currently installed.)
Preparing to unpack libgles2-zynqmp_1.7-0_arm64.deb ...
Unpacking libgles2-zynqmp:arm64 (1.7-0) ...
Setting up libgles2-zynqmp:arm64 (1.7-0) ...
shell$ sudo dpkg -i libgbm1-zynqmp_1.7-0_arm64.deb
Selecting previously unselected package libgbm1-zynqmp:arm64.
(Reading database ... 85086 files and directories currently installed.)
Preparing to unpack libgbm1-zynqmp_1.7-0_arm64.deb ...
Unpacking libgbm1-zynqmp:arm64 (1.7-0) ...
Replacing files in old package libgbm1:arm64 (18.3.6-2) ...
Setting up libgbm1-zynqmp:arm64 (1.7-0) ...

4. Install the Video Driver (xserver-xorg-video-armsoc-xilinx)

Video Driver (xserver-xorg-video-armsoc-xilinx) is a DDX Driver (Video Driver) for X Window Server that supports ZynqMP. See the following articles for details.

xserver-xorg-video-armsoc-xilinx_1.4-1_arm64.deb using dpkg To install.

shell$ sudo dpkg -i xserver-xorg-video-armsoc-xilinx_1.4-1_arm64.deb
(Reading database ... 66644 files and directories currently installed.)
Preparing to unpack xserver-xorg-video-armsoc-xilinx_1.4-1_arm64.deb ...
Unpacking xserver-xorg-video-armsoc-xilinx (1.4-1) over (1.4-1) ...
Setting up xserver-xorg-video-armsoc-xilinx (1.4-1) ...
Processing triggers for man-db (2.8.5-2) ...

5. Edit xorg.conf

You must specify armsoc for the Driver property in the Device section of /etc/X11/xorg.conf.

/etc/X11/xorg.conf


Section "Device"
	Identifier	"ZynqMP"
	Driver		"armsoc"
	Option		"DEBUG"	"true"
EndSection
Section "Screen"
	Identifier	"DefaultScreen"
	Device		"ZynqMP"
EndSection

6. Install development packages (if needed)

If necessary, install the Debian Package for development.

shell$ sudo dpkg -i libmali-zynqmp-dev_1.7-0_arm64.deb 
Selecting previously unselected package libmali-zynqmp-dev:arm64.
(Reading database ... 85097 files and directories currently installed.)
Preparing to unpack libmali-zynqmp-dev_1.7-0_arm64.deb ...
Unpacking libmali-zynqmp-dev:arm64 (1.7-0) ...
Setting up libmali-zynqmp-dev:arm64 (1.7-0) ...
shell$ sudo dpkg -i libegl1-zynqmp-dev_1.7-0_arm64.deb 
Selecting previously unselected package libegl1-zynqmp-dev:arm64.
(Reading database ... 85101 files and directories currently installed.)
Preparing to unpack libegl1-zynqmp-dev_1.7-0_arm64.deb ...
Unpacking libegl1-zynqmp-dev:arm64 (1.7-0) ...
Setting up libegl1-zynqmp-dev:arm64 (1.7-0) ...
shell$ sudo dpkg -i libegl1-zynqmp-dev_1.7-0_arm64.deb 
(Reading database ... 85110 files and directories currently installed.)
Preparing to unpack libegl1-zynqmp-dev_1.7-0_arm64.deb ...
Unpacking libegl1-zynqmp-dev:arm64 (1.7-0) over (1.7-0) ...
Setting up libegl1-zynqmp-dev:arm64 (1.7-0) ...
shell$ sudo dpkg -i libgles2-zynqmp-dev_1.7-0_arm64.deb 
Selecting previously unselected package libgles2-zynqmp-dev:arm64.
(Reading database ... 85110 files and directories currently installed.)
Preparing to unpack libgles2-zynqmp-dev_1.7-0_arm64.deb ...
Unpacking libgles2-zynqmp-dev:arm64 (1.7-0) ...
Setting up libgles2-zynqmp-dev:arm64 (1.7-0) ...
shell$ sudo dpkg -i libgbm-zynqmp-dev_1.7-0_arm64.deb 
Selecting previously unselected package libgbm-zynqmp-dev:arm64.
(Reading database ... 85119 files and directories currently installed.)
Preparing to unpack libgbm-zynqmp-dev_1.7-0_arm64.deb ...
Unpacking libgbm-zynqmp-dev:arm64 (1.7-0) ...
Setting up libgbm-zynqmp-dev:arm64 (1.7-0) ...

Uninstall

Due to my lack of study, the Debian Package dependencies are disturbed. Therefore, when updating or uninstalling a package, it may fail. If this happens, it's better to uninstall the X Window System once. This section provides steps to uninstall the X Window System.

1. Purge xserver-xorg-core

First, purge xserver-xorg-core.

shell$ sudo apt purge xserver-xorg-core
	:
Omission

2. autopurge

Use autopurge to remove packages that depended on xserver-xorg-core.

shell$ sudo apt autopurge
	:
Omission

3. Uninstall libMali

Uninstall libmali-zynqmp and libgbm1-zynqmp.

shell$ sudo dpkg --purge libgbm1-zynqmp
(Reading database ... 55745 files and directories currently installed.)
Removing libgbm1-zynqmp:arm64 (1.6-3) ...
shell$ sudo dpkg --purge libmali-zynqmp
(Reading database ... 55741 files and directories currently installed.)
Removing libmali-zynqmp:arm64 (1.6-3) ...
Purging configuration files for libmali-zynqmp:arm64 (1.6-3) ...
Processing triggers for libc-bin (2.28-10) ...

Start-up

Log in as root and try starting with startx.

shell# startx &
	:
Omission

If you see X Windows on your display, you're good to go.

benchmark

I ran the benchmark with Video Driver + GPU. Please refer to the following page for details.

[Overview]: https://qiita.com/ikwzm/items/fdec04519268b3fb9a50 "" Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Overview) "@Qiita" [Video Driver Edition]: https://qiita.com/ikwzm/items/2a0fbfd2938a893e57d4 "" Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Video Driver Edition) "@Qiita" [Mali Driver Edition]: https://qiita.com/ikwzm/items/8c96d75e03cdcb91e5b2 "" Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Mali Driver Edition) "@Qiita" [LibMali edition]: https://qiita.com/ikwzm/items/85fa889def8eb07a9e94 "" Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (libMali edition) "@Qiita" [fbdev edition]: https://qiita.com/ikwzm/items/f922f7e17aa2382d5c76 "" Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (fbdev edition) "@Qiita" [glmark2 edition]: https://qiita.com/ikwzm/items/5065fb0b6c01ea706571 "" Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (glmark2 edition) "@ Qiita" [1]: https://qiita.com/ikwzm/items/0c6f110aa19e368af03d "Debian GNU / Linux for UltraZed / Ultra96 / Ultra96-V2 (v2019.1 version) Boot image provided" @Qiita "

Recommended Posts

Run X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (LibMali)
Run X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Video Driver)
Run X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Gnome Desktop)
Run X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Mali Driver)
Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (fbdev)
Running X Window on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Overview)
Run Lima Driver on Debian GNU / Linux for Ultra96 / Ultra96-V2
Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Installation)
Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Build)
Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Build) [Unfinished]
Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Installation) [Unfinished]
Run XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Vitis edition)
Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Overview)
Run bootgen on Debian GNU / Linux, Ubuntu
Debian GNU / Linux (v2019.2 version) boot image provided for UltraZed / Ultra96 / Ultra96-V2
Run Debian (Linux) & LXQt on Athlon 200GE (AMD)
Run Tensorflow 2.x on Python 3.7
Linux on Windows -1-: debian introduction
Run FreeBSD on Linux + qemu
Run a Linux server on GCP
Run vmware horizon client on Debian
[Note] Run Django on Amazon Linux 2
Run docker-compose on Amazon Linux2 on ARM64
pykintone on Windows Subsystem for Linux
Run cron on Amazon Linux (set on Linux)