mesa-for-android-container icon indicating copy to clipboard operation
mesa-for-android-container copied to clipboard

[Adreno 810] Fatal error in glmark2 and vkcube on proot debian in HyperOS

Open NicholasBerryman opened this issue 7 months ago • 11 comments

Glmark2 output:
pi@localhost:~$ glmark2
MESA-LOADER: failed to retrieve device information
MESA: error: kgsl_pipe_get_param:103: invalid param id: 13
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      freedreno
    GL_RENDERER:    FD810
    GL_VERSION:     4.6 (Compatibility Profile) Mesa 26.1.0-devel (git-dee0d39008)
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 611 FrameTime: 1.637 ms
[build] use-vbo=true: FPS: 678 FrameTime: 1.476 ms
[texture] texture-filter=nearest:MESA: error: flush_submit_list:92: submit failed -1 (Resource deadlock avoided)
MESA: error: flush_submit_list:92: submit failed -1 (Resource deadlock avoided)
MESA: error: flush_submit_list:92: submit failed -1 (Resource deadlock avoided)
MESA: error: flush_submit_list:92: submit failed -1 (Resource deadlock avoided)  
vkcube output:
pi@localhost:~$ vkcube
Selected WSI platform: xcb
Selected GPU 0: Turnip Adreno (TM) 810, type: IntegratedGpu
vkcube: ./cube/cube.c:1202: demo_draw: Assertion `!err' failed.
Aborted

The above are the results after running termux-reset and then following the testing process given in the following issue comment: https://github.com/lfdevs/mesa-for-android-container/issues/41#issuecomment-4197078641

This issue: https://github.com/lfdevs/mesa-for-android-container/issues/7 seems to describe a similar bug on a similar device, though I don't know enough about video drivers to say whether it's truly the same problem.

Happy to provide any other info or testing if it would help!

NicholasBerryman avatar Apr 15 '26 08:04 NicholasBerryman

I've just tested in winlator, as described by https://github.com/lfdevs/mesa-for-android-container/issues/7 , and I can successfully run glmark2 using their turnip+zink container settings with no errors. So I suspect this is a very similar problem to that previous issue, though I still am unsure how to fix within termux

NicholasBerryman avatar Apr 16 '26 06:04 NicholasBerryman

Mesa upstream added official Adreno 810 support on April 10, so the 26.1.0-devel-20260404 version before that used unofficial patches, which might have some issues.

However, you can now first try testing vkcube with the Turnip driver I built yesterday; it includes official Adreno 810 support and might resolve this issue: https://github.com/lfdevs/mesa-for-android-container/actions/runs/24602394376#artifacts

It's worth mentioning that the directly downloaded file is a .zip archive, which needs to be unzipped once to get the .tar.gz installation package. If it works normally, I will build the corresponding Freedreno driver again in the near future.

lfdevs avatar Apr 19 '26 03:04 lfdevs

That seems to have improved things somewhat, though it's still having some fairly big problems.

With the driver you built yesterday,

If I use kgsl:

  • vkcube doesn't throw any errors, but it just shows a dark grey window in termux-x11 xfce
  • glmark2 still throws the same error as with the older drivers

If I use zink:

  • vkcube gets the same grey window problem as with kgsl
  • glmark2 completes with no errors, but just shows a black window in termux-x11 xfce

glmark2 black screen: Image

vkcube dark grey screen: Image

NicholasBerryman avatar Apr 19 '26 04:04 NicholasBerryman

It looks like Adreno 810 support is still not quite good enough at the moment, and we may need to wait for upstream to refine it for a while.

However, you can also test the Turnip driver under Termux native; this build has applied a series of patches from Termux: https://github.com/lfdevs/termux-packages/pull/9 It might have better compatibility.

lfdevs avatar Apr 19 '26 07:04 lfdevs

Hmm, following the install instructions in your link inside termux native gives a new error when I try anything that uses opengl or Vulkan:

src/freedreno/registers/adreno/a6xx-pack.xml.h:48281: struct tu_reg_value __RB_CCU_CACHE_CNTL(struct __RB_CCU_CACHE_CNTL) [CHIP = A8XX]: assertion "((fields.depth_offset >> 12) & 0xffffc000) == 0" failed

NicholasBerryman avatar Apr 19 '26 07:04 NicholasBerryman

You mentioned at the beginning that Turnip can be used normally under Winlator. So you can also use Winlator to test Turnip driver from whitebelyash's repository. (The reason for using the driver built by him is because its patches are completely open-source.)

If it works properly, I can try to build a special version of the Turnip driver using the source code he maintains for you to test in a PRoot container.

lfdevs avatar Apr 19 '26 23:04 lfdevs

I've just tried copying the latest whitebelyash drivers over the top of the default winlator turnip 26.1.0 drivers, and that seems to cause both glmark2 and the included direct3d test to fail.

The glmark2 failure throws a could not find a compatible pixel format error just before crashing, immediately on open.

Is there something special that needs to be done for the installation that I've missed?

NicholasBerryman avatar Apr 20 '26 03:04 NicholasBerryman

Are you using the official version of Winlator for your tests? I tried it with the modified version of Winlator Bionic. The Turnip driver is from the tu_v25.1 version of whitebelyash's repository, and Adreno 830 can run FurMark normally. Even so, I'm not quite sure how his driver's support for Adreno 810 is.

Image Image Image

lfdevs avatar Apr 20 '26 10:04 lfdevs

Yes, I was using the official version, but I've just tried it out following your process with the linked fork and the latest belyash drivers, and furmark does successfully run in both GL and VK modes. Thanks for clarifying on the testing process.

If you get a chance to build a new proot driver using whitebelyash's source, let me know and I'd be happy to test.

NicholasBerryman avatar Apr 21 '26 07:04 NicholasBerryman

This build is based on the source code from the gen8 branch of whitebelyash's repository: https://github.com/lfdevs/mesa-for-android-container/actions/runs/24730019005#artifacts

He applied some Adreno 810/829 optimization patches from DiskDVD, which should be very helpful for running the Turnip driver on Adreno 810. You need to specify the environment variable MESA_LOADER_DRIVER_OVERRIDE=zink when running.

lfdevs avatar Apr 21 '26 16:04 lfdevs

That seems to have worked! No more errors in glmark2 or vkcube.

Thank you very much for your help!!

NicholasBerryman avatar Apr 22 '26 11:04 NicholasBerryman