Ubuntu 20.04.2 kernel 5.10.0-rc6 wayland and gpu questions


I cloned the fenix repository and build a mainline ubuntu focal minimal image, got it into the emmc as described here: Making Fenix images in Github

Now I’m trying to get wayland to work or xorg with at least some kind of hardware acceleration. As I understand from other posts about it, it should be more or less working with wayland. However, I can’t start anything with wayland, I’m starting to believe that maybe I’m missing a package or something.

Installed packages:

libegl-mesa0:arm64                   20.2.6-0ubuntu0.20.04.1
libegl1-mesa:arm64                   20.2.6-0ubuntu0.20.04.1
libgl1-mesa-dev:arm64                20.2.6-0ubuntu0.20.04.1
libgl1-mesa-dri:arm64                20.2.6-0ubuntu0.20.04.1
libgl1-mesa-glx:arm64                20.2.6-0ubuntu0.20.04.1
libglapi-mesa:arm64                  20.2.6-0ubuntu0.20.04.1
libgles2-mesa:arm64                  20.2.6-0ubuntu0.20.04.1
libglu1-mesa:arm64                   9.0.1-1build1
libglx-mesa0:arm64                   20.2.6-0ubuntu0.20.04.1
libwayland-egl1-mesa:arm64    20.2.6-0ubuntu0.20.04.1
mesa-opencl-icd:arm64            20.2.6-0ubuntu0.20.04.1 
mesa-utils                                  8.4.0-1build1
mesa-utils-extra                     8.4.0-1build1
mesa-va-drivers:arm64                20.2.6-0ubuntu0.20.04.1
mesa-vulkan-drivers:arm64            20.2.6-0ubuntu0.20.04.1
glmark2-wayland                      2014.03+git20150611.fa71af2d-0ubuntu7
libwayland-client0:arm64             1.18.0-1 
libwayland-cursor0:arm64             1.18.0-1 
libwayland-egl1:arm64                1.18.0-1
libwayland-egl1-mesa:arm64           20.2.6-0ubuntu0.20.04.1
libwayland-server0:arm64             1.18.0-1
libweston-8-0                        8.0.0-1
libwlroots5:arm64                    0.10.0-2
wayland-protocols                    1.20-1
weston                               8.0.0-1
linux-gpu-mali-fbdev                 1.0.2-r12p0

Kernel messages:

[    0.000000] irq_meson_gpio: 100 to 8 gpio interrupt mux initialized
[    0.211056] meson-pcie fc000000.pcie: get phy failed, -517
[    0.217064] soc soc0: Amlogic Meson G12B (A311D) Revision 29:b (10:2) Detected
[    0.219720] ff803000.serial: ttyAML0 at MMIO 0xff803000 (irq = 23, base_baud = 1500000) is a meson_uart
[    1.108953] ffd24000.serial: ttyAML6 at MMIO 0xffd24000 (irq = 30, base_baud = 1500000) is a meson_uart
[    1.218445] meson-gx-mmc ffe05000.sd: Got CD GPIO
[    1.218446] meson-gx-mmc ffe03000.sd: allocated mmc-pwrseq
[    1.218504] meson-gx-mmc ffe07000.mmc: allocated mmc-pwrseq
[    1.239420] meson-sm: secure-monitor enabled
[    1.344823] meson-pcie fc000000.pcie: host bridge /soc/pcie@fc000000 ranges:
[    1.349583] meson-pcie fc000000.pcie:       IO 0x00fc600000..0x00fc6fffff -> 0x0000000000
[    1.357665] meson-pcie fc000000.pcie:      MEM 0x00fc700000..0x00fdffffff -> 0x00fc700000
[    1.365780] meson-pcie fc000000.pcie: invalid resource
[    1.414674] meson-pcie fc000000.pcie: error: wait linkup timeout
[    1.562795] meson-pcie fc000000.pcie: error: wait linkup timeout
[    1.706308] meson-pcie fc000000.pcie: error: wait linkup timeout
[    1.847670] meson-pcie fc000000.pcie: error: wait linkup timeout
[    1.989039] meson-pcie fc000000.pcie: error: wait linkup timeout
[    2.130412] meson-pcie fc000000.pcie: error: wait linkup timeout
[    2.273866] meson-pcie fc000000.pcie: error: wait linkup timeout
[    2.415235] meson-pcie fc000000.pcie: error: wait linkup timeout
[    2.556608] meson-pcie fc000000.pcie: error: wait linkup timeout
[    2.697974] meson-pcie fc000000.pcie: error: wait linkup timeout
[    2.798337] meson-pcie fc000000.pcie: Phy link never came up
[    2.798373] meson-pcie fc000000.pcie: failed to initialize host
[    2.804220] meson-pcie fc000000.pcie: Add PCIe port failed, -110
[    2.861727] meson-drm ff900000.vpu: Queued 2 outputs on vpu
[    2.862060] meson-drm ff900000.vpu: CVBS Output connector not available
[    2.896216] meson-dw-hdmi ff600000.hdmi-tx: Detected HDMI TX controller v2.01a with HDCP (meson_dw_hdmi_phy)
[    2.902036] meson-dw-hdmi ff600000.hdmi-tx: registered DesignWare HDMI I2C bus driver
[    2.909125] meson-drm ff900000.vpu: bound ff600000.hdmi-tx (ops meson_dw_hdmi_ops)
[    2.915923] [drm] Initialized meson 1.0.0 20161109 for ff900000.vpu on minor 0
[    3.404370] meson-drm ff900000.vpu: [drm] fb0: mesondrmfb frame buffer device
[    3.413739] meson8b-dwmac ff3f0000.ethernet: IRQ eth_wake_irq not found
[    3.417973] meson8b-dwmac ff3f0000.ethernet: IRQ eth_lpi not found
[    3.424142] meson8b-dwmac ff3f0000.ethernet: PTP uses main clock
[    3.430957] meson8b-dwmac ff3f0000.ethernet: User ID: 0x11, Synopsys ID: 0x37
[    3.437105] meson8b-dwmac ff3f0000.ethernet: 	DWMAC1000
[    3.442278] meson8b-dwmac ff3f0000.ethernet: DMA HW capability register supported
[    3.449690] meson8b-dwmac ff3f0000.ethernet: RX Checksum Offload Engine supported
[    3.457109] meson8b-dwmac ff3f0000.ethernet: COE Type 2
[    3.462281] meson8b-dwmac ff3f0000.ethernet: TX Checksum insertion supported
[    3.469268] meson8b-dwmac ff3f0000.ethernet: Wake-Up On Lan supported
[    3.475714] meson8b-dwmac ff3f0000.ethernet: Normal descriptors
[    3.481521] meson8b-dwmac ff3f0000.ethernet: Ring mode enabled
[    3.487295] meson8b-dwmac ff3f0000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    3.501084] dwc3-meson-g12a ffe09000.usb: USB2 ports: 2
[    3.503773] dwc3-meson-g12a ffe09000.usb: USB3 ports: 0
[    3.902687] meson-vrtc ff8000a8.rtc: registered as rtc1

[    5.473934] meson_vdec: module is from the staging directory, the quality is unknown, you have been warned.
[    5.488148] rc rc0: meson-ir as /devices/platform/soc/ff800000.bus/ff808000.ir/rc/rc0
[    5.488243] rc rc0: lirc_dev: driver meson-ir registered at minor = 0, raw IR receiver, no transmitter
[    5.488299] input: meson-ir as /devices/platform/soc/ff800000.bus/ff808000.ir/rc/rc0/input4
[    5.489838] meson-ir ff808000.ir: receiver initialized
[    5.826845] meson8b-dwmac ff3f0000.ethernet eth0: PHY [0.0:00] driver [RTL8211F Gigabit Ethernet] (irq=40)
[    5.844110] meson8b-dwmac ff3f0000.ethernet eth0: No Safety Features support found
[    5.844118] meson8b-dwmac ff3f0000.ethernet eth0: PTP not supported by HW
[    5.844351] meson8b-dwmac ff3f0000.ethernet eth0: configuring for phy/rgmii link mode
[    5.438181] panfrost ffe40000.gpu: clock rate = 24000000
[    5.438238] panfrost ffe40000.gpu: dev_pm_opp_set_regulators: no regulator (mali) found: -19
[    5.452893] panfrost ffe40000.gpu: [drm:panfrost_devfreq_init [panfrost]] Failed to register cooling device
[    5.453085] panfrost ffe40000.gpu: mali-g52 id 0x7212 major 0x0 minor 0x0 status 0x0
[    5.453089] panfrost ffe40000.gpu: features: 00000000,13de77ff, issues: 00000000,00000400
[    5.453093] panfrost ffe40000.gpu: Features: L2:0x07110206 Shader:0x00000000 Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xff JS:0x7
[    5.453095] panfrost ffe40000.gpu: shader_present=0x3 l2_present=0x1
[    5.471300] [drm] Initialized panfrost 1.1.0 20180908 for ffe40000.gpu on minor 1

When I try to start wayland:

# glmark2-wayland
Error: main: Could not initialize canvas
Segmentation fault

And with sway:

2021-02-21 18:28:14 - [backend/session/logind.c:759] Failed to get seat id: No data available
2021-02-21 18:28:14 - [backend/session/direct-ipc.c:35] Do not have CAP_SYS_ADMIN; cannot become DRM master
2021-02-21 18:28:14 - [backend/session/session.c:96] Failed to load session backend
2021-02-21 18:28:14 - [backend/backend.c:286] Failed to start a DRM session
2021-02-21 18:28:14 - [sway/server.c:47] Unable to create backend

I can start X, but when I start firefox I get:
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL initialize failed (t=0.990011) [GFX1-]: glxtest: libEGL initialize failed

(It starts tho)

glmark2-es2 also fails with:

Error: eglGetDisplay() failed with error: 0x3000
Error: eglGetDisplay() failed with error: 0x3000
Error: main: Could not initialize canvas

I had the impression that wayland was/is better than xorg, but I just can’t seem to get it working. Am I missing a package or should I try to compile something from git? if so what would it be?

My main goal here is just to get as much of it working as possible, I can just use X as it is, but it seems that I’m not getting as much as this hardware can provide, if possible, I’d like to close that gap.

@clort76 could you help out here ?

@manuel-arguelles Hello , you just need to build a image with fenix . Don’t need to reinstall mesa , glmark2-es2 work fine .

khadas@17303c8fbbc7:~/fenix$ source env/setenv.sh 

Choose Khadas board:
1. Edge
2. VIM1
3. VIM2
4. VIM3
5. VIM3L

Which board would you like? [2] 4

Choose uboot version:
1. uboot-2015.01
2. uboot-mainline

Which uboot version would you like? [1] 2

Choose linux version:
1. linux-mainline

Which linux version would you like? [1] 1

Choose distribution:
1. Ubuntu
2. Debian

Which distribution would you like? [1] 1

Choose Ubuntu release:
1. bionic
2. focal

Which Ubuntu release would you like? [1] 2

Choose Ubuntu type:
1. server
2. minimal
3. xfce
4. lxde
5. gnome

Which Ubuntu type would you like? [1] 5

Set architecture to 'arm64' by default.

Choose install type:

Which install type would you like? [1] 1
#VERSION: 1.0.1



Environment setup done.
Type 'make' to build.


That’s exactly what I did, the image was built and is here: Update main.yml · manuel-arguelles/fenix@a0a1b2e · GitHub

However, the only difference is that your is gnome and I choose minimal, that’s why I thought that maybe I’m missing some packages (there’s no wayland nor xorg in the minimal version).

I guess I could try to go over the build scripts and try to spot the difference.

In the meantime and since you have it already running, could you please paste your lsmod output? Thanks

Please use the gnome configurations. You can’t install gnome desktop based on the minimal image. There are mamy packages need to be installed, and you CAN NOT use the original mesa packages. There are many work need to do if you don’t use Fenix to build the gnome image. If you want to know what need to do, please check the Fenix source code.

When I try to start wayland:

# glmark2-wayland

I’m a bit confused by your post:

  • glmark2-wayland does not start wayland, it runs under wayland
  • the # prompt seems to indicate you are launching glmark2 as root. I don’t think it’s advisable to run glmark2 as root. I start wayfire as user and run glmark2 benchmarks as user.

I’m afraid I can’t think of any more helpful feedback. Sorry for the late reply.

Thanks @clort76 and @numbqq, and sorry for the late reply. Just for closure, I built an image of ubuntu focal with mainline kernel/u-boot minimal.

I went with minimal installation because I’m not a xfce, kde nor gnome user. Going with the gnome version and then remove the packages that I don’t want doesn’t seem right to me. I prefer to start with a minimal installation and then add what I use.

After checking the fenix build scripts I realized that the gpu packages are not installed for minimal nor server versions. But the scripts are very well done, nicely ordered and navigating around them was a pleasant experience.

What I was missing were the recent mesa packages, I just installed them all from @numbqq repository at mesa_debs/focal/arm64/mesa at master · numbqq/mesa_debs · GitHub and after that sway started nicely and so far it seems to be going just fine.

I haven’t used it much (due to lack of time), still need to install a bunch of packages.

Anyways, thanks for the support and for Fenix, it’s very cool and the idea of building everything from a docker container was brilliant!