Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Package]: Virglrenderer that use android gles driver to provide OpenGL acceleration in proot #14517

Closed
1 task done
xDoge26 opened this issue Jan 14, 2023 · 44 comments · Fixed by #15505
Closed
1 task done
Labels
help wanted Help is wanted in order to solve the issue package request A new package was requested video Issue related to video device support, not X11 necessarily

Comments

@xDoge26
Copy link

xDoge26 commented Jan 14, 2023

Why do you want to add this package to Termux?

I want to get 3D accel using Virgl apk that use gles driver . But the downside of virgl apk is 32bit only, and I have to modify shared user id for both termux and virgl apk so that virgl apk can access proot distro /tmp .

This is community version of virgl apk that provide opengl 3.3 for proot distro using android gles driver. But it only contain 32bit libs . So is it possible to port it to termux because gles 3.2 is widely avaiable and vulkan driver is too old for zink ?
VirGL_apk.zip

Screenshot_20221125130951

Home page URL

No response

Source code URL

https://github.com/mittorn/virglrenderer-android

Packaging policy acknowledgement

Additional information

No response

@xDoge26 xDoge26 added the package request A new package was requested label Jan 14, 2023
@xtkoba xtkoba added the x11 Issue is related to stuff requiring X11 environment or x11-packages label Jan 14, 2023
@sylirre sylirre added the help wanted Help is wanted in order to solve the issue label Jan 14, 2023
@xtkoba xtkoba added video Issue related to video device support, not X11 necessarily and removed x11 Issue is related to stuff requiring X11 environment or x11-packages labels Jan 19, 2023
@twaik
Copy link
Member

twaik commented Mar 3, 2023

@licy183 @xtkoba Can we enable virpipe driver in mesa? It seems to work faster than llvm pipe.

@licy183
Copy link
Member

licy183 commented Mar 4, 2023

@licy183 @xtkoba Can we enable virpipe driver in mesa? It seems to work faster than llvm pipe.

Of course we can enable virgl frontend in mesa, but we need to fork ans patch that application and make it work for Termux.

@twaik
Copy link
Member

twaik commented Mar 4, 2023

I do not think we need that application. #10118 (comment) .

@licy183
Copy link
Member

licy183 commented Mar 4, 2023

Emmm... I successfully made virglrenderer work over ANGLE with vulkan backend, but the performance is not good enough. And ANGLE with vulkan backend requires Android API 26+.

Run EPOXY_USE_ANGLE=1 ./virgl_test_server --use-egl-surfaceless --use-gles in one session, and run DISPLAY=:1 GALLIUM_DRIVER=virpipe glmark2 in another session.

The prebuilt binaries: virgl-angle-vulkan-aarch64.zip

I've tried to make it work on Android GLES without ANGLE, but I failed. glmark2 doesn't work properly and shows a blank screen. More investigations are needed.

@twaik
Copy link
Member

twaik commented Mar 4, 2023

That is the reason I want to make it push gl texture contents to xcb drawable with xcb_shm_put_image. This way will be independent from vendor implementation. Do you know where located code triggered by eglSwapBuffers?

@licy183
Copy link
Member

licy183 commented Mar 4, 2023

IIUC virglrenderer will not use eglSwapBuffer. It will use glReadBuffer or glReadPixels and send the pixels after rendering back to mesa.

@twaik
Copy link
Member

twaik commented Mar 4, 2023

Not exactly. mittorn's implementation simply blits rendered buffer to SurfaceView. My idea is to blit rendered buffer to X11 window requested rendering with xcb_shm_put_image instead of blitting it to SurfaceView. But we need to know what code in virglrenderer is triggered by eglSwapBuffers in target process. I mean virglrenderer itself does not use eglSwapBuffers, but calling eglSwapBuffer in remote process triggers some code in virglrenderer and I need to identify it.

@licy183
Copy link
Member

licy183 commented Mar 6, 2023

The virgl renderer doesn't work out of box for Adreno. The error seems to be related to Adreno's OpenGLES implementation. See https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/223 and https://developer.qualcomm.com/forum/qdn-forums/software/adreno-gpu-sdk/34738. But I don't have other devices for test.

Error linking program:
Error: Output fsout_c1 location or component exceeds max allowed.

add_shader_program: context error reported 1 "glxgears" Illegal shader 0
vs: 1 TGSI:
VERT
DCL IN[0]
DCL OUT[0], POSITION
DCL OUT[1], COLOR
DCL CONST[0..10]
DCL TEMP[0..16]
IMM[0] FLT32 {0x00000000, 0x00000000, 0x00000000, 0x00000000}
DCL TEMP[17..20]
DCL TEMP[21]
  0: MUL TEMP[1], IN[0].xxxx, CONST[5]
  1: MUL TEMP[2], IN[0].yyyy, CONST[6]
  2: ADD TEMP[3], TEMP[2], TEMP[1]
  3: MUL TEMP[4], IN[0].zzzz, CONST[7]
  4: ADD TEMP[5], TEMP[4], TEMP[3]
  5: MUL TEMP[6], IN[0].wwww, CONST[8]
  6: ADD OUT[0], TEMP[6], TEMP[5]
  7: DP3 TEMP[7].x, CONST[9].xyzx, CONST[9].xyzx
  8: RSQ TEMP[8].x, TEMP[7].xxxx
  9: MUL TEMP[9].xyz, CONST[9], TEMP[8].xxxx
 10: DP3 TEMP[10].x, TEMP[9].xyzx, CONST[10].xyzx
 11: MAX TEMP[11].x, IMM[0].xxxx, TEMP[10].xxxx
 12: SLT TEMP[12].x, IMM[0].xxxx, TEMP[10].xxxx
 13: ADD TEMP[13].xyz, CONST[2], CONST[1]
 14: MUL TEMP[14].xyz, TEMP[11].xxxx, CONST[3]
 15: ADD TEMP[15].xyz, TEMP[14].xyzx, TEMP[13].xyzx
 16: MUL TEMP[16].xyz, TEMP[12].xxxx, CONST[4]
 17: ADD TEMP[0].xyz, TEMP[16].xyzx, TEMP[15].xyzx
 18: MOV TEMP[0].w, CONST[1].wyzw
 19: MOV_SAT TEMP[21], TEMP[0]
 20: MOV OUT[1], TEMP[21]
 21: END

vs: 1 GLSL:
   1: #version 320 es
   2: #extension GL_EXT_clip_cull_distance : require
   3: precision highp float;
   4: precision highp int;
   5: in vec4 in_0;
   6:  flat    out  vec4 vso_c0;
   7: vec4 clip_dist_temp[2];
   8:  vec4 temp0;
   9:  vec4 temp1;
  10:  vec4 temp2;
  11:  vec4 temp3;
  12:  vec4 temp4;
  13:  vec4 temp5;
  14:  vec4 temp6;
  15:  vec4 temp7;
  16:  vec4 temp8;
  17:  vec4 temp9;
  18:  vec4 temp10;
  19:  vec4 temp11;
  20:  vec4 temp12;
  21:  vec4 temp13;
  22:  vec4 temp14;
  23:  vec4 temp15;
  24:  vec4 temp16;
  25:  vec4 temp17;
  26:  vec4 temp18;
  27:  vec4 temp19;
  28:  vec4 temp20;
  29:  vec4 temp21;
  30: uniform uvec4 vsconst0[11];
  31: layout (std140) uniform VirglBlock {
  32:   vec4 clipp[8];
  33:   uint stipple_pattern[32];
  34:   float winsys_adjust_y;
  35:   float alpha_ref_val;
  36:   bool clip_plane_enabled;
  37: };
  38: void main(void)
  39: {
  40: temp1 = vec4((((in_0.xxxx) * uintBitsToFloat(vsconst0[5]))));
  41: temp2 = vec4((((in_0.yyyy) * uintBitsToFloat(vsconst0[6]))));
  42: temp3 = vec4((( temp2  +  temp1 )));
  43: temp4 = vec4((((in_0.zzzz) * uintBitsToFloat(vsconst0[7]))));
  44: temp5 = vec4((( temp4  +  temp3 )));
  45: temp6 = vec4((((in_0.wwww) * uintBitsToFloat(vsconst0[8]))));
  46: gl_Position = vec4((( temp6  +  temp5 )));
  47: temp7.x = float(dot(vec3(uintBitsToFloat(vsconst0[9].xyzx)), vec3(uintBitsToFloat(vsconst0[9].xyzx))));
  48: temp8.x = float(inversesqrt( temp7.xxxx .x));
  49: temp9.xyz = vec3(((uintBitsToFloat(vsconst0[9]) *  temp8.xxxx )).xyz);
  50: temp10.x = float(dot(vec3( temp9.xyzx ), vec3(uintBitsToFloat(vsconst0[10].xyzx))));
  51: temp11.x = float((max((vec4(0,0,0,0)),  temp10.xxxx )).x);
  52: temp12.x = float(((lessThan(vec4((vec4(0,0,0,0))), vec4( temp10.xxxx )))).x);
  53: temp13.xyz = vec3(((uintBitsToFloat(vsconst0[2]) + uintBitsToFloat(vsconst0[1]))).xyz);
  54: temp14.xyz = vec3((( temp11.xxxx  * uintBitsToFloat(vsconst0[3]))).xyz);
  55: temp15.xyz = vec3((( temp14.xyzx  +  temp13.xyzx )).xyz);
  56: temp16.xyz = vec3((( temp12.xxxx  * uintBitsToFloat(vsconst0[4]))).xyz);
  57: temp0.xyz = vec3((( temp16.xyzx  +  temp15.xyzx )).xyz);
  58: temp0.w = float((uintBitsToFloat(vsconst0[1].wyzw).w));
  59: temp21 = vec4(( temp0 ));
  60: temp21 = clamp(temp21, 0.0, 1.0);
  61: vso_c0 = vec4(( temp21 ));
  62: if (clip_plane_enabled) {
  63:   gl_ClipDistance[0] = dot(gl_Position, clipp[0]);
  64:   gl_ClipDistance[1] = dot(gl_Position, clipp[1]);
  65:   gl_ClipDistance[2] = dot(gl_Position, clipp[2]);
  66:   gl_ClipDistance[3] = dot(gl_Position, clipp[3]);
  67:   gl_ClipDistance[4] = dot(gl_Position, clipp[4]);
  68:   gl_ClipDistance[5] = dot(gl_Position, clipp[5]);
  69:   gl_ClipDistance[6] = dot(gl_Position, clipp[6]);
  70:   gl_ClipDistance[7] = dot(gl_Position, clipp[7]);
  71: }
  72: gl_Position.y = gl_Position.y * winsys_adjust_y;
  73: }

fs: 2 TGSI:
FRAG
PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
DCL IN[0], COLOR, COLOR
DCL OUT[0], COLOR
PROPERTY SEPARABLE_PROGRAM 1
DCL TEMP[0..3]
  0: MOV OUT[0], IN[0]
  1: END

fs: 2 GLSL:
   1: #version 320 es
   2: #extension GL_EXT_clip_cull_distance : require
   3: #extension GL_EXT_blend_func_extended : require
   4: precision highp float;
   5: precision highp int;
   6:  flat    in  vec4 vso_c0;
   7: layout (location=0) out vec4 fsout_c0;
   8: layout (location=1) out vec4 fsout_c1;
   9: layout (location=2) out vec4 fsout_c2;
  10: layout (location=3) out vec4 fsout_c3;
  11: layout (location=4) out vec4 fsout_c4;
  12: layout (location=5) out vec4 fsout_c5;
  13: layout (location=6) out vec4 fsout_c6;
  14: layout (location=7) out vec4 fsout_c7;
  15:  vec4 temp0;
  16:  vec4 temp1;
  17:  vec4 temp2;
  18:  vec4 temp3;
  19: void main(void)
  20: {
  21: fsout_c0 = vec4(((vso_c0)));
  22: fsout_c1 = fsout_c0;
  23: fsout_c2 = fsout_c0;
  24: fsout_c3 = fsout_c0;
  25: fsout_c4 = fsout_c0;
  26: fsout_c5 = fsout_c0;
  27: fsout_c6 = fsout_c0;
  28: fsout_c7 = fsout_c0;
  29: }

dropping rendering due to missing shaders: glxgears

@twaik
Copy link
Member

twaik commented Mar 6, 2023

So it can work on zink and non-adreno GPUs, right?

@twaik
Copy link
Member

twaik commented Mar 6, 2023

If you are only experiencing problems with device I can let you use my device remotely, with adb and scrcpy. It will be slower but you will be able to test.

@licy183
Copy link
Member

licy183 commented Mar 6, 2023

So it can work on zink and non-adreno GPUs, right?

Emmm... I'm not sure about it. Anyway, it can work on ANGLE with vulkan backend.

If you are only experiencing problems with device I can let you use my device remotely, with adb and scrcpy. It will be slower but you will be able to test.

Thank you, don't bother. Maybe I'll borrow Android devices of my friends tomorrow to do some tests.

I'll also try to port the application for Termux in the following days. Let's see whether it will work or not for Termux.

@twaik
Copy link
Member

twaik commented Mar 6, 2023

Do you need some help with xcb? I can write code to make it draw back to X server.

@licy183
Copy link
Member

licy183 commented Mar 6, 2023

Do you need some help with xcb? I can write code to make it draw back to X server.

I'm not sure, but I'll ask for help if needed. Thank you in advance!

@licy183
Copy link
Member

licy183 commented Mar 7, 2023

After marking GL_ARB_blend_func_extended as not available, vtest_server can work on Adreno. I'll setup a Github Action to compile it in my repository. I'll add this package to Termux repository.

@xDoge26
Copy link
Author

xDoge26 commented Mar 7, 2023

Thanks , worked out of the box in chroot with adreno 610

@IntinteDAO
Copy link
Contributor

IntinteDAO commented Mar 7, 2023

glmark2 benchmarks:

RX5500M: 2406
Vega 10: 4554
Intel N2840 iGPU: 132
Intel Xe Graphics TGL GT2 (i5-11320H) - 3783


Android: 188
LLVMPipe: 65
Virglrenderer GL - 85
Virglrenderer GLES - 72
Zink 22.0.5 GL - 199
Zink 22.0.5 + GL4ES - Crash ;<

@twaik
Copy link
Member

twaik commented Mar 7, 2023

What soft did you use to measure Android and virglrenderer GL/GLES? Is Zink is zink only or vrglrenderer + zink?

@IntinteDAO
Copy link
Contributor

What soft did you use to measure Android and virglrenderer GL/GLES? Is Zink is zink only or vrglrenderer + zink?

android - native glmark2 benchmark
https://f-droid.org/pl/packages/org.linaro.glmark2/

Virglrenderer GL/GLES - virglrenderer-android runned on Termux

@twaik
Copy link
Member

twaik commented Mar 8, 2023

Shared memory not supported, fallbacking to protocol version 0

I've seen this only after replying here. It is possible to enable shm if it will help us to make it faster.

@licy183
Copy link
Member

licy183 commented Mar 8, 2023 via email

@twaik
Copy link
Member

twaik commented Mar 8, 2023

Emmm... I don't think protocol version 2 can be used on Android, because it sends the file descriptor of DMABUF from guest to host, but Android's GLES cannot use it.

Even without it we can a bit improve perfomance.

Your version from repos
~ $ GALLIUM_DRIVER=virpipe glxgears -swapinterval 0
329 frames in 5.0 seconds = 65.777 FPS
343 frames in 5.0 seconds = 68.412 FPS
340 frames in 5.0 seconds = 67.808 FPS
344 frames in 5.0 seconds = 68.699 FPS
341 frames in 5.0 seconds = 67.997 FPS
345 frames in 5.0 seconds = 68.992 FPS
345 frames in 5.0 seconds = 68.932 FPS
347 frames in 5.0 seconds = 69.240 FPS
^C
~ $ GALLIUM_DRIVER=virpipe glxgears -swapinterval 0 -fullscreen
85 frames in 5.1 seconds = 16.811 FPS
89 frames in 5.0 seconds = 17.632 FPS
88 frames in 5.0 seconds = 17.518 FPS
88 frames in 5.0 seconds = 17.541 FPS
89 frames in 5.0 seconds = 17.679 FPS
86 frames in 5.1 seconds = 17.017 FPS
88 frames in 5.0 seconds = 17.520 FPS
Your version with my patch
~ $ GALLIUM_DRIVER=virpipe glxgears -swapinterval 0
368 frames in 5.0 seconds = 73.454 FPS
387 frames in 5.0 seconds = 77.309 FPS
397 frames in 5.0 seconds = 79.382 FPS
388 frames in 5.0 seconds = 77.590 FPS
389 frames in 5.0 seconds = 77.646 FPS
387 frames in 5.0 seconds = 77.295 FPS
393 frames in 5.0 seconds = 78.422 FPS
^C
~ $ GALLIUM_DRIVER=virpipe glxgears -swapinterval 0 -fullscreen
107 frames in 5.0 seconds = 21.363 FPS
118 frames in 5.0 seconds = 23.498 FPS
118 frames in 5.0 seconds = 23.553 FPS
119 frames in 5.0 seconds = 23.615 FPS
120 frames in 5.0 seconds = 23.953 FPS
112 frames in 5.0 seconds = 22.228 FPS
118 frames in 5.0 seconds = 23.598 FPS
117 frames in 5.0 seconds = 23.340 FPS
120 frames in 5.0 seconds = 23.808 FPS
^C

Not very significant, but still better. +14% FPS in regular test and +35% FPS in fullscreen test.

The patch.

Can we make it work as DMABUF? I do not really know why zink is faster but maybe it is because it somehow implements/emulates this behaviour.

@twaik
Copy link
Member

twaik commented Mar 8, 2023

For some reason llvmpipe is faster than both versions of virglrenderer...

~ $ GALLIUM_DRIVER=llvmpipe glxgears -swapinterval 0
436 frames in 5.0 seconds = 87.035 FPS
464 frames in 5.0 seconds = 92.716 FPS
465 frames in 5.0 seconds = 92.827 FPS
460 frames in 5.0 seconds = 91.996 FPS
466 frames in 5.0 seconds = 93.118 FPS
474 frames in 5.0 seconds = 94.768 FPS
451 frames in 5.0 seconds = 90.001 FPS
^C
~ $ GALLIUM_DRIVER=llvmpipe glxgears -swapinterval 0 -fullscreen
164 frames in 5.0 seconds = 32.655 FPS
173 frames in 5.0 seconds = 34.508 FPS
168 frames in 5.0 seconds = 33.432 FPS
167 frames in 5.0 seconds = 33.233 FPS
173 frames in 5.0 seconds = 34.463 FPS
174 frames in 5.0 seconds = 34.655 FPS
175 frames in 5.0 seconds = 34.823 FPS
^C

@licy183
Copy link
Member

licy183 commented Mar 8, 2023

Can we make it work as DMABUF? I do not really know why zink is faster but maybe it is because it somehow implements/emulates this behaviour.

IIRC memfd system call is not disabled by Android SELinux. It can be enabled by removing that patch. But I don't think it is possible for us to do some operations on DMABUF as Linux does because of the SELinux of Android.

For some reason llvmpipe is faster than both versions of virglrenderer...

Emmm... This happens on my device too, but glmark2 gives more scores than glxgears.

@twaik
Copy link
Member

twaik commented Mar 8, 2023

IIRC memfd system call is not disabled by Android SELinux.

I did not say it is disable by SELinux. It is disabled in kernel config (in most devices I tested).

@licy183
Copy link
Member

licy183 commented Mar 8, 2023

IIRC memfd system call is not disabled by Android SELinux.

I did not say it is disable by SELinux. It is disabled in kernel config (in most devices I tested).

I don't know about it. But on my devices (MIX2s with Android 9 and MIX4 with Android 12), they work as expected...

@twaik
Copy link
Member

twaik commented Mar 8, 2023

I don't know about it. But on my devices (MIX2s with Android 9 and MIX4 with Android 12), they work as expected...

It is pretty weird. I'll add support for it in termux-x11, maybe it will help for chroot/proot setups...

I failed to setup gl in proot environment. I even do not have MIT-SHM working in proot. Do not know why. But I succeed to install glmark2 in termux with this buildscript. You were right, virgl_test_server_android gives higher results in those tests.

llvmpipe
~ $ glmark2
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    llvmpipe (LLVM 15.0.7, 128 bits)
    GL_VERSION:     4.5 (Compatibility Profile) Mesa 23.0.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 31 FrameTime: 32.655 ms
[build] use-vbo=true: FPS: 31 FrameTime: 32.453 ms
[texture] texture-filter=nearest: FPS: 41 FrameTime: 24.690 ms
[texture] texture-filter=linear: FPS: 36 FrameTime: 28.198 ms
[texture] texture-filter=mipmap: FPS: 30 FrameTime: 33.390 ms
[shading] shading=gouraud: FPS: 20 FrameTime: 52.008 ms
[shading] shading=blinn-phong-inf: FPS: 19 FrameTime: 55.504 ms
[shading] shading=phong: FPS: 16 FrameTime: 64.001 ms
[shading] shading=cel: FPS: 16 FrameTime: 64.005 ms
[bump] bump-render=high-poly: FPS: 10 FrameTime: 110.022 ms
[bump] bump-render=normals: FPS: 43 FrameTime: 23.323 ms
[bump] bump-render=height: FPS: 42 FrameTime: 24.034 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 18 FrameTime: 55.847 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 15 FrameTime: 71.196 ms
[pulsar] light=false:quads=5:texture=false: FPS: 29 FrameTime: 35.543 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 6 FrameTime: 171.319 ms
[desktop] effect=shadow:windows=4: FPS: 11 FrameTime: 91.527 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 13 FrameTime: 83.293 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 13 FrameTime: 79.931 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 14 FrameTime: 75.382 ms
[ideas] speed=duration: FPS: 11 FrameTime: 93.498 ms
[jellyfish] <default>: FPS: 9 FrameTime: 120.985 ms
[terrain] <default>: FPS: 1 FrameTime: 2698.131 ms
[shadow] <default>: FPS: 12 FrameTime: 84.552 ms
[refract] <default>: FPS: 2 FrameTime: 848.942 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 24 FrameTime: 43.266 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 23 FrameTime: 45.087 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 24 FrameTime: 42.073 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 23 FrameTime: 45.130 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 21 FrameTime: 48.524 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 23 FrameTime: 45.144 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 23 FrameTime: 44.904 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 21 FrameTime: 48.547 ms
=======================================================
                                  glmark2 Score: 19 
=======================================================
Your version from repos
~ $ GALLIUM_DRIVER=virpipe glmark2
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    virgl (PowerVR Rogue GE8320)
    GL_VERSION:     2.1 Mesa 23.0.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 28 FrameTime: 36.994 ms
[build] use-vbo=true: FPS: 31 FrameTime: 32.443 ms
[texture] texture-filter=nearest: FPS: 32 FrameTime: 32.174 ms
[texture] texture-filter=linear: FPS: 32 FrameTime: 31.986 ms
[texture] texture-filter=mipmap: FPS: 32 FrameTime: 31.917 ms
[shading] shading=gouraud: FPS: 31 FrameTime: 32.506 ms
[shading] shading=blinn-phong-inf: FPS: 32 FrameTime: 32.228 ms
[shading] shading=phong: FPS: 30 FrameTime: 33.538 ms
[shading] shading=cel: FPS: 30 FrameTime: 34.106 ms
[bump] bump-render=high-poly: FPS: 29 FrameTime: 35.591 ms
[bump] bump-render=normals: FPS: 31 FrameTime: 32.512 ms
[bump] bump-render=height: FPS: 32 FrameTime: 32.244 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 31 FrameTime: 33.119 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 28 FrameTime: 36.662 ms
[pulsar] light=false:quads=5:texture=false: FPS: 31 FrameTime: 32.494 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 24 FrameTime: 43.461 ms
[desktop] effect=shadow:windows=4: FPS: 29 FrameTime: 34.551 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 21 FrameTime: 49.733 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 20 FrameTime: 50.812 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 23 FrameTime: 44.321 ms
[ideas] speed=duration: FPS: 26 FrameTime: 38.697 ms
[jellyfish] <default>: FPS: 28 FrameTime: 35.815 ms
[terrain] <default>: FPS: 13 FrameTime: 79.738 ms
[shadow] <default>: FPS: 30 FrameTime: 34.296 ms
[refract] <default>: FPS: 16 FrameTime: 64.298 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 31 FrameTime: 32.353 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 31 FrameTime: 32.641 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 31 FrameTime: 32.488 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 31 FrameTime: 32.298 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 30 FrameTime: 33.614 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 31 FrameTime: 32.397 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 31 FrameTime: 32.870 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 31 FrameTime: 32.793 ms
=======================================================
                                  glmark2 Score: 27 
=======================================================
Your version with my patch
~ $ GALLIUM_DRIVER=virpipe glmark2
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    virgl (PowerVR Rogue GE8320)
    GL_VERSION:     2.1 Mesa 23.0.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 38 FrameTime: 26.668 ms
[build] use-vbo=true: FPS: 40 FrameTime: 25.076 ms
[texture] texture-filter=nearest: FPS: 40 FrameTime: 25.077 ms
[texture] texture-filter=linear: FPS: 40 FrameTime: 25.023 ms
[texture] texture-filter=mipmap: FPS: 41 FrameTime: 24.800 ms
[shading] shading=gouraud: FPS: 40 FrameTime: 25.248 ms
[shading] shading=blinn-phong-inf: FPS: 40 FrameTime: 25.392 ms
[shading] shading=phong: FPS: 38 FrameTime: 26.381 ms
[shading] shading=cel: FPS: 39 FrameTime: 26.227 ms
[bump] bump-render=high-poly: FPS: 36 FrameTime: 28.446 ms
[bump] bump-render=normals: FPS: 41 FrameTime: 24.873 ms
[bump] bump-render=height: FPS: 40 FrameTime: 25.031 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 40 FrameTime: 25.205 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 34 FrameTime: 29.443 ms
[pulsar] light=false:quads=5:texture=false: FPS: 40 FrameTime: 25.065 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 27 FrameTime: 37.490 ms
[desktop] effect=shadow:windows=4: FPS: 36 FrameTime: 28.441 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 28 FrameTime: 36.173 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 20 FrameTime: 50.726 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 31 FrameTime: 33.061 ms
[ideas] speed=duration: FPS: 32 FrameTime: 31.493 ms
[jellyfish] <default>: FPS: 36 FrameTime: 28.079 ms
[terrain] <default>: FPS: 15 FrameTime: 70.638 ms
[shadow] <default>: FPS: 36 FrameTime: 28.166 ms
[refract] <default>: FPS: 21 FrameTime: 48.627 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 41 FrameTime: 24.541 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 41 FrameTime: 24.820 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 41 FrameTime: 24.489 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 41 FrameTime: 24.695 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 40 FrameTime: 25.438 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 41 FrameTime: 24.764 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 41 FrameTime: 24.822 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 40 FrameTime: 25.009 ms
=======================================================
                                  glmark2 Score: 35 
=======================================================

It was printing

** 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.

after every line so I removed it.

@twaik
Copy link
Member

twaik commented Mar 8, 2023

It looks like glmark2-egl and glmark2-es2 give other results

glmark2-egl with llvmpipe
~ $ GALLIUM_DRIVER=llvmpipe glmark2-egl
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    llvmpipe (LLVM 15.0.7, 128 bits)
    GL_VERSION:     4.5 (Compatibility Profile) Mesa 23.0.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 24 FrameTime: 42.664 ms
[build] use-vbo=true: FPS: 25 FrameTime: 41.343 ms
[texture] texture-filter=nearest: FPS: 29 FrameTime: 35.549 ms
[texture] texture-filter=linear: FPS: 27 FrameTime: 37.268 ms
[texture] texture-filter=mipmap: FPS: 25 FrameTime: 41.323 ms
[shading] shading=gouraud: FPS: 18 FrameTime: 57.983 ms
[shading] shading=blinn-phong-inf: FPS: 17 FrameTime: 61.164 ms
[shading] shading=phong: FPS: 15 FrameTime: 70.492 ms
[shading] shading=cel: FPS: 15 FrameTime: 70.408 ms
[bump] bump-render=high-poly: FPS: 9 FrameTime: 117.289 ms
[bump] bump-render=normals: FPS: 31 FrameTime: 33.282 ms
[bump] bump-render=height: FPS: 30 FrameTime: 34.138 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 16 FrameTime: 62.976 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 13 FrameTime: 78.318 ms
[pulsar] light=false:quads=5:texture=false: FPS: 23 FrameTime: 43.768 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 6 FrameTime: 171.879 ms
[desktop] effect=shadow:windows=4: FPS: 10 FrameTime: 107.792 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 12 FrameTime: 88.278 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 12 FrameTime: 88.399 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 13 FrameTime: 82.682 ms
[ideas] speed=duration: FPS: 18 FrameTime: 57.546 ms
[jellyfish] <default>: FPS: 9 FrameTime: 116.276 ms
[terrain] <default>: FPS: 1 FrameTime: 1351.046 ms
[shadow] <default>: FPS: 12 FrameTime: 89.004 ms
[refract] <default>: FPS: 2 FrameTime: 763.548 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 20 FrameTime: 50.908 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 19 FrameTime: 52.943 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 20 FrameTime: 50.680 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 20 FrameTime: 52.436 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 19 FrameTime: 55.010 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 20 FrameTime: 52.011 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 20 FrameTime: 52.329 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 19 FrameTime: 55.134 ms
=======================================================
                                  glmark2 Score: 16 
=======================================================

glmark2-egl with your version from repo
~ $ GALLIUM_DRIVER=virpipe glmark2-egl
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    virgl (PowerVR Rogue GE8320)
    GL_VERSION:     2.1 Mesa 23.0.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 23 FrameTime: 44.962 ms
[build] use-vbo=true: FPS: 25 FrameTime: 41.028 ms
[texture] texture-filter=nearest: FPS: 25 FrameTime: 40.895 ms
[texture] texture-filter=linear: FPS: 25 FrameTime: 40.723 ms
[texture] texture-filter=mipmap: FPS: 25 FrameTime: 40.662 ms
[shading] shading=gouraud: FPS: 24 FrameTime: 41.724 ms
[shading] shading=blinn-phong-inf: FPS: 24 FrameTime: 41.734 ms
[shading] shading=phong: FPS: 24 FrameTime: 42.423 ms
[shading] shading=cel: FPS: 24 FrameTime: 42.362 ms
[bump] bump-render=high-poly: FPS: 23 FrameTime: 44.122 ms
[bump] bump-render=normals: FPS: 25 FrameTime: 40.285 ms
[bump] bump-render=height: FPS: 25 FrameTime: 40.816 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 25 FrameTime: 41.286 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 23 FrameTime: 45.172 ms
[pulsar] light=false:quads=5:texture=false: FPS: 25 FrameTime: 40.610 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 20 FrameTime: 51.804 ms
[desktop] effect=shadow:windows=4: FPS: 24 FrameTime: 42.664 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 19 FrameTime: 55.187 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 18 FrameTime: 56.740 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 20 FrameTime: 51.302 ms
[ideas] speed=duration: FPS: 22 FrameTime: 46.179 ms
[jellyfish] <default>: FPS: 23 FrameTime: 44.621 ms
[terrain] <default>: FPS: 10 FrameTime: 101.322 ms
[shadow] <default>: FPS: 24 FrameTime: 43.293 ms
[refract] <default>: FPS: 13 FrameTime: 81.356 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 25 FrameTime: 41.237 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 25 FrameTime: 40.852 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 25 FrameTime: 40.764 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 25 FrameTime: 41.443 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 25 FrameTime: 40.490 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 25 FrameTime: 41.042 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 25 FrameTime: 41.310 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 25 FrameTime: 41.237 ms
=======================================================
                                  glmark2 Score: 21 
=======================================================

glmark2-egl with your version with my patch
~ $ GALLIUM_DRIVER=virpipe glmark2-egl
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    virgl (PowerVR Rogue GE8320)
    GL_VERSION:     2.1 Mesa 23.0.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 29 FrameTime: 35.281 ms
[build] use-vbo=true: FPS: 30 FrameTime: 33.654 ms
[texture] texture-filter=nearest: FPS: 31 FrameTime: 32.803 ms
[texture] texture-filter=linear: FPS: 31 FrameTime: 32.809 ms
[texture] texture-filter=mipmap: FPS: 31 FrameTime: 33.153 ms
[shading] shading=gouraud: FPS: 30 FrameTime: 34.034 ms
[shading] shading=blinn-phong-inf: FPS: 30 FrameTime: 34.443 ms
[shading] shading=phong: FPS: 29 FrameTime: 35.413 ms
[shading] shading=cel: FPS: 29 FrameTime: 35.171 ms
[bump] bump-render=high-poly: FPS: 28 FrameTime: 36.365 ms
[bump] bump-render=normals: FPS: 30 FrameTime: 33.363 ms
[bump] bump-render=height: FPS: 31 FrameTime: 33.122 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 30 FrameTime: 34.016 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 26 FrameTime: 38.579 ms
[pulsar] light=false:quads=5:texture=false: FPS: 31 FrameTime: 33.230 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 23 FrameTime: 45.434 ms
[desktop] effect=shadow:windows=4: FPS: 28 FrameTime: 36.147 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 23 FrameTime: 43.991 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 18 FrameTime: 58.108 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 26 FrameTime: 39.874 ms
[ideas] speed=duration: FPS: 26 FrameTime: 39.385 ms
[jellyfish] <default>: FPS: 27 FrameTime: 37.409 ms
[terrain] <default>: FPS: 13 FrameTime: 82.634 ms
[shadow] <default>: FPS: 28 FrameTime: 36.661 ms
[refract] <default>: FPS: 14 FrameTime: 73.206 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 30 FrameTime: 33.484 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 30 FrameTime: 33.551 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 30 FrameTime: 33.817 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 31 FrameTime: 33.224 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 29 FrameTime: 35.278 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 30 FrameTime: 33.743 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 30 FrameTime: 34.009 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 30 FrameTime: 33.873 ms
=======================================================
                                  glmark2 Score: 26 
=======================================================

glmark2-es2 with llvmpipe
~ $ GALLIUM_DRIVER=llvmpipe glmark2-es2
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    llvmpipe (LLVM 15.0.7, 128 bits)
    GL_VERSION:     OpenGL ES 3.2 Mesa 23.0.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 24 FrameTime: 42.028 ms
[build] use-vbo=true: FPS: 24 FrameTime: 41.707 ms
[texture] texture-filter=nearest: FPS: 29 FrameTime: 34.854 ms
[texture] texture-filter=linear: FPS: 27 FrameTime: 37.201 ms
[texture] texture-filter=mipmap: FPS: 25 FrameTime: 41.190 ms
[shading] shading=gouraud: FPS: 18 FrameTime: 58.051 ms
[shading] shading=blinn-phong-inf: FPS: 17 FrameTime: 61.038 ms
[shading] shading=phong: FPS: 14 FrameTime: 71.444 ms
[shading] shading=cel: FPS: 15 FrameTime: 69.765 ms
[bump] bump-render=high-poly: FPS: 9 FrameTime: 117.131 ms
[bump] bump-render=normals: FPS: 30 FrameTime: 34.223 ms
[bump] bump-render=height: FPS: 30 FrameTime: 33.996 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 16 FrameTime: 63.197 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 13 FrameTime: 78.243 ms
[pulsar] light=false:quads=5:texture=false: FPS: 23 FrameTime: 43.554 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 6 FrameTime: 173.414 ms
[desktop] effect=shadow:windows=4: FPS: 10 FrameTime: 107.100 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 12 FrameTime: 88.382 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 12 FrameTime: 88.938 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 13 FrameTime: 82.655 ms
[ideas] speed=duration: FPS: 18 FrameTime: 56.945 ms
[jellyfish] <default>: FPS: 9 FrameTime: 114.519 ms
[terrain] <default>: FPS: 1 FrameTime: 1381.561 ms
[shadow] <default>: FPS: 12 FrameTime: 89.592 ms
[refract] <default>: FPS: 2 FrameTime: 761.885 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 20 FrameTime: 50.942 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 20 FrameTime: 52.368 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 20 FrameTime: 50.321 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 20 FrameTime: 51.516 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 18 FrameTime: 55.634 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 20 FrameTime: 52.144 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 20 FrameTime: 51.964 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 19 FrameTime: 54.850 ms
=======================================================
                                  glmark2 Score: 16 
=======================================================
glmark2-es2 with your version from repos
~ $ GALLIUM_DRIVER=virpipe glmark2-es2
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    virgl (PowerVR Rogue GE8320)
    GL_VERSION:     OpenGL ES 2.0 Mesa 23.0.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 22 FrameTime: 45.947 ms
[build] use-vbo=true: FPS: 25 FrameTime: 41.091 ms
[texture] texture-filter=nearest: FPS: 25 FrameTime: 40.303 ms
[texture] texture-filter=linear: FPS: 25 FrameTime: 40.513 ms
[texture] texture-filter=mipmap: FPS: 25 FrameTime: 40.456 ms
[shading] shading=gouraud: FPS: 25 FrameTime: 41.592 ms
[shading] shading=blinn-phong-inf: FPS: 24 FrameTime: 41.843 ms
[shading] shading=phong: FPS: 24 FrameTime: 42.118 ms
[shading] shading=cel: FPS: 24 FrameTime: 42.812 ms
[bump] bump-render=high-poly: FPS: 23 FrameTime: 44.116 ms
[bump] bump-render=normals: FPS: 25 FrameTime: 41.424 ms
[bump] bump-render=height: FPS: 25 FrameTime: 41.404 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 25 FrameTime: 41.293 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 23 FrameTime: 45.123 ms
[pulsar] light=false:quads=5:texture=false: FPS: 25 FrameTime: 40.010 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 19 FrameTime: 52.861 ms
[desktop] effect=shadow:windows=4: FPS: 23 FrameTime: 45.056 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 18 FrameTime: 55.664 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 18 FrameTime: 56.920 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 20 FrameTime: 50.883 ms
[ideas] speed=duration: FPS: 22 FrameTime: 46.674 ms
[jellyfish] <default>: FPS: 23 FrameTime: 45.445 ms
[terrain] <default>: FPS: 10 FrameTime: 106.783 ms
[shadow] <default>: FPS: 23 FrameTime: 45.249 ms
[refract] <default>: FPS: 12 FrameTime: 84.114 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 24 FrameTime: 42.509 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 24 FrameTime: 41.823 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 25 FrameTime: 40.383 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 27 FrameTime: 37.846 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 24 FrameTime: 42.345 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 25 FrameTime: 40.577 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 25 FrameTime: 40.633 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 26 FrameTime: 39.546 ms
=======================================================
                                  glmark2 Score: 21 
=======================================================

glmark2-es2 with your version with my patch
~ $ GALLIUM_DRIVER=virpipe glmark2-es2
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    virgl (PowerVR Rogue GE8320)
    GL_VERSION:     OpenGL ES 2.0 Mesa 23.0.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 29 FrameTime: 35.662 ms
[build] use-vbo=true: FPS: 30 FrameTime: 33.636 ms
[texture] texture-filter=nearest: FPS: 30 FrameTime: 34.056 ms
[texture] texture-filter=linear: FPS: 29 FrameTime: 34.798 ms
[texture] texture-filter=mipmap: FPS: 30 FrameTime: 33.426 ms
[shading] shading=gouraud: FPS: 29 FrameTime: 35.116 ms
[shading] shading=blinn-phong-inf: FPS: 29 FrameTime: 35.532 ms
[shading] shading=phong: FPS: 28 FrameTime: 35.747 ms
[shading] shading=cel: FPS: 28 FrameTime: 36.575 ms
[bump] bump-render=high-poly: FPS: 26 FrameTime: 39.099 ms
[bump] bump-render=normals: FPS: 30 FrameTime: 33.484 ms
[bump] bump-render=height: FPS: 29 FrameTime: 34.606 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 30 FrameTime: 33.873 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 27 FrameTime: 38.322 ms
[pulsar] light=false:quads=5:texture=false: FPS: 31 FrameTime: 33.147 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 23 FrameTime: 45.224 ms
[desktop] effect=shadow:windows=4: FPS: 28 FrameTime: 35.822 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 23 FrameTime: 43.835 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 18 FrameTime: 57.693 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 25 FrameTime: 40.290 ms
[ideas] speed=duration: FPS: 26 FrameTime: 39.223 ms
[jellyfish] <default>: FPS: 26 FrameTime: 39.232 ms
[terrain] <default>: FPS: 12 FrameTime: 84.220 ms
[shadow] <default>: FPS: 28 FrameTime: 36.963 ms
[refract] <default>: FPS: 14 FrameTime: 74.905 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 30 FrameTime: 33.718 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 30 FrameTime: 34.053 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 30 FrameTime: 33.443 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 30 FrameTime: 33.991 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 29 FrameTime: 35.195 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 30 FrameTime: 33.508 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 30 FrameTime: 34.420 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 30 FrameTime: 34.179 ms
=======================================================
                                  glmark2 Score: 26 
=======================================================
glmark2 from F-Droid
03-08 19:28:39.247 31355 31375 I glmark2 : glmark2 2020.04
03-08 19:28:39.247 31355 31375 I glmark2 :     OpenGL Information
03-08 19:28:39.247 31355 31375 I glmark2 :     GL_VENDOR:     Imagination Technologies
03-08 19:28:39.247 31355 31375 I glmark2 :     GL_RENDERER:   PowerVR Rogue GE8320
03-08 19:28:39.247 31355 31375 I glmark2 :     GL_VERSION:    OpenGL ES 3.2 build 1.13@5776728
03-08 19:28:49.302 31355 31375 I glmark2 : [build] use-vbo=false: FPS: 219 FrameTime: 4.566 ms
03-08 19:28:59.352 31355 31375 I glmark2 : [build] use-vbo=true: FPS: 104 FrameTime: 9.615 ms
03-08 19:29:09.433 31355 31375 I glmark2 : [texture] texture-filter=nearest: FPS: 165 FrameTime: 6.061 ms
03-08 19:29:19.481 31355 31375 I glmark2 : [texture] texture-filter=linear: FPS: 141 FrameTime: 7.092 ms
03-08 19:29:29.546 31355 31375 I glmark2 : [texture] texture-filter=mipmap: FPS: 226 FrameTime: 4.425 ms
03-08 19:29:39.653 31355 31375 I glmark2 : [shading] shading=gouraud: FPS: 190 FrameTime: 5.263 ms
03-08 19:29:49.751 31355 31375 I glmark2 : [shading] shading=blinn-phong-inf: FPS: 163 FrameTime: 6.135 ms
03-08 19:29:59.862 31355 31375 I glmark2 : [shading] shading=phong: FPS: 174 FrameTime: 5.747 ms
03-08 19:30:09.960 31355 31375 I glmark2 : [shading] shading=cel: FPS: 199 FrameTime: 5.025 ms
03-08 19:30:20.143 31355 31375 I glmark2 : [bump] bump-render=high-poly: FPS: 155 FrameTime: 6.452 ms
03-08 19:30:30.291 31355 31375 I glmark2 : [bump] bump-render=normals: FPS: 157 FrameTime: 6.369 ms
03-08 19:30:40.424 31355 31375 I glmark2 : [bump] bump-render=height: FPS: 109 FrameTime: 9.174 ms
03-08 19:30:50.506 31355 31375 I glmark2 : [effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 198 FrameTime: 5.051 ms
03-08 19:31:00.606 31355 31375 I glmark2 : [effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 95 FrameTime: 10.526 ms
03-08 19:31:10.651 31355 31375 I glmark2 : [pulsar] light=false:quads=5:texture=false: FPS: 243 FrameTime: 4.115 ms
03-08 19:31:20.788 31355 31375 I glmark2 : [desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 133 FrameTime: 7.519 ms
03-08 19:31:30.850 31355 31375 I glmark2 : [desktop] effect=shadow:windows=4: FPS: 258 FrameTime: 3.876 ms
03-08 19:31:40.939 31355 31375 I glmark2 : [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 60 FrameTime: 16.667 ms
03-08 19:31:50.991 31355 31375 I glmark2 : [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 89 FrameTime: 11.236 ms
03-08 19:32:01.034 31355 31375 I glmark2 : [buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 98 FrameTime: 10.204 ms
03-08 19:32:11.299 31355 31375 I glmark2 : [ideas] speed=duration: FPS: 252 FrameTime: 3.968 ms
03-08 19:32:21.687 31355 31375 I glmark2 : [jellyfish] <default>: FPS: 98 FrameTime: 10.204 ms
03-08 19:32:32.369 31355 31375 I glmark2 : [terrain] <default>: FPS: 27 FrameTime: 37.037 ms
03-08 19:32:42.627 31355 31375 I glmark2 : [shadow] <default>: FPS: 119 FrameTime: 8.403 ms
03-08 19:32:53.845 31355 31375 I glmark2 : [refract] <default>: FPS: 16 FrameTime: 62.500 ms
03-08 19:33:04.091 31355 31375 I glmark2 : [conditionals] fragment-steps=0:vertex-steps=0: FPS: 230 FrameTime: 4.348 ms
03-08 19:33:14.144 31355 31375 I glmark2 : [conditionals] fragment-steps=5:vertex-steps=0: FPS: 220 FrameTime: 4.545 ms
03-08 19:33:24.195 31355 31375 I glmark2 : [conditionals] fragment-steps=0:vertex-steps=5: FPS: 175 FrameTime: 5.714 ms
03-08 19:33:34.256 31355 31375 I glmark2 : [function] fragment-complexity=low:fragment-steps=5: FPS: 131 FrameTime: 7.634 ms
03-08 19:33:44.312 31355 31375 I glmark2 : [function] fragment-complexity=medium:fragment-steps=5: FPS: 164 FrameTime: 6.098 ms
03-08 19:33:54.387 31355 31375 I glmark2 : [loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 182 FrameTime: 5.495 ms
03-08 19:34:04.435 31355 31375 I glmark2 : [loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 159 FrameTime: 6.289 ms
03-08 19:34:14.485 31355 31375 I glmark2 : [loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 135 FrameTime: 7.407 ms
03-08 19:34:14.499 31355 31375 I glmark2 : glmark2 Score: 154
03-08 19:34:14.519 31355 31375 I glmark2 : glmark2 Score: 154

But why glmark2-egl and glmark2-es2 results are so bad?

@Grimler91
Copy link
Member

Grimler91 commented Mar 8, 2023

IIRC memfd system call is not disabled by Android SELinux.

I did not say it is disable by SELinux. It is disabled in kernel config (in most devices I tested).

I don't know about it. But on my devices (MIX2s with Android 9 and MIX4 with Android 12), they work as expected...

memfd_create landed in linux 3.17, so older kernels won't have it unless it has been backported. It is required starting from something like android 10.

This program, if cross-compiled with target api level 28 or newer (to get fexecve), can be used to check if a device has a working memfd implementation. (Can't compile it in termux since we target api level 24). A pre-compiled aarch64 blob can be downloaded here

@twaik
Copy link
Member

twaik commented Mar 8, 2023

Wait, fexecve works on android? I thought it is forbidden.

BTW, @Grimler91, can we make libandroid-shmem check status of shm extension to make termux programs work with termux proot's sysvipc extension?

@licy183
Copy link
Member

licy183 commented Mar 8, 2023

memfd_create landed in linux 3.17, so older kernels won't have it unless it has been backported. It is required starting from something like android 10.

This program, if cross-compiled with target api level 28 or newer (to get fexecve), can be used to check if a device has a working memfd implementation. (Can't compile it in termux since we target api level 24). A pre-compiled aarch64 blob can be downloaded here

Thanks for the information. Actually I used to use #define memfd_create(name,flags) syscall(SYS_memfd_create,name,flags) to provide memfd_create, such as https://github.com/termux/termux-packages/blob/master/packages/libandroid-execinfo/execinfo.c#L43.
Maybe because Android 7.0 has kernel version 3.18.48 or 4.4.0, and memfd syscall was introduced in 3.17, so we hasn't got issues about invalid syscall memfd_create. See https://android.stackexchange.com/questions/51651/which-android-runs-which-linux-kernel/51656#51656.

@xDoge26
Copy link
Author

xDoge26 commented Mar 9, 2023

My gpu only have GL_AMD_compressed_ATC_texture , but some how i have DXTn/DXTC support in virgl exagear 🤔

@licy183
Copy link
Member

licy183 commented Mar 9, 2023

My gpu only have GL_AMD_compressed_ATC_texture , but some how i have DXTn/DXTC support in virgl exagear 🤔

Alex ported some codes of gl4es and this made these features enabled.

alexvorxx/VirGL-Overlay-Rebuild@e365e02

@licy183
Copy link
Member

licy183 commented Mar 9, 2023

Do you think my gpu can expose opengl 3.3 virpipe by default ?

http://opengles.gpuinfo.org/displayreport.php?id=6106

I don't think so, because it seems that your GPU support OpenGL ES 3.2.

@licy183
Copy link
Member

licy183 commented Mar 9, 2023

I don't think so, because it seems that your GPU support OpenGL ES 3.2.

How about opengl 3.2 ? can virglrenderer expose it 😔 .

The program i want to run need opengl 3.2 , if i set opengl to anything lower ...GL_VERSION...=3.1,3.0 + llvmpipe , it will alway black screen 😭

I don't know what actually happens. If you set GALLIUM_DRIVER=llvmpipe, virgl will not be used, so the blank screen should have nothing to do with virgl.

@MF-patino
Copy link

Hey, amazing work! I tried it out with blender and encountered some issues, as you can see in the following screenshot
Screenshot_20230310_164932_TermuxX11

The terminal also repeated the following two error lines which do not look very helpful
vrend_check_no_error: context error reported 1 "blender" Unknown 1282
vtest_transfer_get_internal called virgl_renderer_transfer_read_iov which failed (22)

I used the command GALLIUM_DRIVER=virpipe MESA_GL_VERSION_OVERRIDE=4.5 blender in proot to run it and at first it is possible to look around with pretty great performance. The moment you try to select something it stops working. Also there are no fonts.

Any chance these issues will be solved eventually? Appart from them, it would seem that with virgl you could actually use blender with low but bearable frame rates.

@licy183
Copy link
Member

licy183 commented Mar 10, 2023

I'm afraid not. IIRC the GL version of virglrenderer over Android's GLES is 2.1. MESA_GL_VERSION_OVERRIDE variable will override the GL version to 4.5 and make mesa pass some operations that is not supported by Android's GLES.

@Fancy2209
Copy link

My gpu only have GL_AMD_compressed_ATC_texture , but some how i have DXTn/DXTC support in virgl exagear 🤔

Alex ported some codes of gl4es and this made these features enabled.

alexvorxx/VirGL-Overlay-Rebuild@e365e02

this is not on the Termux Package yet tough is it?

@kde-yyds
Copy link

So is it able to run compiz with virglrender-android?
It only trys to launch fallback window manager and exit.

@rhjdvsgsgks
Copy link
Contributor

rhjdvsgsgks commented Apr 29, 2023

any plan of venus ? it can bring vulkan to the proot/chroot (so that we can use dxvk to replace wined3d). and possible to get higher version of gl by using zink
edit: see also https://gitlab.freedesktop.org/mesa/mesa/-/issues/8460

@irfan-hossain-bhuiyan
Copy link

irfan-hossain-bhuiyan commented Jun 3, 2023

.I am using Mali-51 which supports opengl 3.1.I wanna use godot inside termux which require opengl 3.3.

I don't wanna use llvm-pipe for rendering.

Is there any way I can use my gpu with opengl-3.3 api with minimul performance overhead?

**MESA_GL_VERSION_OVERRIDE=4.0 doesn't work.**THANKS.

(It would be better if I can run godot inside termux other than distro.)

@twaik
Copy link
Member

twaik commented Jun 12, 2023

@licy183 Is it possible to make virglrenderer-android use AHardwareBuffer instead of memfd to avoid using glReadPixels?

@twaik
Copy link
Member

twaik commented Aug 10, 2023

@licy183 can we make virgl_test_server_android respect TMPDIR? It will let people use it with proot/chroot without bind-mounting /tmp of chroot. We should only change one line.

diff --git a/vtest/vtest_protocol.h b/vtest/vtest_protocol.h
--- a/vtest/vtest_protocol.h
+++ b/vtest/vtest_protocol.h
@@ -25,7 +25,7 @@
 #ifndef VTEST_PROTOCOL
 #define VTEST_PROTOCOL
 
-#define VTEST_DEFAULT_SOCKET_NAME "/tmp/.virgl_test"
+#define VTEST_DEFAULT_SOCKET_NAME (getenv("TMPDIR") ?: "@TERMUX_PREFIX@/tmp/.virgl_test")

@licy183
Copy link
Member

licy183 commented Aug 10, 2023

I've changed this socket path. 9167972

@twaik
Copy link
Member

twaik commented Aug 16, 2023

I've changed this socket path. 9167972

Can you please represent change in --help?

reference

https://discord.com/channels/641256914684084234/955349025102630932/1141181303111286916
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Help is wanted in order to solve the issue package request A new package was requested video Issue related to video device support, not X11 necessarily
Projects
None yet
Development

Successfully merging a pull request may close this issue.