Glmark2 是一个基于 OpenGL 2.0OpenGL ES 2.0 开发的benchmark程序. 由于OpenGL ES 不是桌面Linux需要的图形库,所以这里将以OpenGL为例进行图形跑分.

若使用 Ubuntu 可直接运行 apt-get install glmark2 即可

安装和运行 Glmark2 🔗︎

安装依赖的开发工具

1
apt-get -y install git g++ build-essential pkg-config


安装依赖的程序库

1
2
apt-get -y install libx11-dev libgl1-mesa-dev
apt-get -y install libjpeg-dev libpng-dev


获取 glmark2 源代码 到当前 glmark2-test/ 目录

1
git clone https://github.com/glmark2/glmark2.git glmark2-test


编译 glmark2

1
2
3
4
5
6
cd glmark2-test
# 配置项目,注意要测试OpenGL ES 2.0的话,在这里替换使用: --with-flavors=x11-glesv2
./waf configure --with-flavors=x11-gl --prefix=/opt/glmark2 --data-path=/opt/glmark2/data
./waf build -j 4
# 将编译好的文件安装到 Release 目录
./waf install --destdir=$PWD/Release


安装 glmark2

1
2
3
# Release 目录里的文件就是整个 glmark2 可执行程序和数据
# 将 glmark2 安装到系统
cp -RP ./Release/opt /


运行 glmark2

1
/opt/glmark2/bin/glmark2 


Glmark2 运行中 🔗︎

Running Glmark2


运行 Glmark2 的终端输出 🔗︎

RX560 4G显存的显卡 跑分日志:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
root@inteluatig:~# /opt/glmark2/bin/glmark2 
=======================================================
    glmark2 2020.04
=======================================================
    OpenGL Information
    GL_VENDOR:     X.Org
    GL_RENDERER:   Radeon RX 560 Series (POLARIS11, DRM 3.38.0, 4.19.0-11-amd64, LLVM 7.0.1)
    GL_VERSION:    4.5 (Compatibility Profile) Mesa 18.3.6
=======================================================
[build] use-vbo=false: FPS: 5227 FrameTime: 0.191 ms
[build] use-vbo=true: FPS: 8815 FrameTime: 0.113 ms
[texture] texture-filter=nearest: FPS: 8646 FrameTime: 0.116 ms
[texture] texture-filter=linear: FPS: 8640 FrameTime: 0.116 ms
[texture] texture-filter=mipmap: FPS: 8436 FrameTime: 0.119 ms
[shading] shading=gouraud: FPS: 7819 FrameTime: 0.128 ms
[shading] shading=blinn-phong-inf: FPS: 7791 FrameTime: 0.128 ms
[shading] shading=phong: FPS: 7796 FrameTime: 0.128 ms
[shading] shading=cel: FPS: 7787 FrameTime: 0.128 ms
[bump] bump-render=high-poly: FPS: 5858 FrameTime: 0.171 ms
[bump] bump-render=normals: FPS: 8912 FrameTime: 0.112 ms
[bump] bump-render=height: FPS: 8755 FrameTime: 0.114 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 7786 FrameTime: 0.128 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 5142 FrameTime: 0.194 ms
[pulsar] light=false:quads=5:texture=false: FPS: 7874 FrameTime: 0.127 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 3855 FrameTime: 0.259 ms
[desktop] effect=shadow:windows=4: FPS: 6338 FrameTime: 0.158 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 1441 FrameTime: 0.694 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 1781 FrameTime: 0.561 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 1666 FrameTime: 0.600 ms
[ideas] speed=duration: FPS: 7360 FrameTime: 0.136 ms
[jellyfish] <default>: FPS: 5869 FrameTime: 0.170 ms
[terrain] <default>: FPS: 862 FrameTime: 1.160 ms
[shadow] <default>: FPS: 6486 FrameTime: 0.154 ms
[refract] <default>: FPS: 1539 FrameTime: 0.650 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 8774 FrameTime: 0.114 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 8696 FrameTime: 0.115 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 8778 FrameTime: 0.114 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 8741 FrameTime: 0.114 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 8709 FrameTime: 0.115 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 8746 FrameTime: 0.114 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 8752 FrameTime: 0.114 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 8740 FrameTime: 0.114 ms
=======================================================
                                  glmark2 Score: 6739 
=======================================================


在日志的最后三行显示 glmark2 Score: 即我的显卡总分为 6739 , 跑分分数仅供参考.


卸载方法 🔗︎

由于上面的安装方法是纯净的,可执行程序和数据文件没有安装到系统目录里,

所以卸载方式很简单,直接删除安装目录即可.

1
rm -rf /opt/glmark2


glmark2-test/ 源码目录也请及时删除.