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

SG1OnArchLinux

Steps

Install sddm:

# pacman -S sddm xorg

After reboot, examine the kernel and the sg1 pci infos:

[root@archvfio ~]# lspci | grep -i vga
00:01.0 VGA compatible controller: Red Hat, Inc. Virtio GPU (rev 01)
07:00.0 VGA compatible controller: Intel Corporation SG1 [Server GPU SG-18M] (rev 01)
[root@archvfio ~]# uname -a
Linux archvfio 5.19.1-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 11 Aug 2022 16:06:13 +0000 x86_64 GNU/Linux

Add virtio gpu into blacklist:

# vim /etc/modprobe.d/blacklist.conf
   # blacklist virtio_gpu

Didn’t take effects, change the graphical to qxl and added blacklist qxl:

/images/2022_08_15_14_23_35_535x518.jpg

Take effects:

[root@archvfio ~]# lsmod | grep qxl
[root@archvfio ~]# ls /dev/dri/
by-path  card0	renderD128

Examine the sg1 connected info:

for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done
DP-1: disconnected
DP-2: disconnected
DP-3: disconnected
HDMI-A-1: disconnected
HDMI-A-2: disconnected
HDMI-A-3: disconnected
HDMI-A-4: disconnected

Edit the Xorg configuration files and start the benchmark:

# cat /etc/X11/xorgintel.conf 
Section "Device"
    Identifier     "Device[0]"
    BusID          "PCI:7:0:0"
    VendorName     "Intel"
    BoardName      "DG1"
    Option "AllowEmptyInitialConfiguration"
EndSection
Section "ServerFlags"
    Option "Debug" "dmabuf_capable"
EndSection
Section "Monitor"
    Identifier   "Monitor0"
    VendorName   "Monitor Vendor"
    ModelName    "Monitor Model"
    Option   "IgnoreEDID"
EndSection
# Xorg :179 -config /etc/X11/xorgintel.conf
# ps -ef | grep -i xorg
root         841     526  0 14:27 tty2     00:00:00 /usr/lib/Xorg :179 -config /etc/X11/xorgintel.conf
root         877     873  0 14:28 pts/1    00:00:00 grep -i xorg

testing

Install x11vnc and glmark2 for benchmarking:

# vim /etc/pacman.conf
[archlinuxcn]
#The Chinese Arch Linux communities packages.
SigLevel = Never
Server   = http://repo.archlinuxcn.org/$arch
# pacman -Sy
# pacman -S x11vnc glmark2
[root@archvfio ~]# export DISPLAY=:179
[root@archvfio ~]# 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
=======================================================

glmark2 result:

=======================================================
    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: 2386 FrameTime: 0.419 ms
[build] use-vbo=true: FPS: 3112 FrameTime: 0.321 ms
[texture] texture-filter=nearest: FPS: 3262 FrameTime: 0.307 ms
[texture] texture-filter=linear: FPS: 3452 FrameTime: 0.290 ms
[texture] texture-filter=mipmap: FPS: 3493 FrameTime: 0.286 ms
[shading] shading=gouraud: FPS: 3056 FrameTime: 0.327 ms
[shading] shading=blinn-phong-inf: FPS: 3070 FrameTime: 0.326 ms
[shading] shading=phong: FPS: 2990 FrameTime: 0.334 ms
[shading] shading=cel: FPS: 3129 FrameTime: 0.320 ms
[bump] bump-render=high-poly: FPS: 2409 FrameTime: 0.415 ms
[bump] bump-render=normals: FPS: 3495 FrameTime: 0.286 ms
[bump] bump-render=height: FPS: 3393 FrameTime: 0.295 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 2885 FrameTime: 0.347 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 2300 FrameTime: 0.435 ms
[pulsar] light=false:quads=5:texture=false: FPS: 3424 FrameTime: 0.292 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 1861 FrameTime: 0.537 ms
[desktop] effect=shadow:windows=4: FPS: 2431 FrameTime: 0.411 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 769 FrameTime: 1.300 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 1275 FrameTime: 0.784 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 824 FrameTime: 1.214 ms
[ideas] speed=duration: FPS: 3128 FrameTime: 0.320 ms
[jellyfish] <default>: FPS: 2708 FrameTime: 0.369 ms
[terrain] <default>: FPS: 509 FrameTime: 1.965 ms
[shadow] <default>: FPS: 2664 FrameTime: 0.375 ms
[refract] <default>: FPS: 1041 FrameTime: 0.961 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 3226 FrameTime: 0.310 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 3035 FrameTime: 0.329 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 2974 FrameTime: 0.336 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 3014 FrameTime: 0.332 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 3047 FrameTime: 0.328 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 3250 FrameTime: 0.308 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 3050 FrameTime: 0.328 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 3293 FrameTime: 0.304 ms
=======================================================
                                  glmark2 Score: 2665 
=======================================================

Unigen valley benchmark:

# export DISPLAY=:179
[root@archvfio ~]# x11vnc
###############################################################
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@                                                           @#
#@  **  WARNING  **  WARNING  **  WARNING  **  WARNING  **   @#
#@                                                           @#
#@        YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!!        @#
#@                                                           @#
#@  This means anyone with network access to this computer   @#


On another terminal:  
[root@archvfio ~]# export DISPLAY=:179
[root@archvfio ~]# cd Unigine_Valley-1.0/
[root@archvfio Unigine_Valley-1.0]# ls
bin  data  documentation  valley
[root@archvfio Unigine_Valley-1.0]# ./valley 

/images/2022_08_15_14_42_10_965x786.jpg

valley cannot start in default resolution, changes edid and set the default resolution to 1920x1080:

# vim /etc/default/grub
........
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet drm_kms_helper.edid_firmware=edid/1920x1080.bin video=HDMI-A-1:e"
........
# grub-mkconfig -o /boot/grub/grub.cfg

Valley result:

/images/2022_08_15_14_57_02_518x465.jpg

Benchmark results:
Time:	189.067
Frames:	8108
FPS:	42.8842
Min FPS:	25.3772
Max FPS:	71.5901
Score:	1794.28

Ubuntu sg1

Update and upgrade system(based on desktop iso):

# apt update && apt upgrade && apt install openssh-server vim glmark2 x11vnc && ufw disable && systemctl disable gdm && reboot
# vim /etc/modprobe.d/blacklist.conf
.......
blacklist qxl

Using linux-zen kernel:

Install the linux-zen via:    
# sudo add-apt-repository ppa:damentz/liquorix && sudo apt-get update
# sudo apt-get install linux-image-liquorix-amd64 linux-headers-liquorix-amd64

root@dash-Standard-PC-Q35-ICH9-2009:/home/dash# ls /dev/dri/
by-path  card0  renderD128
root@dash-Standard-PC-Q35-ICH9-2009:/home/dash# uname -a
Linux dash-Standard-PC-Q35-ICH9-2009 5.19.0-1.1-liquorix-amd64

Create Xorg via:

tobe added

Issue: not started:

error: Kernel is too old for Iris. Consider upgrading to kernel v4.16.

Ubuntu20.04 sg1

Install the kernel provided by intel, then:

# ln -s /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so /usr/lib64/dri/swrast_dri.so
# ln -s /usr/lib/x86_64-linux-gnu/dri/kms_swrast_dri.so /usr/lib64/dri/kms_swrast_dri.so
# ln -s /usr/local/lib/x86_64-linux-gnu/dri/iris_dri.so /usr/lib64/dri/iris_dri.so
# export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:/usr/local/lib64/dri:/usr/lib64/:/usr/lib64/dri:$LD_LIBRARY_PATH
# export MESA_LOADER_DRIVER_OVERRIDE=iris
# Xorg :179 -config /etc/X11/xorgintel.conf 
    X.Org X Server 1.20.13
    X Protocol Version 11, Revision 0
    Build Operating System: linux Ubuntu
    Current Operating System: Linux virtio-vga-node 5.4.48-3c77c0f552c7+ #1 SMP Fri Jan 15 13:26:42 UTC 2021 x86_64
    Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.48-3c77c0f552c7+ root=UUID=a10af00c-1048-4629-bfd7-e7aa7f2b4866 ro quiet splash vt.handoff=7
    Build Date: 14 December 2021  02:14:13PM
    xorg-server 2:1.20.13-1ubuntu1~20.04.2 (For technical support please see http://www.ubuntu.com/support) 
    Current version of pixman: 0.38.4
    	Before reporting problems, check http://wiki.x.org
    	to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    	(++) from command line, (!!) notice, (II) informational,
    	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.179.log", Time: Tue Aug 16 09:38:50 2022
    (++) Using config file: "/etc/X11/xorgintel.conf"
    (==) Using system config directory "/usr/share/X11/xorg.conf.d"
    (II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
    MESA: warning: Driver does not support the 0x4907 PCI ID.
    (II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
    MESA: warning: Driver does not support the 0x4907 PCI ID.

In another terminal , run glmark2:

# export DISPLAY=:179
# glmark2

UniValley result:

Time:   189.107
Frames: 7131
FPS:    37.7089
Min FPS:        19.6125
Max FPS:        68.0576
Score:  1577.74