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

How to enable KGSL for version 27.0.0-devel-20261025-r2 ?

Open debianroot20200524 opened this issue 1 week ago • 2 comments

I installed this version(27.0.0-devel-20261025-r2) into /opt/mesa-for-android-container and I use Anland Next(https://github.com/misaka5202/anland/releases/tag/v6.2.14) as display server. My GPU is Adreno 730. I create lfdevs.json in /etc/vulkan/icd.d:

{
"ICD": {
"api_version": "1.4.363",
"library_arch": "64",
"library_path": "/opt/mesa-for-android-container/usr/lib/aarch64-linux-gnu/libvulkan_freedreno.so"
},
"file_format_version": "1.0.1"
}

My /etc/environment:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin/android-bridge
vblank_mode=3
MESA_VK_WSI_PRESENT_MODE=immediate
MESA_LOADER_DRIVER_OVERRIDE=zink
MESA_DRI3_DISABLE_PRESENT_WAIT_FENCE=1
#GALLIUM_DRIVER=zink
LIBGL_KOPPER_DISABLE=true

When I start glmark2-wayland:

root@Kali-Nethunter:~# glmark2-wayland 
ATTENTION: default value of option vblank_mode overridden by environment.
MESA-EGL: warning: egl: failed to create dri2 screen
ATTENTION: default value of option vblank_mode overridden by environment.
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    llvmpipe (LLVM 22.1.8, 128 bits)
    GL_VERSION:     4.6 (Compatibility Profile) Mesa 26.2.6-1
    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:^C FPS: 96 FrameTime: 10.428 ms
=======================================================
                                  glmark2 Score: 95 
=======================================================
root@Kali-Nethunter:~# 

As you can see,It runs with llvmpipe(software rendering),but I can't uncomment the line "#GALLIUM_DRIVER=zink",otherwise a blackscreen will appear, even though this will enable zink hardware acceleration. But glmark2-x11 is working properly with zink hardware acceleration enabled. I want to try KGSL,because I suspect this is a bug in zink.but I cant't enable KGSL through MESA_LOADER_DRIVER_OVERRIDE=kgsl !

debianroot20200524 avatar Nov 27 '26 14:11 debianroot20200524

root@Kali-Nethunter:~# MESA_LOADER_DRIVER_OVERRIDE=kgsl glmark2-wayland --fullscreen
ATTENTION: default value of option vblank_mode overridden by environment.
MESA-EGL: warning: egl: failed to create dri2 screen
ATTENTION: default value of option vblank_mode overridden by environment.
MESA-EGL: warning: egl: failed to create dri2 screen
ATTENTION: default value of option vblank_mode overridden by environment.
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    llvmpipe (LLVM 22.1.8, 128 bits)
    GL_VERSION:     4.6 (Compatibility Profile) Mesa 26.2.6-1
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   1920x1080 fullscreen
=======================================================
[build] use-vbo=false:^C FPS: 107 FrameTime: 9.414 ms
=======================================================
                                  glmark2 Score: 106 
=======================================================
root@Kali-Nethunter:~# MESA_LOADER_DRIVER_OVERRIDE=kgsl glmark2-x11 --fullscreen
glmark2-x11:未找到命令
root@Kali-Nethunter:~# MESA_LOADER_DRIVER_OVERRIDE=kgsl glmark2 --fullscreen
ATTENTION: default value of option vblank_mode overridden by environment.
** 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 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa
    GL_RENDERER:    llvmpipe (LLVM 22.1.8, 128 bits)
    GL_VERSION:     4.6 (Compatibility Profile) Mesa 26.2.6-1
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   1280x720 fullscreen
=======================================================
** 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
root@Kali-Nethunter:~# 

debianroot20200524 avatar Nov 27 '26 14:11 debianroot20200524

  • First, for Kali, please confirm that the file you downloaded is mesa-for-android-container_27.0.0-devel-20261025-r2_debian_testing_arm64.tar.gz.

  • Second, please try to extract the driver files directly to the container root directory to overwrite the system drivers. I am not sure whether Gallium drivers can be loaded using the LD_LIBRARY_PATH environment variable. If you really do not want to overwrite the system drivers, you can use Termux:X11 first to do basic testing.

  • I have not tested Anland Next yet, but for the original Anland Legacy, it is still recommended to specify the environment variable MESA_LOADER_DRIVER_OVERRIDE=kgsl to launch the Wayland desktop/applications. Because rendering goes through the KGSL surfaceless path, it relies on the Freedreno Gallium driver. Based on my current testing with Adreno 830, after entering the Wayland desktop normally via the recommended script, if the MESA_LOADER_DRIVER_OVERRIDE environment variable in a terminal is changed to zink, only glmark2 (XWayland + OpenGL) can run normally in that terminal, while glmark2-es2 (XWayland + OpenGL ES), glmark2-wayland (Wayland + OpenGL), and glmark2-es2-wayland (Wayland + OpenGL ES) all fail to run.

lfdevs avatar Nov 27 '26 15:11 lfdevs