WorkingTipsOnUpgradingSG1DriverCentOS1810.qcow2

VM

Import new image:

/images/2022_08_29_10_25_29_498x422.jpg

Name it:

/images/2022_08_29_10_26_09_467x332.jpg

Upgrade kernel to 4.19.12:

$ ls
kernel-4.19.12-1.x86_64.rpm  kernel-devel-4.19.12-1.x86_64.rpm  kernel-headers-4.19.12-1.x86_64.rpm  kmod-ukmd-4.19.12-20212.el7.x86_64.rpm
$ rpm -ivh *.rpm
$ vi /etc/default/grub
Changed to 4.19.12 kernel
$ grub2-mkconfig -o /boot/grub2/grub.cfg 
$ sudo reboot

Change the repository using iso:

# mount /dev/sr0 /mnt
# cat /etc/yum.repos.d/local.repo
[local]
name=local
baseurl=file:///mnt
enabled=1
gpgcheck=0
# yum makecache

Using official install-sg1.sh for installing to 4.19.112 kernel for fetching the dependencies.

Merge steps

安装官方驱动的过程中会编译出相应的文件,需要按照以下步骤进行更改:

# mkdir /root/merge
# cp /root/rpmbuild/SRPMS/kmod-ukmd-4.19.112-20413.el7.centos.src.rpm /root/merge
# cd /root/merge
# mkdir kmod-ukmd-4.19.12.cpio
# cd kmod-ukmd-4.19.12.cpio
# rpm2cpio ../kmod-ukmd-4.19.112-20413.el7.centos.src.rpm | cpio -idmv
# ls
dg1_dmc_ver2_02.bin  dg1_guc_49.0.1.bin  dg1_huc_7.9.5.bin  kmod.spec  kmod-ukmd-4.19.112.tar.gz
# tar xzvf kmod-ukmd-4.19.112.tar.gz
# mv kmod-ukmd-4.19.112 kmod-ukmd-4.19.12
# vim kmod.spec 
Change 4.19.112->4.19.12
# vim kmod-ukmd-4.19.12/kmod.spec
Change 4.19.112->4.19.12
# cp /usr/src/kernels/4.19.12/drivers/gpu/drm/drm_edid.c kmod-ukmd-4.19.12/orig/drivers/gpu/drm/
# cp /usr/src/kernels/4.19.12/drivers/gpu/drm/drm_probe_helper.c kmod-ukmd-4.19.12/orig/drivers/gpu/drm/
# cp /usr/src/kernels/4.19.12/drivers/gpu/drm/drm_vblank.c kmod-ukmd-4.19.12/orig/drivers/gpu/drm/
# mv kmod-ukmd-4.19.112.tar.gz /tmp
# tar czvf kmod-ukmd-4.19.12.tar.gz kmod-ukmd-4.19.12
# rm -rf kmod-ukmd-4.19.12
# ls
dg1_dmc_ver2_02.bin  dg1_guc_49.0.1.bin  dg1_huc_7.9.5.bin  kmod.spec  kmod-ukmd-4.19.12.tar.gz
# cd ..
# tar czvf kmod-ukmd-4.19.12.cpio.tar.gz kmod-ukmd-4.19.12.cpio
# ls
kmod-ukmd-4.19.112-20413.el7.centos.src.rpm  kmod-ukmd-4.19.12.cpio  kmod-ukmd-4.19.12.cpio.tar.gz
# mv /root/rpmbuild/SOURCES/ /root/rpmbuild/SOURCES.back && mkdir -p /root/rpmbuild/SOURCES/
# cp -ar /root/merge/kmod-ukmd-4.19.12.cpio/* /root/rpmbuild/SOURCES
# cd /root/rpmbuild/SOURCES
# vim /usr/src/kernels/4.19.12/include/linux/math64.h
在文件末尾倒数第二行添加
.....
    #endif /* mul_u64_u32_div */
    +++++ #define DIV64_U64_ROUND_UP(ll, d)	\
    +++++	({ u64 _tmp = (d); div64_u64((ll) + _tmp - 1, _tmp); })
    
    #endif /* _LINUX_MATH64_H */

# rpmbuild -bb kmod.spec
# ls /root/rpmbuild/RPMS/x86_64
kmod-ukmd-4.19.12-20413.el7.centos.x86_64.rpm

Verification

Install any 4.19.12 kernel, test the package kmod-ukmd-4.19.12-20413.el7.centos.x86_64.rpm.

$ ls /dev/dri/
card0  renderD128
$ lsmod | grep i915
i915_spi               20480  0 
mtd                    57344  5 i915_spi
i915                 1933312  0 
drm_ukmd_kms_helper   188416  1 i915
drm_ukmd              495616  3 drm_ukmd_kms_helper,i915
drm_ukmd_compat        98304  3 drm_ukmd_kms_helper,i915,drm_ukmd
video                  40960  1 i915
i2c_algo_bit           16384  1 i915
cec                    45056  1 i915
mfd_core               16384  2 lpc_ich,i915

Examine the kernel demsg:

$ sudo dmesg | grep drm
[sudo] password for ctctest: 
[    7.776406] drm: loading out-of-tree module taints kernel.
[    7.800836] Initialized drm/i915 compat module 20160105
[    7.892916] [drm] i915 backporting
[    7.893701] [drm] Intel graphics LMEM: [mem 0x00000000-0x1fb7fffff]
[    7.893702] [drm] Intel graphics LMEM IO start: a00000000
[    7.893702] [drm] Intel graphics LMEM size: 1fb800000
[    7.893714] [drm] Intel graphics stolen LMEM: [mem 0x1fc000000-0x1ffffffff]
[    7.893714] [drm] Intel graphics stolen LMEM IO start: bfc000000
[    7.895015] i915 0000:07:00.0: [drm] Couldn't get system memory bandwidth
[    7.895053] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    7.895054] [drm] Driver supports precise vblank timestamp query.
[    7.971850] i915 0000:07:00.0: [drm] Finished loading DMC firmware i915/dg1_dmc_ver2_02.bin (v2.2)
[    7.994442] [drm] GuC communication enabled
[    7.999403] i915 0000:07:00.0: [drm] GuC firmware i915/dg1_guc_49.0.1.bin version 49.0 submission:disabled
[    7.999405] i915 0000:07:00.0: [drm] HuC firmware i915/dg1_huc_7.9.5.bin version 7.9 authenticated:yes
[    8.001958] [drm] Initialized i915 1.6.0 20220718-8a58be7 for 0000:07:00.0 on minor 0
[    8.003950] i915 0000:07:00.0: [drm] Cannot find any crtc or sizes

BenchmarkOnSG1

Start the redroid via:

# docker run -itd --name redroid4cores --memory-swappiness=0 --privileged   -p 5556:5555 --cpuset-cpus 0-3 -v /root/cpus/present:/sys/devices/system/cpu/present -v /root/cpus/online:/sys/devices/system/cpu/online -v /root/cpus/possible:/sys/devices/system/cpu/possible redroid12:latest redroid.fps=120 ro.sf.lcd_density=240 redroid.width=1080 redroid.height=1920 redroid.gpu.mode=host redroid.gpu.node=/dev/dri/renderD128 androidboot.use_memfd=1
fe847de1c10fd9f28a358257b1c90c22884535a6d14c8867136bceea77cf140c
root@ctctest-UniServer-R4900-G3:~# docker exec -it redroid4cores sh
fe847de1c10f:/ # setprop sys.use_memfd 1 

/images/2022_08_26_11_10_15_585x711.jpg

Remove the other 3 socs:

# rm -rf /dev/dri/renderD129 /dev/dri/renderD130 /dev/dri/renderD131 
# rm -rf /dev/dri/card1 /dev/dri/card2 /dev/dri/card3

Rerun the benchmark, still the same:

/images/2022_08_26_11_17_06_590x521.jpg

Remove the device:

# echo 1 > /sys/bus/pci/devices/0000:b8:00.0/remove
# echo 1 > /sys/bus/pci/devices/0000:c2:00.0/remove
# echo 1 > /sys/bus/pci/devices/0000:bd:00.0/remove

System hang.

Using udev for removing the socs:

# cat /etc/udev/rules.d/removesg1.rules 
ACTION=="add", KERNEL=="0000:b8:00.0", SUBSYSTEM=="pci", RUN+="/bin/sh -c 'echo 1 > /sys/bus/pci/devices/0000:b8:00.0/remove'"
ACTION=="add", KERNEL=="0000:bd:00.0", SUBSYSTEM=="pci", RUN+="/bin/sh -c 'echo 1 > /sys/bus/pci/devices/0000:bd:00.0/remove'"
ACTION=="add", KERNEL=="0000:c2:00.0", SUBSYSTEM=="pci", RUN+="/bin/sh -c 'echo 1 > /sys/bus/pci/devices/0000:c2:00.0/remove'"

Examine the graphical cards:

# lspci | grep -i vga
0000:05:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 41)
0000:b3:00.0 VGA compatible controller: Intel Corporation Device 4907 (rev 01)

render nodes:

# ls /dev/dri/
by-path  card0  renderD128
# ls /dev/dri/by-path/ -l
total 0
lrwxrwxrwx 1 root root  8 8月  26 11:49 pci-0000:b3:00.0-card -> ../card0
lrwxrwxrwx 1 root root 13 8月  26 11:49 pci-0000:b3:00.0-render -> ../renderD128

Rerun the testing:

/images/2022_08_26_11_57_38_588x761.jpg

Another machine

/images/2022_08_26_12_21_46_584x203.jpg

Turbo boost mode(avd) comparision:

non-turbo boost

/images/2022_08_26_12_35_07_372x255.jpg

turbo boost(sg1):

/images/2022_08_26_12_41_30_373x417.jpg

Turbo boot (t4):

/images/2022_08_26_12_48_07_525x494.jpg

vnc(best perf mode):

/images/2022_08_26_15_00_35_589x281.jpg

no vnc(best perf mode), no scrcpy:

/images/2022_08_26_15_06_44_595x985.jpg

scrcpy with 15fps:

/images/2022_08_26_15_22_06_528x261.jpg

scrcpy with 5fps:

/images/2022_08_26_15_27_03_528x285.jpg

no scrcpy again:

/images/2022_08_26_15_31_56_534x261.jpg

t4 with scrcpy:

/images/2022_08_26_15_39_49_1029x473.jpg

ampere t4 with scrcpy:

/images/2022_08_26_15_49_37_480x918.jpg

Performance:

cpupower frequency-set -g performance

ampere t4 without scrcpy:

/images/2022_08_26_16_58_06_469x380.jpg

should upgrade to oibaf? upgrading to stable.

sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade

Next week, upgrading to 5.19.3

Even on 5.19.3, benchmark is very bad:

/images/2022_08_29_11_37_21_502x253.jpg

SG1OnArchLinux2

Installation

After install arch system, install packages:

# pacman -S gnome libva-mesa-driver  mesa-demos mesa-utils mesa-vdpau opencl-mesa vulkan-intel vulkan-mesa-layers vulkan-radeon adriconf awesome x11vnc net-tools

List all of the sg socs:

# lspci | grep -i vga
0000:05:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 41)
0000:b3:00.0 VGA compatible controller: Intel Corporation SG1 [Server GPU SG-18M] (rev 01)
0000:b8:00.0 VGA compatible controller: Intel Corporation SG1 [Server GPU SG-18M] (rev 01)
0000:bd:00.0 VGA compatible controller: Intel Corporation SG1 [Server GPU SG-18M] (rev 01)
0000:c2:00.0 VGA compatible controller: Intel Corporation SG1 [Server GPU SG-18M] (rev 01)

List all of the render nodes:

# ls /dev/dri/
by-path  card0	card1  card2  card3  card4  renderD128	renderD129  renderD130	renderD131
# ls /dev/dri/by-path/ -l
lrwxrwxrwx 1 root root  8 Aug 25 08:30 pci-0000:05:00.0-card -> ../card0
lrwxrwxrwx 1 root root  8 Aug 25 08:30 pci-0000:b3:00.0-card -> ../card1
lrwxrwxrwx 1 root root 13 Aug 25 08:30 pci-0000:b3:00.0-render -> ../renderD128
lrwxrwxrwx 1 root root  8 Aug 25 08:30 pci-0000:b8:00.0-card -> ../card2
lrwxrwxrwx 1 root root 13 Aug 25 08:30 pci-0000:b8:00.0-render -> ../renderD129
lrwxrwxrwx 1 root root  8 Aug 25 08:30 pci-0000:bd:00.0-card -> ../card3
lrwxrwxrwx 1 root root 13 Aug 25 08:30 pci-0000:bd:00.0-render -> ../renderD130
lrwxrwxrwx 1 root root  8 Aug 25 08:30 pci-0000:c2:00.0-card -> ../card4
lrwxrwxrwx 1 root root 13 Aug 25 08:30 pci-0000:c2:00.0-render -> ../renderD131

Benchmark

Create xorg:

[root@archsg1 ~]# cat /etc/X11/xorgintel.conf 
Section "Device"
    Identifier     "Device[179]"
    #BusID          "PCI:0@0:179:0"
    BusID          "PCI:179:0:0"
    VendorName     "Intel"
    BoardName      "DG1"
#    Option "AllowEmptyInitialConfiguration"
EndSection
Section "ServerFlags"
    Option "Debug" "dmabuf_capable"
EndSection
# Xorg :179 -config /etc/X11/xorgintel.conf

glmark2:

# export DISPLAY=:179
[root@archsg1 ~]# glmark2
=======================================================
    glmark2 2021.12
=======================================================
    OpenGL Information
    GL_VENDOR:     Intel
    GL_RENDERER:   Mesa Intel(R) Graphics (SG1)
    GL_VERSION:    4.6 (Compatibility Profile) Mesa 22.1.6
=======================================================
[build] use-vbo=false: FPS: 1825 FrameTime: 0.548 ms
[build] use-vbo=true: FPS: 2154 FrameTime: 0.464 ms
[texture] texture-filter=nearest: FPS: 2132 FrameTime: 0.469 ms
[texture] texture-filter=linear: FPS: 2150 FrameTime: 0.465 ms
[texture] texture-filter=mipmap: FPS: 2155 FrameTime: 0.464 ms
[shading] shading=gouraud: FPS: 2047 FrameTime: 0.489 ms
[shading] shading=blinn-phong-inf: FPS: 2044 FrameTime: 0.489 ms
[shading] shading=phong: FPS: 2041 FrameTime: 0.490 ms
[shading] shading=cel: FPS: 2040 FrameTime: 0.490 ms
[bump] bump-render=high-poly: FPS: 1753 FrameTime: 0.570 ms
[bump] bump-render=normals: FPS: 2252 FrameTime: 0.444 ms
[bump] bump-render=height: FPS: 2248 FrameTime: 0.445 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 1774 FrameTime: 0.564 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 1764 FrameTime: 0.567 ms
[pulsar] light=false:quads=5:texture=false: FPS: 1880 FrameTime: 0.532 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 1221 FrameTime: 0.819 ms
[desktop] effect=shadow:windows=4: FPS: 1425 FrameTime: 0.702 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 384 FrameTime: 2.604 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 1136 FrameTime: 0.880 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 481 FrameTime: 2.079 ms
[ideas] speed=duration: FPS: 1672 FrameTime: 0.598 ms
[jellyfish] <default>: FPS: 1423 FrameTime: 0.703 ms
[terrain] <default>: FPS: 435 FrameTime: 2.299 ms
[shadow] <default>: FPS: 1719 FrameTime: 0.582 ms
[refract] <default>: FPS: 924 FrameTime: 1.082 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 1906 FrameTime: 0.525 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 1904 FrameTime: 0.525 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 1904 FrameTime: 0.525 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 1905 FrameTime: 0.525 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 1903 FrameTime: 0.525 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 1903 FrameTime: 0.525 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 1904 FrameTime: 0.525 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 1902 FrameTime: 0.526 ms
=======================================================
                                  glmark2 Score: 1706 
=======================================================

Kernel change

Building kernel will takes more than 30 minutes….. Before makepkg, change the -j items in order to use maximum hardware capability.
Install asp for building kernel:

# pacman -S base-devel asp
# asp checkout linux-zen
# vim repos/extra-x86_64/config
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"

# cd repos/extra-x86_64
$ ls
config  keys  PKGBUILD
$ makepkg --clean --syncdeps --rmdeps

Docker binding cpus

Create the cpu cores definition file:

[root@archsg1 cpus]# cp present possible
[root@archsg1 cpus]# cp present online
[root@archsg1 cpus]# cat present 
0-3

Run with:

docker run -itd --name redroid4cores --memory-swappiness=0 --privileged   -p 5556:5555 --cpuset-cpus 0-3 -v /root/cpus/present:/sys/devices/system/cpu/present -v /root/cpus/online:/sys/devices/system/cpu/online -v /root/cpus/possible:/sys/devices/system/cpu/possible redroid12:latest redroid.fps=120 ro.sf.lcd_density=240 redroid.width=1080 redroid.height=1920 redroid.gpu.mode=host redroid.gpu.node=/dev/dri/renderD128 androidboot.use_memfd=1

with lxcfs:

 docker run -itd --name numa1 --memory-swappiness=0 --privileged   -p 5557:5555 -m 8192m --cpus=8 --cpuset-cpus="80-87" --cpuset-mems="1" --memory="8192M" -v /root/cpus1/present:/sys/devices/system/cpu/present -v /root/cpus1/online:/sys/devices/system/cpu/online -v /root/cpus1/possible:/sys/devices/system/cpu/possible -v /var/lib/lxcfs/proc/cpuinfo:/proc/cpuinfo:rw -v /var/lib/lxcfs/proc/diskstats:/proc/diskstats:rw  -v /var/lib/lxcfs/proc/meminfo:/proc/meminfo:rw -v /var/lib/lxcfs/proc/uptime:/proc/uptime:rw -v /var/lib/lxcfs/proc/stat:/proc/stat:rw redroid12:latest redroid.fps=120 ro.sf.lcd_density=240 redroid.width=1080 redroid.height=1920 redroid.gpu.mode=host redroid.gpu.node=/dev/dri/renderD130 androidboot.use_memfd=1

Limite memory:

root@sg1desktopubuntu2004:~# free -g
              total        used        free      shared  buff/cache   available
Mem:             60           7          52           0           0          52
Swap:             1           0           1
root@sg1desktopubuntu2004:~# cat /proc/cmdline 
BOOT_IMAGE=/boot/vmlinuz-5.19.3-051903-generic root=UUID=c255524f-5692-457c-a0b6-d465e0b32707 ro quiet splash i915.force_probe=* modprobe.blacklist=ast,snd_hda_intel i915.enable_guc=2 drm_kms_helper.edid_firmware=edid/1920x1080.bin video=HDMI-A-1:e video=HDMI-A-5:e video=HDMI-A-9:e video=HDMI-A-13:e mem=65535M

RebuildPPAKernelImages

ppa kernel

Install ppa kernel on ubuntu20.04 via:

add-apt-repository ppa:tuxinvader/lts-mainline -y
apt update -y
apt-get install -y linux-generic-5.19

After reboot, check the kernel via:

# uname -r
5.19.3-051903-generic

Customization of Kernel

uncomment the deb-srcfor ppa:

# cat /etc/apt/sources.list.d/tuxinvader-ubuntu-lts-mainline-focal.list 
deb http://ppa.launchpad.net/tuxinvader/lts-mainline/ubuntu focal main
deb-src http://ppa.launchpad.net/tuxinvader/lts-mainline/ubuntu focal main
# apt update

Get the source code:

# apt install linux-source-5.19.3
# ls /usr/src/linux-source-5.19.3/
debian  debian.master  linux-source-5.19.3.tar.bz2

Get the build-dep for kernel:

# apt build-dep linux-generic-5.19
# apt build-dep linux-doc

Prepare the build tree:

# cd /usr/src/linux-source
# bunzip2 linux-source-5.19.3.tar.bz2
# tar xf linux-source-5.19.3.tar
# mv linux-source-5.19.3/* .
# mkdir debian/stamps

Build via:

# fakeroot debian/rules clean
# fakeroot debian/rules editconfigs
# fakeroot debian/rules binary-headers binary-generic binary-perarch

build will take sometimes, so drink a cup of H~~~ot tea and wait.

Check the built result:

# ls /usr/src/*.deb
/usr/src/linux-buildinfo-5.19.3-051903-generic_5.19.3-051903.202208220846_amd64.deb
/usr/src/linux-headers-5.19.3-051903_5.19.3-051903.202208220846_all.deb
/usr/src/linux-headers-5.19.3-051903-generic_5.19.3-051903.202208220846_amd64.deb
/usr/src/linux-image-unsigned-5.19.3-051903-generic_5.19.3-051903.202208220846_amd64.deb
/usr/src/linux-modules-5.19.3-051903-generic_5.19.3-051903.202208220846_amd64.deb

Benchmark

glmark2 result:

# uname -r
5.19.3-051903-generic
# export DISPLAY=:179
# glmark2
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Intel
    GL_RENDERER:   Mesa Intel(R) Graphics (SG1)
    GL_VERSION:    4.6 (Compatibility Profile) Mesa 22.2.0-devel (git-e8fc5cc 2022-06-22 focal-oibaf-ppa)
=======================================================
.........
=======================================================
                                  glmark2 Score: 2886 
=======================================================

SG1Benchmark

Environment

Before upgrading the mesa:

root@sg1ubuntuzen:/home/intel# dpkg -l | grep mesa
ii  libegl-mesa0:amd64                         21.2.6-0ubuntu0.1~20.04.2             amd64        free implementation of the EGL API -- Mesa vendor library
ii  libgl1-mesa-dri:amd64                      21.2.6-0ubuntu0.1~20.04.2             amd64        free implementation of the OpenGL API -- DRI modules
ii  libglapi-mesa:amd64                        21.2.6-0ubuntu0.1~20.04.2             amd64        free implementation of the GL API -- shared library
ii  libglu1-mesa:amd64                         9.0.1-1build1                         amd64        Mesa OpenGL utility library (GLU)
ii  libglx-mesa0:amd64                         21.2.6-0ubuntu0.1~20.04.2             amd64        free implementation of the OpenGL API -- GLX vendor library
ii  mesa-vulkan-drivers:amd64                  21.2.6-0ubuntu0.1~20.04.2             amd64        Mesa Vulkan graphics drivers
root@sg1ubuntuzen:/home/intel# uname -a
Linux sg1ubuntuzen 5.19.3-zen-3c77c0f552c7+ #1 ZEN SMP PREEMPT_DYNAMIC Mon Aug 22 14:00:01 CST 2022 x86_64 x86_64 x86_64 GNU/Linu

Ludashi:

/images/2022_08_23_09_52_38_1051x926.jpg

Detailed result:

/images/2022_08_23_09_52_55_995x236.jpg

Second result:

/images/2022_08_23_09_57_44_1050x344.jpg

glmark2 result:

root@sg1ubuntuzen:/home/intel# export DISPLAY=:179
root@sg1ubuntuzen:/home/intel# glmark2
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa/X.org
    GL_RENDERER:   llvmpipe (LLVM 12.0.0, 256 bits)
    GL_VERSION:    3.1 Mesa 21.2.6
=======================================================
** GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
** Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=false:^C

Upgrade mesa

Methods:

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt update
sudo apt upgrade

mesa infos:

root@sg1ubuntuzen:/home/intel# dpkg -l | grep -i mesa
ii  libegl-mesa0:amd64                         22.2~git2206220600.e8fc5c~oibaf~f     amd64        free implementation of the EGL API -- Mesa vendor library
ii  libgl1-mesa-dri:amd64                      22.2~git2206220600.e8fc5c~oibaf~f     amd64        free implementation of the OpenGL API -- DRI modules
ii  libglapi-mesa:amd64                        22.2~git2206220600.e8fc5c~oibaf~f     amd64        free implementation of the GL API -- shared library
ii  libglu1-mesa:amd64                         9.0.1-1build1                         amd64        Mesa OpenGL utility library (GLU)
ii  libglx-mesa0:amd64                         22.2~git2206220600.e8fc5c~oibaf~f     amd64        free implementation of the OpenGL API -- GLX vendor library
ii  mesa-vulkan-drivers:amd64                  22.2~git2206220600.e8fc5c~oibaf~f     amd64        Mesa Vulkan graphics drivers

glmark2 result:

# glmark2
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Intel
    GL_RENDERER:   Mesa Intel(R) Graphics (SG1)
    GL_VERSION:    4.6 (Compatibility Profile) Mesa 22.2.0-devel (git-e8fc5cc 2022-06-22 focal-oibaf-ppa)
=======================================================
[build] use-vbo=false: FPS: 2485 FrameTime: 0.402 ms
[build] use-vbo=true: FPS: 3636 FrameTime: 0.275 ms
[texture] texture-filter=nearest: FPS: 3686 FrameTime: 0.271 ms
[texture] texture-filter=linear: FPS: 3559 FrameTime: 0.281 ms
[texture] texture-filter=mipmap: FPS: 3566 FrameTime: 0.280 ms
[shading] shading=gouraud: FPS: 3408 FrameTime: 0.293 ms
[shading] shading=blinn-phong-inf: FPS: 3243 FrameTime: 0.308 ms
[shading] shading=phong: FPS: 3339 FrameTime: 0.299 ms
[shading] shading=cel: FPS: 2886 FrameTime: 0.347 ms
[bump] bump-render=high-poly: FPS: 2402 FrameTime: 0.416 ms
[bump] bump-render=normals: FPS: 3683 FrameTime: 0.272 ms
[bump] bump-render=height: FPS: 3702 FrameTime: 0.270 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 3085 FrameTime: 0.324 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 2311 FrameTime: 0.433 ms
[pulsar] light=false:quads=5:texture=false: FPS: 3521 FrameTime: 0.284 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 2026 FrameTime: 0.494 ms
[desktop] effect=shadow:windows=4: FPS: 2605 FrameTime: 0.384 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 601 FrameTime: 1.664 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 1237 FrameTime: 0.808 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 637 FrameTime: 1.570 ms
[ideas] speed=duration: FPS: 2594 FrameTime: 0.386 ms
[jellyfish] <default>: FPS: 2947 FrameTime: 0.339 ms
[terrain] <default>: FPS: 531 FrameTime: 1.883 ms
[shadow] <default>: FPS: 2982 FrameTime: 0.335 ms
[refract] <default>: FPS: 1276 FrameTime: 0.784 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 3301 FrameTime: 0.303 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 3383 FrameTime: 0.296 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 3302 FrameTime: 0.303 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 3402 FrameTime: 0.294 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 3435 FrameTime: 0.291 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 3280 FrameTime: 0.305 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 3423 FrameTime: 0.292 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 3431 FrameTime: 0.291 ms
=======================================================
                                  glmark2 Score: 2815 
=======================================================

avd benchmark

Result(with x11vnc on):

/images/2022_08_23_11_17_35_422x832.jpg

Without x11vnc:

/images/2022_08_23_11_22_04_390x804.jpg

Kernel upgrading

vfio in linux-zen, performance is bad.

# git clone git://mirrors.ustc.edu.cn/linux.git
# cd linux/
# git checkout tags/v5.19.3 -b 5.19.3

To be continued