VirtIOGPUBenchmarkComparisonCN

1. 硬件信息

内存速度通过sudo dmidecode --type 17来检测
平台 1(i7 9代机器, 4核8线程,32G内存):

CPU: Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
Memory: MemTotal: 32709264 kB, 2666 MT/s

平台 2(i5 4代机器,4核4线程,32G内存):

CPU: Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz
Memory: MemTotal: 32808212 kB, 1600 MT/s 

测试中使用同一块sata ssd:

Disk 1: Crucial 500GB sata ssd. 

测试显卡信息, 一块为WX5100 8G, 一块为5700 xt 8G(检测命令为 lspci | grep -i vga):

Card1: VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] (rev c4)
Card2: VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon Pro WX 5100]

2. 系统/软件信息

列举如下:

$ cat /etc/issue
Ubuntu 20.04.4 LTS \n \l
$ uname -a
Linux hope 5.4.0-120-generic #136-Ubuntu SMP Fri Jun 10 13:40:48 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ qemu-system-x86_64 --version
QEMU emulator version 6.0.0 (Debian 1:6.0+dfsg-2expubuntu1~focal1.0)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
$ dpkg -l | grep -i virgl
ii  libvirglrenderer-dev:amd64                 0.8.2-1ubuntu1.1                      amd64        virtual GPU for KVM virtualization - headers
ii  libvirglrenderer1:amd64                    0.8.2-1ubuntu1.1                      amd64        virtual GPU for KVM virtualization

软件信息:

Unigine_Heaven-4.0
Unigine_Valley-1.0
glmark2
Redroid(Android 12)
scrcpy

3. 桌面场景测试

测试样例目的描述简要结论
3.1 裸机对比(WX5100)裸机opengl及游戏场景对比-WX5100因WX5100算力一般,i5/i7表现差别不大
3.2 裸机对比(5700xt)裸机opengl及游戏场景对比-5700xti5平台成为测试中瓶颈位
3.3 Virgl On i5-4460(WX5100)Virgl 性能对比 - i5-4460+WX5100glmark为主机的31.3%,因WX5100算力一般,游戏场景下Virgl未出现明显损耗
3.4 Virgl On i7-9700K(WX5100)Virgl 性能对比 - i7-9700K+WX5100glmark为主机的44.2%,因WX5100算力一般,游戏场景下Virg未出现明显折损,平台算力能提升OpenGL算力
3.5 Virgl On i5-4460(5700xt)Virgl 性能对比 - i5-4460+5700xtglmark为主机的21%,1080P场景下为裸机的55%~60%, 4K场景下为裸机的87%
3.6 Virgl On i7-9700K(5700xt)Virgl 性能对比 - i7-9700K+5700xtglmark为主机的19%,1080P场景下为裸机的55%~60%, 4K场景下为裸机的83%

3.1 裸机对比(WX5100)

i5-4460i7-9700K
glmark29140, 9117, 91179730, 9651, 9660
Unigine_Valley FPS43, 42.4, 42.345.6, 45.0, 45.0
Unigine_Valley Score1800, 1773, 17691906, 1884, 1884
Unigine_Heaven FPS44.846.9
Unigine_Heaven Score11301182

结论:

  1. i5/i7平台上,WX5100表现基本一致。
  2. 因WX5100算力比较一案,i5-4代没有成为测试中的瓶颈位。

3.2 裸机对比(5700xt)

i5-4460i7-9700K
glmark213950, 14165, 1431522134, 22256, 22150
Unigine_Valley FPS105, 103.1, 102.9168.7, 169.1, 168.5
Unigine_Valley Score4391, 4315, 43047057, 7068, 7043
Unigine_Heaven FPS167.0171.1
Unigine_Heaven Score42064311
Unigine_Heaven FPS(4k)4342.8
Unigine_Heaven Score(4k)10831077

结论:

  1. 5700xt在i7平台上运行远比i5平台上流畅,4代i5平台无法发挥5700xt的算力特性,具体表现为:glmark2跑分差距较大,Unigine valley帧率相差较大(1080场景下掉了约70帧),4K下表现一致。
  2. 显卡选型时需充分考虑CPU/内存等平台算力特性。

3.3 Virgl On i5-4460(WX5100)

i5-4460Virgl on i5-4460
glmark29140, 9117, 91172892, 2859, 2827
Unigine_Valley FPS43, 42.4, 42.340.8, 40.5, 40.6
Unigine_Valley Score1800, 1773, 17691707, 1694, 1699
Unigine_Heaven FPS44.842.2
Unigine_Heaven Score11301062

结论:

  1. glmark2: Virgl跑分约为裸机的31.3%。
  2. Unigine场景跑分: Virgl性能并未出现明显折损,因为WX5100本身算力一般, CPU足够支撑virgl转码开销。

3.4 Virgl On i7-9700K(WX5100)

i7-9700KVirgl on i7-9700K
glmark29730, 9651, 96604274, 4262, 4320
Unigine_Valley FPS45.6, 45.0, 45.042.3, 41.6, 41.5
Unigine_Valley Score1906, 1884, 18841770, 1740, 1737
Unigine_Heaven FPS46.941.9
Unigine_Heaven Score11821055

结论:

  1. glmark2: Virgl 约为裸机跑分的44.2%。
  2. Unigine场景跑分: Virgl性能并未出现明显折损,因为WX5100本身算力一般, CPU足够支撑virgl转码开销。
  3. 提升平台算力(CPU,内存等)有助于提升opengl转码效率(对比3.3场景下glmark2跑分).

3.5 Virgl On i5-4460(5700xt)

i5-4460Virgl on i5-4460
glmark213950, 14165, 143152916, 3174, 2832
Unigine_Valley FPS105, 103.1, 102.961, 61.9, 60.9
Unigine_Valley Score4391, 4315, 43042551, 2588, 2548
Unigine_Heaven FPS167.089.7
Unigine_Heaven Score42062271
Unigine_Heaven FPS(4k)4337.8
Unigine_Heaven Score(4k)1083951

结论:

  1. glmark2: Virgl约为裸机的21%。
  2. Unigine Valley/Unigine Heaven: Virgl约为裸机跑分的55%~60%, 但在4K场景下,Virgl为裸机的87%。

3.6 Virgl On i7-9700K(5700xt)

i7-9700KVirgl on i7-9700K
glmark222134, 22256, 221504152, 4256, 4238
Unigine_Valley FPS168.7, 169.1, 168.591.6, 91.5, 91.4
Unigine_Valley Score7057, 7068, 70433831, 3829, 3825
Unigine_Heaven FPS171.185.3
Unigine_Heaven Score43112149
Unigine_Heaven FPS(4k)42.835.6
Unigine_Heaven Score(4k)1077896

结论:

  1. glmark2: Virgl约为裸机的19%。
  2. Unigine Valley/Unigine Heaven: Virgl约为裸机跑分的55%~60%, 但在4K场景下,Virgl为裸机的83%。

4. Android 场景

硬件平台跑分(开启scrcpy)跑分(不开启scrcpy)
i7-9700K+5700xt616521(剑侠山谷: 309760 , 禅院悟道: 306761)617133(剑侠山谷: 310050, 禅院悟道: 307083)
Virgl on (i7-9700K+5700xt)442043(剑侠山谷: 223850 , 禅院悟道: 218193)564343(剑侠山谷: 289202, 禅院悟道:275141)
i5-4460+5700xt384564(剑侠山谷: 112763 , 禅院悟道: 221801)592030(剑侠山谷: 283705, 禅院悟道: 308255)
Virgl on (i5-4460+5700xt)227747(剑侠山谷: 108206 , 禅院悟道: 119541)445234(剑侠山谷: 214831, 禅院悟道:230403)
i7-9700K+WX5100567503(剑侠山谷: 265995 , 禅院悟道: 301508)585720(剑侠山谷: 277133, 禅院悟道: 308587)
Virgl on (i7-9700K+WX5100)412764(剑侠山谷: 210150 , 禅院悟道: 202614)499942(剑侠山谷: 257037, 禅院悟道: 242905)
i5-4460+WX5100401626(剑侠山谷: 166695 , 禅院悟道: 234931)572952(剑侠山谷: 267744, 禅院悟道: 305208)
Virgl on (i5-4460+WX5100)225837(剑侠山谷: 106071 , 禅院悟道: 119766)445202(剑侠山谷: 211450, 禅院悟道:233752)

结论:

  1. 鲁大师跑分极限: 约为60+万分,跑分时支持的最大分辨率为1080p(待确认)?
  2. scrcpy开启与否会影响跑分结果: 尤其在低端CPU上跑分下降尤为明显。
  3. 当GPU算力不至于成为瓶颈的场景下,virgl在安卓下渲染的跑分可以达到裸机极限跑分的: 90% (i7-9700K + 5700xt)
  4. WX5100可能成为跑分的性能瓶颈的场景下, virgl安卓渲染跑分在i7下可达到裸机极限的: 85% (i7-9700K + WX5100), i5下可达到裸机极限的: 77% (i5-4460 + WX5100)

VirtIOGPUBenchmarkComparison

1. HardWare Info

Detect the memory speed via sudo dmidecode --type 17.
Hardware 1(i7 9th machine):

CPU: Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
Memory: MemTotal: 32709264 kB, 2666 MT/s

Hardware 2(i5 machine):

CPU: Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz
Memory: MemTotal: 32808212 kB, 1600 MT/s 

Use the same ssd disk:

Disk 1: Crucial 500GB sata ssd. 
Disk 2: nvme ssd 256GB. 

Graphical Card Info(Detected via lspci | grep -i vga):

Card1: VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] (rev c4)
Card2: VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon Pro WX 5100]

2. System/SoftWare Info

System and Software info listed as:

500GB Crucial ssd:

$ cat /etc/issue
Ubuntu 20.04.4 LTS \n \l
$ uname -a
Linux hope 5.4.0-120-generic #136-Ubuntu SMP Fri Jun 10 13:40:48 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ qemu-system-x86_64 --version
QEMU emulator version 6.0.0 (Debian 1:6.0+dfsg-2expubuntu1~focal1.0)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
$ dpkg -l | grep -i virgl
ii  libvirglrenderer-dev:amd64                 0.8.2-1ubuntu1.1                      amd64        virtual GPU for KVM virtualization - headers
ii  libvirglrenderer1:amd64                    0.8.2-1ubuntu1.1                      amd64        virtual GPU for KVM virtualization

nvme ssd 256GB:

$ cat /etc/issue
Pop!_OS 21.10 \n \l
$ uname -a
Linux pop-os 5.17.15-76051715-generic #202206141358~1655919116~21.10~1db9e34 SMP PREEMPT Wed Jun 22 19 x86_64 x86_64 x86_64 GNU/Linux
$ qemu-system-x86_64 --version
QEMU emulator version 6.0.0 (Debian 1:6.0+dfsg-2expubuntu1.3)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
$ dpkg -l | grep -i virgl
ii  libvirglrenderer1:amd64                 0.8.2-5ubuntu0.21.10.1                                            amd64        virtual GPU for KVM virtualization

Software:

Unigine_Heaven-4.0
Unigine_Valley-1.0
glmark2
Redroid(Android 12)

3. Desktop Scenario

Case ListsDescriptionConclusion
3.1 BareMetal Comparison(WX5100)BareMetal Performance comparison using WX5100
3.2 BareMetal Comparison(5700xt)BareMetal Performance comparison using 5700xt
3.3 Virgl On i5-4460(WX5100)Virgl Performance on i5-4460 using WX5100
3.4 Virgl On i7-9700K(WX5100)Virgl Performance on i7-9700K using WX5100
3.5 Virgl On i5-4460(5700xt)Virgl Performance on i5-4460 using 5700xt
3.6 Virgl On i7-9700K(5700xt)Virgl Performance on i7-9700K using 5700xt

3.1 BareMetal Comparison(WX5100)

i5-4460i7-9700K
glmark29140, 9117, 91179730, 9651, 9660
Unigine_Valley FPS43, 42.4, 42.345.6, 45.0, 45.0
Unigine_Valley Score1800, 1773, 17691906, 1884, 1884
Unigine_Heaven FPS44.846.9
Unigine_Heaven Score11301182

Conclusion:

  1. WX5100 behaves almost the same on both i5/i7 platforms.
  2. i5’s cpu power won’t be a bottleneck in WX5100 scenario.

3.2 BareMetal Comparison(5700xt)

i5-4460i7-9700K
glmark213950, 14165, 1431522134, 22256, 22150
Unigine_Valley FPS105, 103.1, 102.9168.7, 169.1, 168.5
Unigine_Valley Score4391, 4315, 43047057, 7068, 7043
Unigine_Heaven FPS167.0171.1
Unigine_Heaven Score42064311
Unigine_Heaven FPS(4k)4342.8
Unigine_Heaven Score(4k)10831077

Conclusion:

  1. 5700xt runs smoother in i7 than on i5, perhaps i5 4th is too old for working together with 5700xt?(4 cores, bus width, etc).
  2. i5’s CPU/Memory becomes a bottleneck in 5700xt testing.

3.3 Virgl On i5-4460(WX5100)

i5-4460Virgl on i5-4460
glmark29140, 9117, 91172892, 2859, 2827
Unigine_Valley FPS43, 42.4, 42.340.8, 40.5, 40.6
Unigine_Valley Score1800, 1773, 17691707, 1694, 1699
Unigine_Heaven FPS44.842.2
Unigine_Heaven Score11301062

Conclusion:

  1. glmark2: Virgl is 31.3% of the baremetal performance.
  2. Unigine Valley/Unigine Heaven: Virgl performance almost the same as baremetal.

3.4 Virgl On i7-9700K(WX5100)

i7-9700KVirgl on i7-9700K
glmark29730, 9651, 96604274, 4262, 4320
Unigine_Valley FPS45.6, 45.0, 45.042.3, 41.6, 41.5
Unigine_Valley Score1906, 1884, 18841770, 1740, 1737
Unigine_Heaven FPS46.941.9
Unigine_Heaven Score11821055

Conclusion:

  1. glmark2: Virgl is 44.2% of the baremetal performance.
  2. Unigine Valley/Unigine Heaven: Virgl performance almost the same as baremetal.
  3. Comparing to 3.3: glmark2 will be improved using powerful CPU/Memory.

3.5 Virgl On i5-4460(5700xt)

i5-4460Virgl on i5-4460
glmark213950, 14165, 143152916, 3174, 2832
Unigine_Valley FPS105, 103.1, 102.961, 61.9, 60.9
Unigine_Valley Score4391, 4315, 43042551, 2588, 2548
Unigine_Heaven FPS167.089.7
Unigine_Heaven Score42062271
Unigine_Heaven FPS(4k)4337.8
Unigine_Heaven Score(4k)1083951

Conclusion:

  1. glmark2: Virgl is 21% of the baremetal performance.
  2. Unigine Valley/Unigine Heaven: Virgl is around 55%~60% of the baremetal performance, while in 4k behavior, 87% of the baremetal performance.

3.6 Virgl On i7-9700K(5700xt)

i7-9700KVirgl on i7-9700K
glmark222134, 22256, 221504152, 4256, 4238
Unigine_Valley FPS168.7, 169.1, 168.591.6, 91.5, 91.4
Unigine_Valley Score7057, 7068, 70433831, 3829, 3825
Unigine_Heaven FPS171.185.3
Unigine_Heaven Score43112149
Unigine_Heaven FPS(4k)42.835.6
Unigine_Heaven Score(4k)1077896

Conclusion:

  1. glmark2: Virgl is 19% of the baremetal performance.
  2. Unigine Valley/Unigine Heaven: Virgl is around 55%~60% of the baremetal performance, while in 4k behavior, 83% of the baremetal performance.

4. Android Scenario

Hardware/PlatformScore(scrcpy)Score(no scrcpy)
i7-9700K+5700xt616521(剑侠山谷: 309760 , 禅院悟道: 306761)617133(剑侠山谷: 310050, 禅院悟道: 307083)
Virgl on (i7-9700K+5700xt)442043(剑侠山谷: 223850 , 禅院悟道: 218193)564343(剑侠山谷: 289202, 禅院悟道:275141)
i5-4460+5700xt384564(剑侠山谷: 112763 , 禅院悟道: 221801)592030(剑侠山谷: 283705, 禅院悟道: 308255)
Virgl on (i5-4460+5700xt)227747(剑侠山谷: 108206 , 禅院悟道: 119541)445234(剑侠山谷: 214831, 禅院悟道:230403)
i7-9700K+WX5100567503(剑侠山谷: 265995 , 禅院悟道: 301508)585720(剑侠山谷: 277133, 禅院悟道: 308587)
Virgl on (i7-9700K+WX5100)412764(剑侠山谷: 210150 , 禅院悟道: 202614)499942(剑侠山谷: 257037, 禅院悟道: 242905)
i5-4460+WX5100401626(剑侠山谷: 166695 , 禅院悟道: 234931)572952(剑侠山谷: 267744, 禅院悟道: 305208)
Virgl on (i5-4460+WX5100)225837(剑侠山谷: 106071 , 禅院悟道: 119766)445202(剑侠山谷: 211450, 禅院悟道:233752)

Conclusion:

  1. Ludashi’s top score: around 61W, the maximum performance would be 1080p?
  2. scrcpy will greatly impact the performance when using Virgl under low-end CPU.
  3. virgl will be 85% for the best of bare metal on WX5100 on i7, 91% of bare metal on 5700xt on i7

UsingGimpForPhotoEditing

Create the new image:

/images/2022_07_19_15_20_38_307x445.jpg

Adjust the little image via:

/images/2022_07_19_15_21_00_344x297.jpg

160x200 px, resolution is 160 px/in.

Then select/copy the image into the big images, save as jpg, then we could print out the image.

RebuildQemuForBenchmark

AIM

Rebuild qemu for enlarge the frame-rate for benchmark GPU, following are the steps.

Get the SourceCode

Steps are:

$ sudo apt-get install build-essential pbuilder
$ dpkg -l | grep qemu
### Get the installed package name is `qemu-system-x86`
$ sudo vim /etc/apt/sources.list
$ sudo apt-get update
$ mkdir tmp
$ cd tmp/
$ apt-get source qemu-system-x86
$ ls
qemu-4.2  qemu_4.2-3ubuntu6.23.debian.tar.xz  qemu_4.2-3ubuntu6.23.dsc  qemu_4.2.orig.tar.xz

Code Changes

Refers to https://www.reddit.com/r/VFIO/comments/nviap2/in_case_your_games_output_60_fps_but_the/:

$ vim ./qemu-4.2/include/ui/console.h
......
/* in ms */
- #define GUI_REFRESH_INTERVAL_DEFAULT    30
+ #define GUI_REFRESH_INTERVAL_DEFAULT    16
#define GUI_REFRESH_INTERVAL_IDLE     3000
......

Rebuild the deb packages, first install the build dependencies for qemu-system-x86:

$ sudo apt-get build-dep qemu-system-x86

Now Rebuild the package via:

$ cd qemu-4.2/
$ dpkg-buildpackage -rfakeroot -b -uc -us
$ sudo dpkg -l | grep qemu
$ sudo apt-get purge qemu qemu-kvm qemu-system-common qemu-system-gui qemu-system-x86 qemu-utils
$ cd ..
$ ls *.deb
$ sudo dpkg -i *.deb
$ sudo apt-get install -f

Verification

No effect on 60 fps.

WorkingTipsOnWindowsOnLinux

选择专业版:

/images/2022_07_05_16_11_00_658x419.jpg

TIM:

/images/2022_07_05_16_58_53_466x302.jpg

Create shortcut:

/images/2022_07_05_16_59_31_444x368.jpg

Get the name:

/images/2022_07_05_17_00_01_370x416.jpg

/images/2022_07_05_17_01_01_751x308.jpg