Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Post Reply
firxworx
Posts: 7
Joined: Fri Jan 11, 2019 1:27 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by firxworx » Fri Jan 11, 2019 2:05 am

Hi everyone, new XU4 user here. My project is building a kiosk that uses Chromium in --kiosk mode for the UI.

The issue is Chromium is not using hardware acceleration. CSS3 animations are choppy and dog slow (these are key to our use-case). WebGL examples are not supported (of technical note but not key to our use-case).

I have spent an evening scouring the forums and couldn't find any good answers that are current or are relevant to the latest Ubuntu release. Please note I'm a web developer w/ linux experience as far as web servers go but I am by no means a hardware/kernel/drivers/hardware/etc guy... so I'm stuck at present.

I do note that the MATE version of Ubuntu promises hardware accelerated Chromium and product promotion pics include a screenshot of the browser successfully running the aquarium WebGL example... What the heck are they doing differently that's so key? How do I get that performance starting from the ideal minimal install?

Graphics Drivers

mali-fbdev - The wiki download page for "20181203-minimal" says that "Mali GPU driver for framebuffer(fbdev) can be installed with apt install mali-fbdev". If I try to install this package there is no benefit, and when trying to startx + chromium, it works, but when closing it out there are errors in the Terminal about missing files re the driver. I wish I could paste here (TBD) but subsequent troubleshooting changed the original output from what I first saw (I could replicate if needbe, please ask).

mali-x11 - I read in the forums that the mali-X11 drivers work better for Chromium so I tried removing the mali-fbdev and installing those instead (I don't think the uninstall vs. install worked perfectly - there are now numerous errors regarding missing files re drivers, etc). Importantly, the apt package does try to do something with the "odroid" user (which my system doesn't have -- the minimal install starts with root and I added a user with a different name) because there's an error output from usermod that says this user isn't found. If anyone knows what's up there, that'd be appreciated. Chromium ran a little better with mali-X11 with slightly smoother CSS3 animations but they were still choppy, and webGL and other things didn't work. I'm not getting anything close to what should be possible.

Here's my setup

Installed OS Image:

https://wiki.odroid.com/odroid-xu4/os_i ... 03-minimal

Installed packages for x (note: I'm not married to x per se, just need the kiosk to work well):

* xserver-xorg-video-all
* xserver-xorg-input-all
* xserver-xorg-core
* xinit
* x11-xserver-utils
* xinput

Installed packages for chromium:

* chromium-browser
* unclutter (hide mouse cursor)

How I'm starting chromium

For now, I'm starting Chromium via a shell script that runs the following (I would later turn this into a systemd service):

Code: Select all

#!/bin/sh
/usr/bin/startx /etc/X11/Xsession /home/$KIOSK/startchromium.sh -- :0
Key parts of startchromium.sh follow:

Code: Select all

#!/bin/sh

# temp 
KIOSK=$(whoami)

# disable automatic system standby that would disrupt display
xset -dpms
xset s off
xset s noblank

# hide the mouse cursor
unclutter -idle 0 -root &

# run chromium-browser (landscape)
chromium-browser /home/$KIOSK/test.html \
  --kiosk \
  --window-size=1920,1080 \
  --window-position=0,0 \
  --start-fullscreen \
  --incognito \
  --noerrdialogs \
  --disable-translate \
  --no-first-run \
  --fast \
  --fast-start \
  --disable-infobars \
  --overscroll-history-navigation=0 \
  --disable-pinch \
  --disable-features=TranslateUI,TouchpadOverscrollHistoryNavigation \
  --disable-breakpad \
  --disable-popup-blocking \
  --disk-cache-dir=/dev/null 
Per other forum comments (including this one from odroid re a C2 not XU4: viewtopic.php?p=209196#p209196), I tried adding the following flags but these didn't seem to have any noticeable performance impact:

Code: Select all

  --use-gl=egl \
  --ignore-gpu-blacklist \
  --num-raster-threads=4 \
I also tried adding the following flag with the above 3x but that combination also didn't work. If anything the CSS3 animations got slower (but it might just have been too late last night and that's just my perception :shock: )

Code: Select all

  
  --disable-accelerated-2d-canvas 
Some threads mention copying or symlinking certain drivers-related files to folders within the Chromium install, but I don't seem to have the files mentioned in any of those comments.

Another set of comments suggested I can't startx with startx, but I'm not sure why. IIRC they were using lightdm. If anyone has any ideas how to best start a graphical environment (not necessarily X) with Chromium and have hardware acceleration there, I'm all ears! :) :)

If we can reach a good solution, I'm happy to write up a tutorial/guide on what to do. Thanks!

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 15 times
Been thanked: 16 times
Contact:

Re: Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by mad_ady » Fri Jan 11, 2019 2:14 am

The minimal image is missing some key components needed for X acceleration. The quickest solution is to try the mate version and compare performance to see what you can expect.
You should start by testing if egl is supported under your X. Run glmark2-es2 and see if you're using mali and not mesa, and also see if you get a decent fps. Next inside chromium about:flags see if egl is enabled.

firxworx
Posts: 7
Joined: Fri Jan 11, 2019 1:27 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by firxworx » Fri Jan 11, 2019 2:35 am

OK looks like I'm going to have to start with a fresh image.

All my installs/uninstalls re drivers have mucked things up and all I get is "MESA LOADER: failed to retrieve device information", "gbm: failed to open any driver ...", and a "gbm: Last dlopen error: /usr/lib/dri/exynos_dri.so..." which always appeared no matter what and I understand is benign.

First things first though -- which of the two drivers should I attempt to use? mali-fbdev or mali-x11 ?? I'm going to guess mali-x11 simply because its the only one that offered any performance difference in my earlier tests, though I'd appreciate clarity from someone who knows better.

Please standby while I re-image the thing.

I can start chromium with --use-gl=egl, presumably that will set the flag. When I get it running, I'll check chromium and advise.

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 15 times
Been thanked: 16 times
Contact:

Re: Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by mad_ady » Fri Jan 11, 2019 3:32 am

Since you're using a x11 environment you'll need mali-x11. You'd need the other one only if you were to compile chromium with fbdev support (not sure if it's possible)

firxworx
Posts: 7
Joined: Fri Jan 11, 2019 1:27 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by firxworx » Fri Jan 11, 2019 9:07 am

Makes sense re drivers. When asking which ones I was curious to see if someone would recommend an environment other than X11 such as Wayland (which I've never used before) and if in that case I should try those. I'm definitely not married to X11 as long as Chromium works w/ hardware acceleration.

glmark2-es2 -- Failed to Run

I installed mali-x11 and glmark2-es2 on a fresh minimal image. On its own, glmark2-es2 will not run: "Error: main: Could not initialize canvas", which makes sense without X or anything running.

If I try to run it like this: /usr/bin/startx /etc/X11/Xsession glmark2-es2 -- :0 the screen blacks out for a second and then returns to the console with a bunch of info, the last line reads:

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.hs /usr/lib/arm-linux/gnueabihf/dri:${ORIGIN}/dri:/usr/lib/dri)gbm: Last dlopen error: /usr/lib/dri/exynos_dri.so: cannot open shared object file: N

I'm guessing the line is cut off there at "N"... Is there a better way to initialize x to get this to run?

BTW if I try starting Chromium using the exact method as my original post then it opens and runs fine (just with really slow CSS animations, no webgl, etc)

firxworx
Posts: 7
Joined: Fri Jan 11, 2019 1:27 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by firxworx » Sat Jan 12, 2019 5:08 am

Updates:

I installed Ubuntu MATE image and can confirm that the chromium browser has hardware acceleration. That tells me this is definitely possible!

In inspected the setup a bit and tried to replicate some of what I found on the minimal image. In /usr/lib/chromium I created the following symlinks to the mali drivers:

Code: Select all

libEGL.so -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
libEGL.so.org -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
libGLESv2.so -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
libGLESv2.so.org -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
I now start chromium with the flags --usegl=gl --ignore-gpu-blacklist --disable-accelerated-2d-canvas --num-raster-threads=2.

I still cannot get hardware acceleration, but the --usegl=egl flag results significantly faster performance with CSS animation, as it now defaults to software acceleration. Whatever it was thinking before that is dog slow.

chrome://gpu results

In chrome://gpu the feedback I get for pretty much everything is: Software only. Hardware acceleration disabled. Multiple raster threads are Disabled despite the CLI flag.

The Driver Information section is empty. There's nothing running right now. The Log Messages show that eglInitialize fails and the GPU process exits:

Code: Select all

[6052:6052:0111/033002.058868:ERROR:gl_surface_egl.cc(952)] : eglInitialize Default failed with error EGL_NOT_INITIALIZED
[6052:6052:0111/033002.059057:ERROR:gl_initializer_x11.cc(154)] : GLSurfaceEGL::InitializeOneOff failed.
GpuProcessHostUIShim: The GPU process exited with code 1024.
New packages

I'm not sure of the purpose/value of everything however I installed:

[*] mesa-utils, mesa-utils-extra (to get es2gears which I can't get to run if the GPU process is crashing)
[*] xserver-xorg-video-armsoc

And just in case they're of value, these packages that I noticed were installed on the desktop version: mesa-utils, mesa-utils-extra, mesa-va-drivers, mesa-vdpau-drivers.

X log results

I have a feeling the answer lies in here.

Are there other packages that I should install? There are some permissions issues noted in the logs, but I'm not sure how to resolve? Do I need to create more symlinks between folders to allow drivers to be visible? Are there other permissions/folder-access issues on the system?

Code: Select all

...
[   166.081] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_31
[   166.083] (II) xfree86: Adding drm device (/dev/dri/card0)
[   166.083] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 11 paused 0
[   166.084] (II) no primary bus or device found
[   166.084] 	falling back to /sys/devices/platform/exynos-drm/drm/card0
[   166.084] (II) LoadModule: "glx"
[   166.084] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   166.087] (II) Module glx: vendor="X.Org Foundation"
[   166.087] 	compiled for 1.19.6, module version = 1.0.0
[   166.087] 	ABI class: X.Org Server Extension, version 10.0
[   166.087] (II) LoadModule: "armsoc"
[   166.087] (II) Loading /usr/lib/xorg/modules/drivers/armsoc_drv.so
[   166.088] (II) Module armsoc: vendor="X.Org Foundation"
[   166.088] 	compiled for 1.19.6, module version = 1.4.1
[   166.088] 	Module class: X.Org Video Driver
[   166.088] 	ABI class: X.Org Video Driver, version 23.0
[   166.088] (II) ARMSOC: Driver for ARM Mali compatible chipsets
[   166.088] (WW) Falling back to old probe method for armsoc
[   166.088] (II) No BusID or DriverName specified - opening /dev/dri/card0
[   166.088] (EE) ERROR: Cannot set the DRM interface version.
[   166.088] (EE) ERROR: Cannot open a connection with the DRM - Permission denied
[   166.088] (WW) Falling back to old probe method for armsoc
[   166.088] (II) No BusID or DriverName specified - opening /dev/dri/card0
[   166.088] (EE) ERROR: Cannot set the DRM interface version.
[   166.088] (EE) ERROR: Cannot open a connection with the DRM - Permission denied
[   166.088] (EE) No devices detected.
[   166.088] (==) Matched modesetting as autoconfigured driver 0
[   166.088] (==) Matched fbdev as autoconfigured driver 1
[   166.088] (==) Assigned the driver to the xf86ConfigLayout
[   166.088] (II) LoadModule: "modesetting"
[   166.088] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[   166.089] (II) Module modesetting: vendor="X.Org Foundation"
[   166.089] 	compiled for 1.19.6, module version = 1.19.6
[   166.089] 	Module class: X.Org Video Driver
[   166.089] 	ABI class: X.Org Video Driver, version 23.0
[   166.089] (II) LoadModule: "fbdev"
[   166.089] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[   166.089] (II) Module fbdev: vendor="X.Org Foundation"
[   166.089] 	compiled for 1.19.3, module version = 0.4.4
[   166.089] 	Module class: X.Org Video Driver
[   166.089] 	ABI class: X.Org Video Driver, version 23.0
[   166.089] (II) ARMSOC: Driver for ARM Mali compatible chipsets
[   166.089] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[   166.089] (II) FBDEV: driver for framebuffer: fbdev
[   166.089] (WW) Falling back to old probe method for armsoc
[   166.089] (EE) ERROR: Did not find any matching device section in configuration file
[   166.089] (II) modeset(0): using drv /dev/dri/card0
[   166.089] (WW) Falling back to old probe method for fbdev
[   166.089] (II) Loading sub module "fbdevhw"
[   166.089] (II) LoadModule: "fbdevhw"
[   166.090] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[   166.090] (II) Module fbdevhw: vendor="X.Org Foundation"
[   166.090] 	compiled for 1.19.6, module version = 0.0.2
[   166.090] 	ABI class: X.Org Video Driver, version 23.0
[   166.090] (EE) open /dev/fb0: Permission denied
[   166.090] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[   166.090] (II) modeset(0): Creating default Display subsection in Screen section
	"Default Screen Section" for depth/fbbpp 24/32
[   166.090] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[   166.090] (==) modeset(0): RGB weight 888
[   166.090] (==) modeset(0): Default visual is TrueColor
[   166.090] (II) Loading sub module "glamoregl"
[   166.090] (II) LoadModule: "glamoregl"
[   166.090] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[   166.098] (II) Module glamoregl: vendor="X.Org Foundation"
[   166.098] 	compiled for 1.19.6, module version = 1.0.0
[   166.098] 	ABI class: X.Org ANSI C Emulation, version 0.4
[   166.098] (II) glamor: OpenGL accelerated X.org driver based.
[   166.163] (EE) modeset(0): eglGetDisplay() failed
[   166.165] (EE) modeset(0): glamor initialization failed
[   166.165] (II) modeset(0): ShadowFB: preferred NO, enabled NO
[   166.212] (II) modeset(0): Output HDMI-1 has no monitor section
[   166.257] (II) modeset(0): EDID for output HDMI-1
[   166.258] (II) modeset(0): Manufacturer: ELO  Model: 2293  Serial#: 13484
[   166.258] (II) modeset(0): Year: 2018  Week: 31
[   166.258] (II) modeset(0): EDID Version: 1.3
[   166.258] (II) modeset(0): Digital Display Input
[   166.258] (II) modeset(0): Max Image Size [cm]: horiz.: 48  vert.: 27
[   166.258] (II) modeset(0): Gamma: 2.20
[   166.258] (II) modeset(0): DPMS capabilities: Off
[   166.258] (II) modeset(0): Supported color encodings: RGB 4:4:4 YCrCb 4:4:4 

... 
...

[   166.259] (II) Loading sub module "fb"
[   166.259] (II) LoadModule: "fb"
[   166.260] (II) Loading /usr/lib/xorg/modules/libfb.so
[   166.260] (II) Module fb: vendor="X.Org Foundation"
[   166.260] 	compiled for 1.19.6, module version = 1.0.0
[   166.260] 	ABI class: X.Org ANSI C Emulation, version 0.4
[   166.260] (II) UnloadModule: "armsoc"
[   166.260] (II) Unloading armsoc
[   166.260] (II) UnloadModule: "fbdev"
[   166.260] (II) Unloading fbdev
[   166.260] (II) UnloadSubModule: "fbdevhw"
[   166.260] (II) Unloading fbdevhw
...
Thanks to those willing to help. I can tell from the forums I'm not the only user over the years that's wished to run Chromium w/ hardware acceleration on a minimal install. It doesn't seem like there's been any success. If someone with the right GPU/hardware/driver knowledge swings by, it would be great to crack this nut with the latest 18.04 Ubuntu image!
Last edited by firxworx on Sat Jan 12, 2019 5:41 am, edited 1 time in total.

firxworx
Posts: 7
Joined: Fri Jan 11, 2019 1:27 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by firxworx » Sat Jan 12, 2019 5:39 am

Also noting that after I ALT+F4 out of Chromium and return to the console I can see the output:

gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:${ORIGIN}/dri:/usr/lib/dri)

I have confirmed that there are drivers at /usr/lib/arm-linux-gnueabihf, see output below:

Code: Select all

root@odroid:/etc/X11# ls -la /usr/lib/arm-linux-gnueabihf/ | grep mali
lrwxrwxrwx  1 root root       48 Jan 10 23:34 libEGL.so -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
lrwxrwxrwx  1 root root       48 Jan 10 23:34 libEGL.so.1 -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
lrwxrwxrwx  1 root root       48 Jan 10 23:34 libEGL.so.1.0.0 -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
lrwxrwxrwx  1 root root       48 Jan 10 23:34 libGLESv1_CM.so -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
lrwxrwxrwx  1 root root       48 Jan 10 23:34 libGLESv2.so -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
lrwxrwxrwx  1 root root       48 Jan 10 23:34 libOpenCL.so -> /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so
drwxr-xr-x  2 root root     4096 Jan 10 23:34 mali-egl
There's more but it gets cut off, something related to "failed to load driver: exynos". I don't think the system has anything related to that, and there's nothing in /usr/lib/arm-linux-gnueabihf that has "exynos" in it, so I'm not sure where x is getting that from to want to load it.

Finally, it looks like the xorg.conf and xorg.conf.d/ contents are the same between my minimal and desktop install, unless I'm missing something there.

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 15 times
Been thanked: 16 times
Contact:

Re: Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by mad_ady » Sat Jan 12, 2019 3:58 pm

[ 166.088] (II) No BusID or DriverName specified - opening /dev/dri/card0
[ 166.088] (EE) ERROR: Cannot set the DRM interface version.
[ 166.088] (EE) ERROR: Cannot open a connection with the DRM - Permission denied
The desktop image has some special rules in /etc/udev/rules.d/* that among other things set rw rights on /dev/mali, /dev/card/dri and friends.
Try transplanting that file and check if glmark2-es2 works.

firxworx
Posts: 7
Joined: Fri Jan 11, 2019 1:27 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by firxworx » Tue Jan 15, 2019 9:23 am

OK so the /etc/udev/rules.d has the following on a minimal install:

Code: Select all

root@odroid:/etc/udev/rules.d# cat 10-odroid.rules
KERNEL=="mali",SUBSYSTEM=="misc",MODE="0777"
KERNEL=="mali0",SUBSYSTEM=="misc",MODE="0777"
KERNEL=="ump",SUBSYSTEM=="ump",MODE="0777"
KERNEL=="ttySAC0", SYMLINK+="ttyACM99"
KERNEL=="event*", SUBSYSTEM=="input", MODE="0777"
KERNEL=="CEC", MODE="0777"
KERNEL=="cec*", MODE="0777"
KERNEL=="amvideo", MODE="0666"
KERNEL=="amstream*", MODE="0666"
/dev contains one /dev/mali0 and it looks like that's covered permission-wise re the above.

I booted up an SD with the Mate desktop and incidentally the /etc/udev/rules.d/10-odroid.rules file is identical.

I wonder if DRM is included in the kernel, random googling resulted in this: https://github.com/mripard/sunxi-mali/issues/45

Anyone got any ideas for next steps?

===

I also noticed there's no screen rotation inside Ubuntu Mate where I can get the hardware acceleration in Chrome. The dropdown option in the Mate Display app is only for normal. I'm wondering if that's a problem where even if I get hardware acceleration running with mali in chromium, I'll only be able to use landscape orientation. That's sufficient for one but not both use-cases I have.

I'm wondering if Android has as many of these issues with the video/GPU drivers, and if I should be moving towards loading the UI for the kiosk inside an Android WebView...

User avatar
mad_ady
Posts: 5668
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 15 times
Been thanked: 16 times
Contact:

Re: Ubuntu 18.04 minimal - Chromium - no hardware acceleration / GPU

Unread post by mad_ady » Tue Jan 15, 2019 5:40 pm

As far as I remember the xu4 doesn't have accelerated rotation support under linux, so if that's a requirement, try Android instead.

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 0 guests