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

Request for Adreno 7xx series support and DRI3 support #26

Open
hansm629 opened this issue Aug 14, 2023 · 154 comments
Open

Request for Adreno 7xx series support and DRI3 support #26

hansm629 opened this issue Aug 14, 2023 · 154 comments

Comments

@hansm629
Copy link

hansm629 commented Aug 14, 2023

Hello.
I am using Termux-X11 PRoot-Distro Ubuntu 22.04 LTS XFCE4-SESSION 4.18 for
my Galaxy S23 Ultra (Adreno 740) and Galaxy Tab S8+ 5G (Adreno 730).

I installed mesa-vulkan-kgsl_23.3.0-devel-20230803_arm64.deb that you build, and I found that it did not work.

As it works well with the Galaxy S20 (Adreno 650) PRoot, it does not appear that the currently built package supports the Adreno 7xx series.

Recently, freedreno turnip for the Termux package supports DRI3 as a patch, which seems to work with Turnip without inputting the MESA_VK_WSI_DEBUG=sw environment variable and perform better.

I request Adreno 7xx series support and DRI3 patching for the turnip package for PRoot.

@hansm629 hansm629 changed the title Request for Adreno7xx series support and DRI3 support Request for Adreno 7xx series support and DRI3 support Aug 14, 2023
@xDoge26
Copy link
Owner

xDoge26 commented Aug 14, 2023

it does not appear that the currently built package supports the Adreno 7xx series
Because mesa mainline does not support a7xx yet

Compile it your self with this script https://github.com/xDoge26/mesa-turnip/blob/main/build_deb_mesa.sh

Recently, freedreno turnip for the Termux package supports DRI3 as a patch, which seems to work with Turnip without inputting the MESA_VK_WSI_DEBUG=sw environment variable and perform better.

they need better documentation, also it would be better if they need upstream changes to mesa mainline not just patch

I request Adreno 7xx series support and DRI3 patching for the turnip package for PRoot.

Same as above, this should be asked on mesa gitlab

@hansm629
Copy link
Author

hansm629 commented Aug 14, 2023

it does not appear that the currently built package supports the Adreno 7xx series
Because mesa mainline does not support a7xx yet

Compile it your self with this script https://github.com/xDoge26/mesa-turnip/blob/main/build_deb_mesa.sh

Recently, freedreno turnip for the Termux package supports DRI3 as a patch, which seems to work with Turnip without inputting the MESA_VK_WSI_DEBUG=sw environment variable and perform better.

they need better documentation, also it would be better if they need upstream changes to mesa mainline not just patch

I request Adreno 7xx series support and DRI3 patching for the turnip package for PRoot.

Same as above, this should be asked on mesa gitlab

https://gitlab.freedesktop.org/Danil/mesa/-/tree/turnip/feature/a7xx-basic-support

After receiving the source from Branche above
I build the deb package myself.

mesa-vulkan-kgsl_23.3.0-devel-20230815_arm64.zip

260455361-6da8f231-0bba-4ca9-bc10-945477934465

Galaxy S23 Ultra (Adreno 740)
Galaxy S22 Ultra (Adreno 730)
Galaxy tab S8+ 5G (Adreno 730)

Tested on 3 devices.

It doesn't matter if you upload the corresponding deb package if necessary.

Unfortunately, the DRI3 patch was not reflected.

@romanovj
Copy link

romanovj commented Aug 14, 2023

@hansm629
you can try to build with these
dri.zip

place wsi-termux-x11-v3.patch in sources dir and execute
git apply -v wsi-termux-x11-v3.patch

replace src/vulkan/wsi/wsi_common_x11.c with file from archive

config
-Dcpp_rtti=false
-Dgbm=disabled
-Dopengl=false
-Dllvm=disabled
-Dshared-llvm=disabled
-Dplatforms=x11,wayland
-Dgallium-drivers=
-Dxmlconfig=disabled
-Dvulkan-drivers=freedreno
-Dfreedreno-kmds=msm,kgsl

@hansm629
Copy link
Author

@hansm629 you can try to build with these dri.zip

place wsi-termux-x11-v3.patch in sources dir and execute git apply -v wsi-termux-x11-v3.patch

replace src/vulkan/wsi/wsi_common_x11.c with file from archive

config -Dcpp_rtti=false -Dgbm=disabled -Dopengl=false -Dllvm=disabled -Dshared-llvm=disabled -Dplatforms=x11,wayland -Dgallium-drivers= -Dxmlconfig=disabled -Dvulkan-drivers=freedreno -Dfreedreno-kmds=msm,kgsl

Thank you!
after Compile

I'll post a review.
:)

@hansm629
Copy link
Author

hansm629 commented Aug 14, 2023

@hansm629 you can try to build with these dri.zip

place wsi-termux-x11-v3.patch in sources dir and execute git apply -v wsi-termux-x11-v3.patch

replace src/vulkan/wsi/wsi_common_x11.c with file from archive

config -Dcpp_rtti=false -Dgbm=disabled -Dopengl=false -Dllvm=disabled -Dshared-llvm=disabled -Dplatforms=x11,wayland -Dgallium-drivers= -Dxmlconfig=disabled -Dvulkan-drivers=freedreno -Dfreedreno-kmds=msm,kgsl

@romanovj

After Build
I'm posting a review.

vkcube

hsm@localhost:~$ TU_DEBUG=noconform vkcube
Selected GPU 0: Turnip Adreno (TM) 740, type: 1

vkcube is
Works very well without the MESA_VK_WSI_DEBUG=sw environment variable.

but

hsm@localhost:~$ MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/freedreno_icd.aarch64.json glmark2
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa
    GL_RENDERER:   zink Vulkan 1.3(Turnip Adreno (TM) 740 (MESA_TURNIP))
    GL_VERSION:    4.5 (Compatibility Profile) Mesa 23.3.0-devel
=======================================================
MESA: error: CreateSwapchainKHR failed with VK_ERROR_OUT_OF_DEVICE_MEMORY
MESA: error: zink: could not create swapchain
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: CreateSwapchainKHR failed with VK_ERROR_OUT_OF_DEVICE_MEMORY
MESA: error: zink: could not create swapchain
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
[build] use-vbo=false:MESA: error: zink: couldn't allocate memory: heap=3 size=2097152
MESA: error: zink: couldn't allocate memory: heap=3 size=2097152

glmark2 is not working with the same issue we reported to the tur-report before.

hsm@localhost:~$ MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/freedreno_icd.aarch64.json glxgears
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
303 frames in 5.0 seconds = 60.531 FPS
300 frames in 5.0 seconds = 59.975 FPS
301 frames in 5.0 seconds = 60.013 FPS
301 frames in 5.0 seconds = 59.992 FPS

And
glxgears performance is very, very slow.

Maybe...
Should I recompile the mesa after the DRI3 patch?

I downloaded the sauce of mesa-23.3.0-devel

meson build -D gbm=enabled -D opengl=true -D egl=enabled -D egl-native-platform=x11 -D gles1=disabled -D gles2=enabled -D dri3=enabled -D glx=dri -D llvm=enabled -D shared-llvm=disabled -D platforms=x11,wayland -D gallium-drivers=swrast,virgl,zink -D vulkan-drivers=swrast -D osmesa=true -D glvnd=true -D xmlconfig=disabled

I compiled it with the meson option above.

@romanovj
Copy link

romanovj commented Aug 14, 2023

if you see VK_ERROR_OUT_OF_DEVICE_MEMORY add
USE_HEAP=1

fot gxlears add vblank_mode=0

vblank_mode=0 MESA_NO_ERROR=1 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink glxgears

@hansm629
Copy link
Author

if you see VK_ERROR_OUT_OF_DEVICE_MEMORY add USE_HEAP=1

fot gxlears add vblank_mode=0

vblank_mode=0 MESA_NO_ERROR=1 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink glxgears

@romanovj

It's amazing.
glxgears performance is almost 3x better.

glxgears

but

hsm@localhost:~$ USE_HEAP=1 MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/freedreno_icd.aarch64.json glmark2
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa
    GL_RENDERER:   zink Vulkan 1.3(Turnip Adreno (TM) 740 (MESA_TURNIP))
    GL_VERSION:    4.5 (Compatibility Profile) Mesa 23.3.0-devel
=======================================================
MESA: error: CreateSwapchainKHR failed with VK_ERROR_OUT_OF_DEVICE_MEMORY
MESA: error: zink: could not create swapchain
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: CreateSwapchainKHR failed with VK_ERROR_OUT_OF_DEVICE_MEMORY
MESA: error: zink: could not create swapchain
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
MESA: error: zink: couldn't allocate memory: heap=0 size=2035712
[build] use-vbo=false:MESA: error: zink: couldn't allocate memory: heap=3 size=2097152
MESA: error: zink: couldn't allocate memory: heap=3 size=2097152

Even if USE_HEAP=1 is added
glmark2 is still not working.

supertuxkart and blender3d also fails with the error VK_ERROR_OUT_OF_DEVICE_MEMORY.

@romanovj
Copy link

for glmark2 you can try
MESA_NO_ERROR=1 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink glmark2 --reuse-context

@hansm629
Copy link
Author

for glmark2 you can try MESA_NO_ERROR=1 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink glmark2 --reuse-context

@romanovj

New error.

hsm@localhost:~$ MESA_NO_ERROR=1 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink glmark2 --reuse-context
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa
    GL_RENDERER:   zink Vulkan 1.3(Turnip Adreno (TM) 740 (MESA_TURNIP))
    GL_VERSION:    4.5 (Compatibility Profile) Mesa 23.3.0-devel
=======================================================
[build] use-vbo=false:MESA: error: zink: couldn't allocate memory: heap=3 size=2097152
MESA: error: zink: couldn't allocate memory: heap=3 size=2097152

@romanovj
Copy link

@hansm629 sorry, forgot about vblank_mode
try this
vblank_mode=0 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink glmark2 --reuse-context

@hansm629
Copy link
Author

@hansm629 sorry, forgot about vblank_mode try this vblank_mode=0 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink glmark2 --reuse-context

glmark2

@romanovj

Finally...
I did it!!

More than 4x better performance than before!

Thank you so much!!!

Thanks to you, I was able to make it!!!!!

mesa-vulkan-kgsl_dri3.zip

@hansm629
Copy link
Author

@hansm629 sorry, forgot about vblank_mode try this vblank_mode=0 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink glmark2 --reuse-context

@romanovj

Additional test results.

Firefox-esr works well and has improved web page loading and WebGL performance.

And
gimp, pencil2d, kolourpaint, rawtherapee, okular, libreoffice

All of the above programs worked well, too.

but

supertuxkart, blender3d, kdenlive, gthumb

All received the error VK_ERROR_OUT_OF_DEVICE_MEMORY and did not run.

Is there a way to run those programs as well?

@romanovj
Copy link

try to compile mesa main without vulkan

@xDoge26
Copy link
Owner

xDoge26 commented Aug 15, 2023

sounds good, tell me once its stable enough and upstreamed to mesa main

@hansm629
Copy link
Author

try to compile mesa main without vulkan

@romanovj

I need your help.

The compile was well done before
Error in compiling mesa.

What kind of problem?

$ meson build -Dgbm=enabled -Dopengl=true -Degl=enabled -Degl-native-platform=x11 -Dgles1=disabled -Dgles2=enabled -Ddri3=enabled -Dglx=dri -Dllvm=enabled -Dshared-llvm=disabled -Dplatforms=x11,wayland -Dgallium-drivers=swrast,virgl -Dosmesa=true -Dglvnd=true -Dxmlconfig=disabled
$ ninja -C build install
hsm@localhost:~/다운로드/mesa-main$ sudo ninja -C build install
ninja: Entering directory `build'
[18/78] Linking target src/gallium/targets/va/libgallium_drv_video.so
FAILED: src/gallium/targets/va/libgallium_drv_video.so 
c++  -o src/gallium/targets/va/libgallium_drv_video.so src/gallium/targets/va/libgallium_drv_video.so.p/target.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libgallium_drv_video.so -Wl,--whole-archive src/gallium/frontends/va/libva_st.a -Wl,--no-whole-archive src/gallium/auxiliary/libgalliumvlwinsys.a src/util/libmesa_util.a src/util/libmesa_util_sse41.a src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/gallium/auxiliary/libgalliumvl.a src/gallium/auxiliary/libgallium.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/gallium/auxiliary/pipe-loader/libpipe_loader_static.a src/loader/libloader.a src/util/libxmlconfig.a src/gallium/winsys/sw/null/libws_null.a src/gallium/winsys/sw/wrapper/libwsw.a src/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/drivers/virgl/libvirgl.a src/gallium/winsys/virgl/drm/libvirgldrm.a src/gallium/winsys/virgl/common/libvirglcommon.a src/gallium/winsys/virgl/vtest/libvirglvtest.a -Wl,--version-script '/home/hsm/다운로드/mesa-main/src/gallium/targets/va/va.sym' -Wl,--dynamic-list '/home/hsm/다운로드/mesa-main/src/gallium/targets/va/../dri-vdpau.dyn' -Wl,--gc-sections -Wl,--build-id=sha1 /usr/lib/aarch64-linux-gnu/libdrm.so /usr/lib/aarch64-linux-gnu/libz.so -pthread -lm /usr/lib/gcc/aarch64-linux-gnu/11/../../../aarch64-linux-gnu/libzstd.so /usr/lib/aarch64-linux-gnu/libunwind.so /usr/lib/aarch64-linux-gnu/libxcb-sync.so /usr/lib/aarch64-linux-gnu/libxcb-present.so /usr/lib/aarch64-linux-gnu/libxshmfence.so /usr/lib/aarch64-linux-gnu/libxcb-xfixes.so /usr/lib/aarch64-linux-gnu/libxcb-dri3.so -lrt -ldl -L/usr/lib/llvm-14/lib -lLLVMLTO -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMObjCARCOpts -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMFrontendOpenMP -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoMSF -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMMCJIT -lLLVMMCDisassembler -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lz -ltinfo -lxml2 -lsensors /usr/lib/aarch64-linux-gnu/libxcb-randr.so /usr/lib/aarch64-linux-gnu/libX11-xcb.so /usr/lib/aarch64-linux-gnu/libX11.so /usr/lib/aarch64-linux-gnu/libxcb.so /usr/lib/aarch64-linux-gnu/libxcb-dri2.so -Wl,--end-group
/usr/bin/ld: cannot find -lPolly: No such file or directory
/usr/bin/ld: cannot find -lPollyISL: No such file or directory
collect2: error: ld returned 1 exit status
[19/78] Linking target src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0
FAILED: src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0 
c++  -o src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0 src/gallium/targets/vdpau/libvdpau_gallium.so.1.0.0.p/target.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libvdpau_gallium.so.1.0.0 -Wl,--whole-archive src/gallium/frontends/vdpau/libvdpau_st.a -Wl,--no-whole-archive src/gallium/auxiliary/libgalliumvlwinsys.a src/util/libmesa_util.a src/util/libmesa_util_sse41.a src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/gallium/auxiliary/libgalliumvl.a src/gallium/auxiliary/libgallium.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/gallium/auxiliary/pipe-loader/libpipe_loader_static.a src/loader/libloader.a src/util/libxmlconfig.a src/gallium/winsys/sw/null/libws_null.a src/gallium/winsys/sw/wrapper/libwsw.a src/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/drivers/virgl/libvirgl.a src/gallium/winsys/virgl/drm/libvirgldrm.a src/gallium/winsys/virgl/common/libvirglcommon.a src/gallium/winsys/virgl/vtest/libvirglvtest.a -Wl,--version-script '/home/hsm/다운로드/mesa-main/src/gallium/targets/vdpau/vdpau.sym' -Wl,--dynamic-list '/home/hsm/다운로드/mesa-main/src/gallium/targets/vdpau/../dri-vdpau.dyn' -Wl,--gc-sections /usr/lib/aarch64-linux-gnu/libz.so -pthread -lm /usr/lib/gcc/aarch64-linux-gnu/11/../../../aarch64-linux-gnu/libzstd.so /usr/lib/aarch64-linux-gnu/libunwind.so /usr/lib/aarch64-linux-gnu/libdrm.so /usr/lib/aarch64-linux-gnu/libxcb-sync.so /usr/lib/aarch64-linux-gnu/libxcb-present.so /usr/lib/aarch64-linux-gnu/libxshmfence.so /usr/lib/aarch64-linux-gnu/libxcb-xfixes.so /usr/lib/aarch64-linux-gnu/libxcb-dri3.so -lrt -ldl -L/usr/lib/llvm-14/lib -lLLVMLTO -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMObjCARCOpts -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMFrontendOpenMP -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoMSF -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMMCJIT -lLLVMMCDisassembler -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lz -ltinfo -lxml2 -lsensors /usr/lib/aarch64-linux-gnu/libxcb-randr.so /usr/lib/aarch64-linux-gnu/libxcb.so /usr/lib/aarch64-linux-gnu/libX11-xcb.so /usr/lib/aarch64-linux-gnu/libX11.so /usr/lib/aarch64-linux-gnu/libxcb-dri2.so -Wl,--end-group
/usr/bin/ld: cannot find -lPolly: No such file or directory
/usr/bin/ld: cannot find -lPollyISL: No such file or directory
collect2: error: ld returned 1 exit status
[23/78] Linking target src/gallium/targets/osmesa/libOSMesa.so.8.0.0
FAILED: src/gallium/targets/osmesa/libOSMesa.so.8.0.0 
c++  -o src/gallium/targets/osmesa/libOSMesa.so.8.0.0 src/gallium/targets/osmesa/libOSMesa.so.8.0.0.p/target.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libOSMesa.so.8 -Wl,--whole-archive src/gallium/frontends/osmesa/libosmesa_st.a src/mapi/glapi/libglapi_bridge.a -Wl,--no-whole-archive '-Wl,-rpath,$ORIGIN/../../../mapi/shared-glapi' '-Wl,-rpath-link,/home/hsm/다운로드/mesa-main/build/src/mapi/shared-glapi' src/mesa/libmesa.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/util/libmesa_util.a src/util/libmesa_util_sse41.a src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/compiler/spirv/libvtn.a src/gallium/auxiliary/libgallium.a src/gallium/winsys/sw/null/libws_null.a src/mapi/shared-glapi/libglapi.so.0.0.0 src/gallium/drivers/llvmpipe/libllvmpipe.a src/gallium/drivers/softpipe/libsoftpipe.a -Wl,--gc-sections -Wl,--version-script '/home/hsm/다운로드/mesa-main/src/gallium/targets/osmesa/osmesa.sym' -pthread /usr/lib/aarch64-linux-gnu/libunwind.so -lrt -ldl -lm -L/usr/lib/llvm-14/lib -lLLVMLTO -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMObjCARCOpts -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMFrontendOpenMP -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoMSF -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMMCJIT -lLLVMMCDisassembler -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lz -ltinfo -lxml2 /usr/lib/aarch64-linux-gnu/libz.so /usr/lib/gcc/aarch64-linux-gnu/11/../../../aarch64-linux-gnu/libzstd.so /usr/lib/aarch64-linux-gnu/libdrm.so -L/usr/lib/llvm-14/lib -lLLVMLTO -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMObjCARCOpts -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMFrontendOpenMP -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoMSF -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMMCJIT -lLLVMMCDisassembler -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lz -ltinfo -lxml2 -lsensors -L/usr/lib/llvm-14/lib -lLLVMLTO -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMObjCARCOpts -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMFrontendOpenMP -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoMSF -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMMCJIT -lLLVMMCDisassembler -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lz -ltinfo -lxml2 -Wl,--end-group
/usr/bin/ld: cannot find -lPolly: No such file or directory
/usr/bin/ld: cannot find -lPollyISL: No such file or directory
/usr/bin/ld: cannot find -lPolly: No such file or directory
/usr/bin/ld: cannot find -lPollyISL: No such file or directory
/usr/bin/ld: cannot find -lPolly: No such file or directory
/usr/bin/ld: cannot find -lPollyISL: No such file or directory
collect2: error: ld returned 1 exit status
[25/78] Linking target src/gallium/targets/dri/libgallium_dri.so
FAILED: src/gallium/targets/dri/libgallium_dri.so 
c++  -o src/gallium/targets/dri/libgallium_dri.so src/gallium/targets/dri/libgallium_dri.so.p/target.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libgallium_dri.so '-Wl,-rpath,$ORIGIN/../../../mapi/shared-glapi' '-Wl,-rpath-link,/home/hsm/다운로드/mesa-main/build/src/mapi/shared-glapi' src/gallium/frontends/dri/libdri.a src/util/libmesa_util.a src/util/libmesa_util_sse41.a src/util/blake3/libblake3.a src/c11/impl/libmesa_util_c11.a src/mesa/libmesa.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/compiler/spirv/libvtn.a src/gallium/auxiliary/libgalliumvl.a src/gallium/auxiliary/libgallium.a src/mapi/shared-glapi/libglapi.so.0.0.0 src/gallium/auxiliary/pipe-loader/libpipe_loader_static.a src/loader/libloader.a src/util/libxmlconfig.a src/gallium/winsys/sw/null/libws_null.a src/gallium/winsys/sw/wrapper/libwsw.a src/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/drivers/llvmpipe/libllvmpipe.a src/gallium/drivers/softpipe/libsoftpipe.a src/gallium/drivers/virgl/libvirgl.a src/gallium/winsys/virgl/drm/libvirgldrm.a src/gallium/winsys/virgl/common/libvirglcommon.a src/gallium/winsys/virgl/vtest/libvirglvtest.a -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script '/home/hsm/다운로드/mesa-main/src/gallium/targets/dri/dri.sym' -Wl,--dynamic-list '/home/hsm/다운로드/mesa-main/src/gallium/targets/dri/../dri-vdpau.dyn' /usr/lib/aarch64-linux-gnu/libdrm.so -lrt -ldl -lm -L/usr/lib/llvm-14/lib -lLLVMLTO -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMObjCARCOpts -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMFrontendOpenMP -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoMSF -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMMCJIT -lLLVMMCDisassembler -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lz -ltinfo -lxml2 -pthread /usr/lib/aarch64-linux-gnu/libz.so /usr/lib/gcc/aarch64-linux-gnu/11/../../../aarch64-linux-gnu/libzstd.so /usr/lib/aarch64-linux-gnu/libunwind.so -L/usr/lib/llvm-14/lib -lLLVMLTO -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMObjCARCOpts -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMFrontendOpenMP -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoMSF -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMMCJIT -lLLVMMCDisassembler -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lz -ltinfo -lxml2 -lsensors /usr/lib/aarch64-linux-gnu/libxcb-randr.so -L/usr/lib/llvm-14/lib -lLLVMLTO -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMObjCARCOpts -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMFrontendOpenMP -lLLVMAArch64Disassembler -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoMSF -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMMCJIT -lLLVMMCDisassembler -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lz -ltinfo -lxml2 -Wl,--end-group
/usr/bin/ld: cannot find -lPolly: No such file or directory
/usr/bin/ld: cannot find -lPollyISL: No such file or directory
/usr/bin/ld: cannot find -lPolly: No such file or directory
/usr/bin/ld: cannot find -lPollyISL: No such file or directory
/usr/bin/ld: cannot find -lPolly: No such file or directory
/usr/bin/ld: cannot find -lPollyISL: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

@romanovj
Copy link

romanovj commented Aug 15, 2023

@hansm629 you need to install clang libpolly

clang -v

apt-get install libpolly-VERSION-dev

where version is 15/16/17/18

@romanovj
Copy link

you can also try to build mesa 22 - 22.1

@hansm629
Copy link
Author

hansm629 commented Aug 15, 2023

you can also try to build mesa 22 - 22.1

@romanovj
Mesa 22.1.5 was compilng and installed.

hsm@localhost:~$ vblank_mode=0 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/freedreno_icd.aarch64.json glmark2
ATTENTION: default value of option vblank_mode overridden by environment.
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Collabora Ltd
    GL_RENDERER:   zink (Turnip Adreno (TM) 740)
    GL_VERSION:    4.5 (Compatibility Profile) Mesa 22.1.5
=======================================================
[build] use-vbo=false: FPS: 546 FrameTime: 1.832 ms
[build] use-vbo=true: FPS: 550 FrameTime: 1.818 ms

without any particular environmental variables

vblank_mode=0 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/freedreno_icd.aarch64.json

With the above commands, glxgears and glmark2 run well.

But at the end of the benchmark
MESA: error: ZINK: vkQueueWaitIdle failed
There's an error

When you run supertuxkart and kdenlive
MESA: error: ZINK: vkQueueWaitIdle
An error occurs and does not execute.

When blender is

Warning: Could not find a matching GPU name. Things may not behave as expected.
Detected OpenGL configuration:
Vendor: Collabora Ltd
Renderer: zink (Turnip Adreno (TM) 740)
MESA: error: CreateSwapchainKHR failed with VK_ERROR_INITIALIZATION_FAILED
MESA: error: zink: swapchain killed 0x72942d22c0
MESA: error: zink: couldn't allocate memory! from heap 0
MESA: error: zink: couldn't allocate memory! from heap 0

The above error appears and does not execute.

Should I build a higher version of Mesa?

@romanovj
Copy link

romanovj commented Aug 15, 2023

@hansm629
new version of patch can help you
https://github.com/xMeM/termux-packages/blob/master/packages/mesa/wsi-termux-x11-v3.patch

@hansm629
Copy link
Author

@hansm629 new version of patch can help you https://github.com/xMeM/termux-packages/blob/master/packages/mesa/wsi-termux-x11-v3.patch

@romanovj

I did it!

by applying a new patch
Turnip has been build!

Works fine without any errors!

스크린샷_2023-08-16_00-30-26
스크린샷_2023-08-16_00-24-50
스크린샷_2023-08-16_00-28-05
스크린샷_2023-08-16_00-26-40

Blender 3D and kdenlive work great!

At this rate, devices with SD8 Gen2
I think it can be used as a Linux computer!

new patch applied
the turnip deb package.
mesa-vulkan-kgsl_23.3.0-devel-DRI3_20230815_arm64.zip

Thanks to you, I was able to get optimal GPU acceleration in PRoot Linux! :)

Thank you so much!
I will leave a review after testing on the latest mesa 23.1.5.

@romanovj
Copy link

romanovj commented Aug 15, 2023

all thanks to xMeM fot his patches

@hansm629
Copy link
Author

all thanks to xMeM fot his patches

@romanovj

I newly build mesa 23.1.5 and ran glmark2.

Up to 4.7x performance improvement over virglrenderer-mesa-zink.
It's almost 5x performance improvement.

very good.

[Benchmark Information]

  • host : Galaxy S23 Ultra (Adreno (TM) 740)
  • os : Termux-X11 PRoot-Distro Ubuntu 22.04.3 LTS XFCE4-SESSION 4.18
virglrenderer-android virglrenderer-mesa-zink zink+turnip without DRI3 zink+turnip with DRI3
119 102 110 479
virglrenderer-android
hsm@localhost:~$ glmark2
** 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 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa
    GL_RENDERER:   virgl (Adreno (TM) 740)
    GL_VERSION:    4.5 (Compatibility Profile) Mesa 23.1.5
=======================================================
** 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: FPS: 161 FrameTime: 6.211 ms
** 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=true: FPS: 128 FrameTime: 7.812 ms
** 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.
[texture] texture-filter=nearest: FPS: 131 FrameTime: 7.634 ms
** 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.
[texture] texture-filter=linear: FPS: 155 FrameTime: 6.452 ms
** 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.
[texture] texture-filter=mipmap: FPS: 133 FrameTime: 7.519 ms
** 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.
[shading] shading=gouraud: FPS: 118 FrameTime: 8.475 ms
** 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.
[shading] shading=blinn-phong-inf: FPS: 116 FrameTime: 8.621 ms
** 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.
[shading] shading=phong: FPS: 118 FrameTime: 8.475 ms
** 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.
[shading] shading=cel: FPS: 116 FrameTime: 8.621 ms
** 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.
[bump] bump-render=high-poly: FPS: 82 FrameTime: 12.195 ms
** 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.
[bump] bump-render=normals: FPS: 134 FrameTime: 7.463 ms
** 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.
[bump] bump-render=height: FPS: 134 FrameTime: 7.463 ms
** 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.
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 132 FrameTime: 7.576 ms
** 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.
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 125 FrameTime: 8.000 ms
** 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.
[pulsar] light=false:quads=5:texture=false: FPS: 131 FrameTime: 7.634 ms
** 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.
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 113 FrameTime: 8.850 ms
** 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.
[desktop] effect=shadow:windows=4: FPS: 123 FrameTime: 8.130 ms
** 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.
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 91 FrameTime: 10.989 ms
** 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.
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 96 FrameTime: 10.417 ms
** 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.
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 98 FrameTime: 10.204 ms
** 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.
[ideas] speed=duration: FPS: 97 FrameTime: 10.309 ms
** 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.
[jellyfish] <default>: FPS: 129 FrameTime: 7.752 ms
** 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.
[terrain] <default>: FPS: 47 FrameTime: 21.277 ms
** 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.
[shadow] <default>: FPS: 113 FrameTime: 8.850 ms
** 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.
[refract] <default>: FPS: 61 FrameTime: 16.393 ms
** 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.
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 129 FrameTime: 7.752 ms
** 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.
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 129 FrameTime: 7.752 ms
** 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.
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 130 FrameTime: 7.692 ms
** 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.
[function] fragment-complexity=low:fragment-steps=5: FPS: 131 FrameTime: 7.634 ms
** 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.
[function] fragment-complexity=medium:fragment-steps=5: FPS: 132 FrameTime: 7.576 ms
** 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.
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 133 FrameTime: 7.519 ms
** 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.
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 130 FrameTime: 7.692 ms
** 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.
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 145 FrameTime: 6.897 ms
=======================================================
                                  glmark2 Score: 119 
=======================================================
hsm@localhost:~$
virglrenderer-mesa-zink
hsm@localhost:~$ glmark2
** 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 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa
    GL_RENDERER:   virgl (zink (Turnip Adreno (TM) 740))
    GL_VERSION:    4.5 (Compatibility Profile) Mesa 23.1.5
=======================================================
** 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: FPS: 103 FrameTime: 9.709 ms
** 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=true: FPS: 107 FrameTime: 9.346 ms
** 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.
[texture] texture-filter=nearest: FPS: 118 FrameTime: 8.475 ms
** 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.
[texture] texture-filter=linear: FPS: 142 FrameTime: 7.042 ms
** 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.
[texture] texture-filter=mipmap: FPS: 114 FrameTime: 8.772 ms
** 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.
[shading] shading=gouraud: FPS: 108 FrameTime: 9.259 ms
** 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.
[shading] shading=blinn-phong-inf: FPS: 109 FrameTime: 9.174 ms
** 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.
[shading] shading=phong: FPS: 108 FrameTime: 9.259 ms
** 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.
[shading] shading=cel: FPS: 105 FrameTime: 9.524 ms
** 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.
[bump] bump-render=high-poly: FPS: 85 FrameTime: 11.765 ms
** 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.
[bump] bump-render=normals: FPS: 113 FrameTime: 8.850 ms
** 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.
[bump] bump-render=height: FPS: 114 FrameTime: 8.772 ms
** 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.
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 113 FrameTime: 8.850 ms
** 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.
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 110 FrameTime: 9.091 ms
** 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.
[pulsar] light=false:quads=5:texture=false: FPS: 110 FrameTime: 9.091 ms
** 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.
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 80 FrameTime: 12.500 ms
** 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.
[desktop] effect=shadow:windows=4: FPS: 96 FrameTime: 10.417 ms
** 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.
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 81 FrameTime: 12.346 ms
** 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.
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 87 FrameTime: 11.494 ms
** 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.
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 87 FrameTime: 11.494 ms
** 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.
[ideas] speed=duration: FPS: 81 FrameTime: 12.346 ms
** 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.
[jellyfish] <default>: FPS: 103 FrameTime: 9.709 ms
** 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.
[terrain] <default>: FPS: 40 FrameTime: 25.000 ms
** 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.
[shadow] <default>: FPS: 93 FrameTime: 10.753 ms
** 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.
[refract] <default>: FPS: 59 FrameTime: 16.949 ms
** 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.
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 114 FrameTime: 8.772 ms
** 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.
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 115 FrameTime: 8.696 ms
** 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.
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 114 FrameTime: 8.772 ms
** 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.
[function] fragment-complexity=low:fragment-steps=5: FPS: 113 FrameTime: 8.850 ms
** 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.
[function] fragment-complexity=medium:fragment-steps=5: FPS: 113 FrameTime: 8.850 ms
** 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.
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 114 FrameTime: 8.772 ms
** 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.
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 112 FrameTime: 8.929 ms
** 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.
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 112 FrameTime: 8.929 ms
=======================================================
                                  glmark2 Score: 102 
=======================================================
hsm@localhost:~$
zink+turnip without DRI3
hsm@localhost:~$ MESA_VK_WSI_DEBUG=sw MESA_NO_ERROR=1 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/freedreno_icd.aarch64.json glmark2
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa
    GL_RENDERER:   zink Vulkan 1.3(Turnip Adreno (TM) 740 (MESA_TURNIP))
    GL_VERSION:    4.5 (Compatibility Profile) Mesa 23.1.5
=======================================================
[build] use-vbo=false: FPS: 122 FrameTime: 8.197 ms
[build] use-vbo=true: FPS: 123 FrameTime: 8.130 ms
[texture] texture-filter=nearest: FPS: 123 FrameTime: 8.130 ms
[texture] texture-filter=linear: FPS: 122 FrameTime: 8.197 ms
[texture] texture-filter=mipmap: FPS: 121 FrameTime: 8.264 ms
[shading] shading=gouraud: FPS: 120 FrameTime: 8.333 ms
[shading] shading=blinn-phong-inf: FPS: 121 FrameTime: 8.264 ms
[shading] shading=phong: FPS: 120 FrameTime: 8.333 ms
[shading] shading=cel: FPS: 120 FrameTime: 8.333 ms
[bump] bump-render=high-poly: FPS: 114 FrameTime: 8.772 ms
[bump] bump-render=normals: FPS: 121 FrameTime: 8.264 ms
[bump] bump-render=height: FPS: 121 FrameTime: 8.264 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 121 FrameTime: 8.264 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 114 FrameTime: 8.772 ms
[pulsar] light=false:quads=5:texture=false: FPS: 122 FrameTime: 8.197 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 111 FrameTime: 9.009 ms
[desktop] effect=shadow:windows=4: FPS: 114 FrameTime: 8.772 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 111 FrameTime: 9.009 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 107 FrameTime: 9.346 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 108 FrameTime: 9.259 ms
[ideas] speed=duration: FPS: 97 FrameTime: 10.309 ms
[jellyfish] <default>: FPS: 111 FrameTime: 9.009 ms
[terrain] <default>: FPS: 58 FrameTime: 17.241 ms
[shadow] <default>: FPS: 101 FrameTime: 9.901 ms
[refract] <default>: FPS: 72 FrameTime: 13.889 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 106 FrameTime: 9.434 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 108 FrameTime: 9.259 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 106 FrameTime: 9.434 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 106 FrameTime: 9.434 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 105 FrameTime: 9.524 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 105 FrameTime: 9.524 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 100 FrameTime: 10.000 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 102 FrameTime: 9.804 ms
=======================================================
                                  glmark2 Score: 110 
=======================================================
hsm@localhost:~$
zink+turnip with DRI3
hsm@localhost:~$ MESA_NO_ERROR=1 TU_DEBUG=noconform MESA_LOADER_DRIVER_OVERRIDE=zink VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/freedreno_icd.aarch64.json glmark2
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa
    GL_RENDERER:   zink Vulkan 1.3(Turnip Adreno (TM) 740 (MESA_TURNIP))
    GL_VERSION:    4.5 (Compatibility Profile) Mesa 23.1.5
=======================================================
[build] use-vbo=false: FPS: 578 FrameTime: 1.730 ms
[build] use-vbo=true: FPS: 612 FrameTime: 1.634 ms
[texture] texture-filter=nearest: FPS: 566 FrameTime: 1.767 ms
[texture] texture-filter=linear: FPS: 572 FrameTime: 1.748 ms
[texture] texture-filter=mipmap: FPS: 568 FrameTime: 1.761 ms
[shading] shading=gouraud: FPS: 537 FrameTime: 1.862 ms
[shading] shading=blinn-phong-inf: FPS: 535 FrameTime: 1.869 ms
[shading] shading=phong: FPS: 533 FrameTime: 1.876 ms
[shading] shading=cel: FPS: 532 FrameTime: 1.880 ms
[bump] bump-render=high-poly: FPS: 399 FrameTime: 2.506 ms
[bump] bump-render=normals: FPS: 591 FrameTime: 1.692 ms
[bump] bump-render=height: FPS: 587 FrameTime: 1.704 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 503 FrameTime: 1.988 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 407 FrameTime: 2.457 ms
[pulsar] light=false:quads=5:texture=false: FPS: 501 FrameTime: 1.996 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 324 FrameTime: 3.086 ms
[desktop] effect=shadow:windows=4: FPS: 440 FrameTime: 2.273 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 430 FrameTime: 2.326 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 317 FrameTime: 3.155 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 460 FrameTime: 2.174 ms
[ideas] speed=duration: FPS: 288 FrameTime: 3.472 ms
[jellyfish] <default>: FPS: 438 FrameTime: 2.283 ms
[terrain] <default>: FPS: 131 FrameTime: 7.634 ms
[shadow] <default>: FPS: 387 FrameTime: 2.584 ms
[refract] <default>: FPS: 189 FrameTime: 5.291 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 553 FrameTime: 1.808 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 551 FrameTime: 1.815 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 555 FrameTime: 1.802 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 552 FrameTime: 1.812 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 538 FrameTime: 1.859 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 547 FrameTime: 1.828 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 547 FrameTime: 1.828 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 543 FrameTime: 1.842 ms
=======================================================
                                  glmark2 Score: 479 
=======================================================
hsm@localhost:~$ 

@fasti123
Copy link

@hansm629 could you please upload the mesa 23.1.5 deb package as well? Thanks

@hansm629
Copy link
Author

hansm629 commented Aug 17, 2023

@hansm629 could you please upload the mesa 23.1.5 deb package as well? Thanks

build mesa in Ubuntu is very easy.

After installing the mesa 23.1.5 build
Install turnip with DRI3 deb package.
mesa-vulkan-kgsl_23.3.0-devel-DRI3_20230815_arm64.zip

[Install dependency packages and other packages]

$ sudo echo "deb-src [signed-by="/usr/share/keyrings/ubuntu-archive-keyring.gpg"] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse" >> /etc/apt/sources.list
$ sudo apt update
$ sudo apt build-dep mesa
$ sudo apt install wget

[Download the mesa 23.1.5 source]

$ wget https://mesa.freedesktop.org/archive/mesa-23.1.5.tar.xz
$ tar -xf mesa-23.1.5.tar.xz

[Build and install]

$ cd mesa-23.1.5
$ meson build -Dgbm=enabled -Dopengl=true -Degl=enabled -Degl-native-platform=x11 -Dgles1=disabled -Dgles2=enabled -Ddri3=enabled -Dglx=dri -Dllvm=enabled -Dshared-llvm=disabled -Dplatforms=x11,wayland -Dgallium-drivers=swrast,virgl,zink -Dosmesa=true -Dglvnd=true -Dxmlconfig=disabled
$ sudo ninja -C build install

@xDoge26
Copy link
Owner

xDoge26 commented Aug 17, 2023

$ meson build -Dgbm=enabled -Dopengl=true -Degl=enabled -Degl-native-platform=x11 -Dgles1=disabled -Dgles2=enabled -Ddri3=enabled -Dglx=dri -Dllvm=enabled -Dshared-llvm=disabled -Dplatforms=x11,wayland -Dgallium-drivers=swrast,virgl,zink -Dosmesa=true -Dglvnd=true -Dxmlconfig=disabled

You dont need to compile opengl,virgl driver because freedreno opengl driver is still non functional on android afaik

@Xynonners
Copy link

Xynonners commented Aug 18, 2023

Hi all, I'm very interested in this since I also have an S8 Ultra I've been meaning to use as my linux laptop.

Unfortunately, information seems scattered all over the place so I'm sort of an idiot right now.

Maybe this telegram would be of interest? t.me/adreno_driver

they post mesa turnip builds (some KGSL), though not sure what they are exactly.

also, is the deb supposed to be built/installed within chroot or within termux? I'm not exactly sure how the system layout works here.

@fasti123
Copy link

With:

    GL_RENDERER:    zink Vulkan 1.3(Turnip Adreno (TM) 740 (MESA_TURNIP))
    GL_VERSION:     4.6 (Compatibility Profile) Mesa 23.1.5

i have some weird issues with fonts in several apps when running with zink in proot xfce4:
e.g. VSCODE
image
Chromium:
image

Anybody can confirm?

@babarosaM33
Copy link

@hansm629

I followed your instruction, compiling mesa-23.1.5 then installing the uploaded package, but when I run glmark2 without MESA_VK_WSI_DEBUG=sw the system complain that it DRI3 not detected.

do you have any advice?

@hansm629
Copy link
Author

$ meson build -Dgbm=enabled -Dopengl=true -Degl=enabled -Degl-native-platform=x11 -Dgles1=disabled -Dgles2=enabled -Ddri3=enabled -Dglx=dri -Dllvm=enabled -Dshared-llvm=disabled -Dplatforms=x11,wayland -Dgallium-drivers=swrast,virgl,zink -Dosmesa=true -Dglvnd=true -Dxmlconfig=disabled

You dont need to compile opengl,virgl driver because freedreno opengl driver is still non functional on android afaik

@xDoge26
There is a situation where a virgl is needed.

I use virgl and turnip together on PRoot Ubuntu.

Because when I run XFCE4-SESSION with zink+turnip
I get an error that the GUI is not displaying properly.

@hansm629
Copy link
Author

@Banzayka

hello.
Are you talking about mesa turnip dri3 running in Termux native XFCE4 environment?

It is already distributed in Termux main-repo.

pkg install mesa-vulkan-icd-freedreno-dri3

You can install it by entering the above command.

It is based on mesa 24.0.4 and supports Adreno 6xx/7xx series.
(However, Adreno 750 is not yet supported.)

MESA_NO_ERROR=1 MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform MESA_GL_VERSION_OVERRIDE=4.6COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 Programname

If you enter the above command or add it as an environment variable,
Programs and XFCE4 can be accelerated to OpenGL4.6&OpenGL ES3.2 through zink.

Before running XFCE4 with zink

You must modify vblank_mode to off in xfwm4.xml.

@Banzayka
Copy link

Banzayka commented Jun 1, 2024

@hansm629

Many thanks for your time & efforts, this is greatly appreciated! You literally made my day, this topic is much clearer to me now & I'm super excited to continue exploring ^^

Special thanks for noob-friendly style of answer, very detailed & helpful! :)

@JustYou0-0
Copy link

@hansm629

Sir, I'm really² newbie to this thing,

Can I install your turnip package to my chroot Debian/Ubuntu?

And how to launch xfce4 with hardware acceleration? / What commands to add in my start scripts?

Many² thanks 👍

@hansm629
Copy link
Author

hansm629 commented Jun 12, 2024

@JustYou0-0

hello. sir
Sorry for the late reply.

yes
The mesa turnip dri3 (mesa-vulkan-kgsl_24.1.0-devel-20240324_arm64.deb) I build is Available in proot ubuntu and proot debian!

Adreno 650, Adreno 730, Adreno 740, Adreno 750
Confirmed that it works well.

The proot debian linux script I run is as follows:

#!/bin/sh
killall -9 termux-x11 pulseaudio virgl_test_server_android
termux-wake-lock; termux-toast "Starting Debian Liunx"

# Termux-X11 start
am start --user 0 -n com.termux.x11/com.termux.x11.MainActivity
df | grep /storage | cut -d "/" -f 4-
# X11 start
XDG_RUNTIME_DIR=${TMPDIR} termux-x11 :0 -ac -extension MIT-SHM &
sleep 3

# Audio server
pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1
pacmd load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1

# Linux login
touch ~/something
proot-distro login --bind ~/something:/proc/bus/pci/devices debian --user userid --shared-tmp --no-sysvipc -- bash -c "export DISPLAY=:0 PULSE_SERVER=tcp:127.0.0.1:4713; MESA_NO_ERROR=1 MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform MESA_GL_VERSION_OVERRIDE=4.6COMPAT MESA_GLES_VERSION_OVERRIDE=3.2 dbus-launch --exit-with-session startxfce4"

proot-distro login --bind ~/something:/proc/bus/pci/devices debian --user userid
In the script above

For userid, enter the sudo ID you are using.

Before running XFCE4 with zink
You must modify vblank_mode to off in xfwm4.xml.

@hansm629
Copy link
Author

@romanovj

hello. sir
long time no see.

Thanks to you, I was able to successfully build turnip dri3 for proot Linux! :)

I would like to ask for your help again.

https://github.com/alexvorxx/Zink-Mesa-Xlib/releases/download/v0.0.7beta/04-wsi-termux-x11-only-kgsl_fixed.patch

Via the Termux-x11 dri3 patch above
I'm trying to build mesa-vulkan-icd-freedreno for Termux native on the mesa-24.1.1 branch that started supporting Adreno 750, but it keeps failing.
(I'm planning to test it on the Galaxy S24 Ultra.)

I am familiar with build deb packages for Linux, but I am not yet familiar with building Termux packages and it seems difficult....

Could you build it as a deb for Termux like before?

@MastaG
Copy link

MastaG commented Jun 16, 2024

The Debian packaging system is really awful to work with.
I wanted to setup a CI repository doing nightly builds of mesa with the turnip kgsl/dri patch for x86, x86-64 (for slipstreaming into Fex rootfs, arm32 and arm64.
But the way those debian packages are built seems like you have to provide a lot of manual info in the control files...
What a nightmare compared to arch linux pkgbuild or redhat spec files.

@hansm629
Copy link
Author

hansm629 commented Jun 16, 2024

@MastaG
deb running on Proot Debian was successful.
The deb running on Termux native XFCE4 keeps failing.

@MastaG
Copy link

MastaG commented Jul 1, 2024

So I've asked airidosas252 for his latest dri3/dmabuf/kgsl patches, a user named "xiaoyangnoob" replied with a copy of these patches in his personal github repository.
See: airidosas252/glibc-wine#4 (comment)

So I've a github runner which takes oibaf's nightly mesa builds and rebuild them with these patches applied and kgsl enabled.
https://launchpad.net/~mastag/+archive/ubuntu/mesa-turnip-kgsl
Here's the source for the buildscript, action and patches:
https://github.com/MastaG/mesa-turnip-ppa/tree/main (I welcome anybody to open up PR's for improvements)

It's currently only for Ubuntu 24.04.
I'll soon extend the build script to use Docker to build for 24.10 as well (github actions doesn't have a 24.10 runner yet).

Also mesa git currently fails to build for armhf, so no 32bit driver yet.
See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11392
But I've setup Ubuntu 24.04 on my Odroid XU4 to see if I can easily fix this myself.

@MastaG
Copy link

MastaG commented Jul 1, 2024

So I've fixed armhf (32bit) builds and also added a runner for building the ppa for Ubuntu 24.10.
Unfortunately we'll have to wait for obiaf's private key to be migrated to 4096bit before we can check out and build for 24.10.
But that shouldn't take long.

@hansm629
Copy link
Author

hansm629 commented Jul 2, 2024

@MastaG

When build the turnip package

fix-for-anon-file.patch
fix-for-getprogname.patch
mesa-2934e1f-termux-x11-dri3.patch
zink_fixes.patch

Do you apply and build them all?

Or do you build by only applying mesa-2934e1f-termux-x11-dri3.patch?

@MastaG
Copy link

MastaG commented Jul 2, 2024

@hansm629
I've applied them all.
The script loops through all files in the directory and adds them to debian/patches.
See the package details (just click on "mesa"): https://launchpad.net/~mastag/+archive/ubuntu/mesa-turnip-kgsl/+packages
Feel free to update/submit other patches, then they'll be applied for the next nightly update :)

I've just tried the ppa on my Samsung S24 and it works great.

sudo add-apt-repository ppa:mastag/mesa-turnip-kgsl
sudo apt update
sudo apt -y dist-upgrade

With: MESA_NO_ERROR=1 MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform
And: vblank_mode set to off in xfwm4.xml.
Schermafdruk_2024-07-02_09-42-26

I've fixed the armhf (32bit) mesa build, so we can use it with box86 as well :)

Now we only need to wait for launchpad to re-sign Oibaf's packages with a new private key so we can build for Ubuntu 24.10 as well.

Thanks to @Weab-chan I've also added a runner for building nightly turnip driver releases for use with emulators such as Yuzu, Strato, Flycast etc
Both vanilla and with the patches applied.
These are added under the "Releases" section.

@hansm629
Copy link
Author

hansm629 commented Jul 2, 2024

@MastaG
What is the approximate performance of vkmark?

@MastaG
Copy link

MastaG commented Jul 2, 2024

@hansm629

$ vkmark
ERROR:             VkInstanceCreateInfo::pApplicationInfo::apiVersion has value of 0 which is not permitted. If apiVersion is not 0, then it must be greater than or equal to the value of VK_API_VERSION_1_0 [VUID-VkApplicationInfo-apiVersion]
=======================================================
    vkmark 2017.08
=======================================================
    Vendor ID:      0x5143
    Device ID:      0x43051401
    Device Name:    Turnip Adreno (TM) 750
    Driver Version: 101345449
    Device UUID:    1ee7368ad77036eba2841dac6b30f6aa
=======================================================
[vertex] device-local=true: FPS: 202 FrameTime: 4.950 ms
[vertex] device-local=false: FPS: 189 FrameTime: 5.291 ms
[texture] anisotropy=0: FPS: 186 FrameTime: 5.376 ms
[texture] anisotropy=16: FPS: 188 FrameTime: 5.319 ms
[shading] shading=gouraud: FPS: 186 FrameTime: 5.376 ms
[shading] shading=blinn-phong-inf: FPS: 193 FrameTime: 5.181 ms
[shading] shading=phong: FPS: 201 FrameTime: 4.975 ms
[shading] shading=cel: FPS: 183 FrameTime: 5.464 ms
[effect2d] kernel=edge: FPS: 200 FrameTime: 5.000 ms
[effect2d] kernel=blur: FPS: 182 FrameTime: 5.495 ms
[desktop] <default>: FPS: 188 FrameTime: 5.319 ms
[cube] <default>: FPS: 194 FrameTime: 5.155 ms
[clear] <default>: FPS: 240 FrameTime: 4.167 ms
=======================================================
                                   vkmark Score: 194
=======================================================

@hansm629
Copy link
Author

hansm629 commented Jul 2, 2024

@MastaG

Considering Adreno 750, the performance seems to be too low.

https://github.com/alexvorxx/Zink-Mesa-Xlib/releases/download/v0.0.7beta/04-wsi-termux-x11-only-kgsl_fixed.patch

After applying the above patch and building turnip in mesa-main
As a result of testing on Adreno 740, the performance is as follows.

$ vkmark
=======================================================
    vkmark 2017.08
=======================================================
    Vendor ID:      0x5143
    Device ID:      0x43050A01
    Device Name:    Turnip Adreno (TM) 740
    Driver Version: 100667491
    Device UUID:    0188d9cfb041b3bfcf0ce271ca9e080d
=======================================================
[vertex] device-local=true: FPS: 2211 FrameTime: 0.452 ms
[vertex] device-local=false: FPS: 2190 FrameTime: 0.457 ms
[texture] anisotropy=0: FPS: 2122 FrameTime: 0.471 ms
[texture] anisotropy=16: FPS: 2138 FrameTime: 0.468 ms
[shading] shading=gouraud: FPS: 2126 FrameTime: 0.470 ms
[shading] shading=blinn-phong-inf: FPS: 2120 FrameTime: 0.472 ms
[shading] shading=phong: FPS: 2095 FrameTime: 0.477 ms
[shading] shading=cel: FPS: 2130 FrameTime: 0.469 ms
[effect2d] kernel=edge: FPS: 2464 FrameTime: 0.406 ms
[effect2d] kernel=blur: FPS: 2270 FrameTime: 0.441 ms
[desktop] <default>: FPS: 2278 FrameTime: 0.439 ms
[cube] <default>: FPS: 2446 FrameTime: 0.409 ms
[clear] <default>: FPS: 2313 FrameTime: 0.432 ms
=======================================================
                                   vkmark Score: 2223
=======================================================

@MastaG
Copy link

MastaG commented Jul 2, 2024

@hansm629

Thank you for the feedback, I'll try that patch for the next nightly build and report back the vlmark results to you :)

@MastaG
Copy link

MastaG commented Jul 3, 2024

@hansm629
I've applied https://github.com/alexvorxx/Zink-Mesa-Xlib/releases/download/v0.0.7beta/04-wsi-termux-x11-only-kgsl_fixed.patch
See the changelog where it states which patches and mesa merge requests are being applied: https://launchpadlibrarian.net/737765943/mesa_24.2~git2407030600.260a5f~oibaf-turnip-kgsl~n_source.changes

I'm getting the same ~200fps in vkmark.

I have my phone connected to usb-c dock with keyboard and mouse and I'm using Termux-x11 on Samsung Dex.
I don't know why I'm getting such low fps.

I have the following variables set:

XDG_RUNTIME_DIR=/tmp
EXTERNAL_STORAGE=/sdcard
MESA_LOADER_DRIVER_OVERRIDE=zink
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/freedreno_icd.aarch64.json:/usr/share/vulkan/icd.d/freedreno_icd.armv7l.json
TU_DEBUG=noconform
MESA_NO_ERROR=1

For the record these are all the patches which are being applied on top of mesa main git:
https://github.com/MastaG/mesa-turnip-ppa/blob/main/turnip-patches/04-wsi-termux-x11-only-kgsl_fixed.patch
https://github.com/MastaG/mesa-turnip-ppa/blob/main/turnip-patches/fix-for-anon-file.patch
https://github.com/MastaG/mesa-turnip-ppa/blob/main/turnip-patches/fix-for-getprogname.patch
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29873
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29871
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29938

@hansm629
Copy link
Author

hansm629 commented Jul 3, 2024

@MastaG
I tested vkmark on turnip that I build myself.

applied the 04-wsi-termux-x11-only-kgsl_fixed.patch patch to the mesa-main branch.

  • Host device: Galaxy S24 Ultra
  • PRoot: Debian sid
$ vkmark
=======================================================
    vkmark 2017.08
=======================================================
    Vendor ID:      0x5143
    Device ID:      0x43051401
    Device Name:    Turnip Adreno (TM) 750
    Driver Version: 100667491
    Device UUID:    77a39f4e67f509fab897ccc71c89c9b1
=======================================================
[vertex] device-local=true: FPS: 1856 FrameTime: 0.539 ms
[vertex] device-local=false: FPS: 1895 FrameTime: 0.528 ms
[texture] anisotropy=0: FPS: 1788 FrameTime: 0.559 ms
[texture] anisotropy=16: FPS: 1805 FrameTime: 0.554 ms
[shading] shading=gouraud: FPS: 1811 FrameTime: 0.552 ms
[shading] shading=blinn-phong-inf: FPS: 1830 FrameTime: 0.546 ms
[shading] shading=phong: FPS: 1812 FrameTime: 0.552 ms
[shading] shading=cel: FPS: 1837 FrameTime: 0.544 ms
[effect2d] kernel=edge: FPS: 2010 FrameTime: 0.498 ms
[effect2d] kernel=blur: FPS: 1688 FrameTime: 0.592 ms
[desktop] <default>: FPS: 1952 FrameTime: 0.512 ms
[cube] <default>: FPS: 1975 FrameTime: 0.506 ms
[clear] <default>: FPS: 1391 FrameTime: 0.719 ms
=======================================================
                                   vkmark Score: 1819
=======================================================

I tested it in Dex Mod after connecting it to a 1920x1080 display...

It's higher than the your result,
but for some reason It is lower than the result of Galaxy Tab S9 Ultra (Adreno 740).

Adreno 740 is tested in Dex Mod after connecting to a 1920x1080 display.
A score of 2200 or higher is obtained.

In my personal opinion, the termux-x11-dri3 patch does not yet properly support Adreno 750.

I downloaded the package your build below and tested it with vkmark.

http://ppa.launchpadcontent.net/mastag/mesa-turnip-kgsl/ubuntu/pool/main/m/mesa/mesa-vulkan-drivers_24.2~git2406300600.682153~oibaf-turnip-kgsl~n_arm64.deb

$ vkmark
=======================================================
    vkmark 2017.08
=======================================================
    Vendor ID:      0x5143
    Device ID:      0x43051401
    Device Name:    Turnip Adreno (TM) 750
    Driver Version: 101345449
    Device UUID:    1ee7368ad77036eba2841dac6b30f6aa
=======================================================
[vertex] device-local=true: FPS: 537 FrameTime: 1.862 ms
[vertex] device-local=false: FPS: 604 FrameTime: 1.656 ms
[texture] anisotropy=0: FPS: 564 FrameTime: 1.773 ms
[texture] anisotropy=16: FPS: 605 FrameTime: 1.653 ms
[shading] shading=gouraud: FPS: 577 FrameTime: 1.733 ms
[shading] shading=blinn-phong-inf: FPS: 539 FrameTime: 1.855 ms
[shading] shading=phong: FPS: 562 FrameTime: 1.779 ms
[shading] shading=cel: FPS: 518 FrameTime: 1.931 ms
[effect2d] kernel=edge: FPS: 671 FrameTime: 1.490 ms
[effect2d] kernel=blur: FPS: 570 FrameTime: 1.754 ms
[desktop] <default>: FPS: 573 FrameTime: 1.745 ms
[cube] <default>: FPS: 712 FrameTime: 1.404 ms
[clear] <default>: FPS: 665 FrameTime: 1.504 ms
=======================================================
                                   vkmark Score: 592
=======================================================

Performance is too low.
The mesa-2934e1f-termux-x11-dri3.patch patch seems to have a performance problem.

But even taking that into account, your benchmark results are too low.
Are you using the latest version of termux-x11?

If it is not the latest version, update the apk and test again.

@MastaG
Copy link

MastaG commented Jul 3, 2024

@hansm629 Thanks a lot for testing on both of your devices.
My device is also a S24 Ultra.

I've updated the build file to only build with the 04-wsi-termux-x11-only-kgsl_fixed.patch.
Nothing else for now :)
See: https://github.com/MastaG/mesa-turnip-ppa/blob/main/build_ppa.sh

We'll have to wait for obiaf to build the next version tonight, then ours will trigger as well.

Btw I'm building with both msm and kgsl enabled: -Dfreedreno-kmds=msm,kgsl.
Do you also build with both? or only kgsl?

As for termux-x11, I just downloaded a release from here: https://github.com/termux/termux-x11/releases/tag/nightly
But it's from 3 or 4 months ago, so I'll update that as well tomorrow and try out the new build from the PPA :)

@MastaG
Copy link

MastaG commented Jul 3, 2024

@hansm629
Quick update using the latest nightly build of termux-x11 from: https://github.com/termux/termux-x11/releases/tag/nightly

I found out the problem when running vkmark.
When my phone is connected to usb-c dock in Dex mode, the phone screen turns off and the cpu and/or gpu are in a lower performance state.
This causes the benchmark to produce lower results.

When I start scrolling on a random webpage (using the chrome browser) on my phone screen while the vkmark benchmark is running, the first test will show:

[vertex] device-local=true: FPS: 887 FrameTime: 1.127 ms

It's still not within the 2000+ FPS but it's a lot better :)

So for some reason my S24 decides that Termux and/or Termux-X11 shouldn't be using a lot of cpu/gpu cycles while the phone screen is turned off :(

@welisonmiranda
Copy link

@hansm629 Hello, could you please share the deb of your last build for debian sid, Im trying to compile but I couldt apply the patch

@MastaG
Copy link

MastaG commented Jul 14, 2024

The dmabuf patch has been upstreamed by Danylo.

See my repository for nightly builds:
https://github.com/MastaG/mesa-turnip-ppa

I've rebased the dri3.patch on mesa main git.
You can grab it from the turnip-patches directory.
Or grab the deb package from my PPA:
https://launchpad.net/~mastag/+archive/ubuntu/mesa-turnip-kgsl

@kde-yyds
Copy link

There's freedreno kgsl dri3 patch in xMeM/termux-packages. It works well on my a730.Screenshot_2024-08-14-16-02-55-339_com.termux.x11.jpg

@hansm629
Copy link
Author

@kde-yyds
https://github.com/xMeM/termux-packages/actions/runs/10403066269

Is this the package you mentioned?

I'm curious what the environment variables used by freedreno are.

@kde-yyds
Copy link

@kde-yyds
https://github.com/xMeM/termux-packages/actions/runs/10403066269

Is this the package you mentioned?

I'm curious what the environment variables used by freedreno are.

yeah.
I applied the patches and built mesa in a chroot archlinux container.
MESA_LOADER_DRIVER_OVERRIDE=kgsl

@hansm629
Copy link
Author

@kde-yyds
thank you
Works on Adreno 740.

But the glxinfo -B command doesn't work and
glmark2-es2 not working and

vulkan does not have dri3 patch
MESA_VK_WSI_DEBUG=sw requires the environment variable to work.
Performance is very, very slow.

OpenGL ES3.2 operation issue resolved
glxinfo -B command works and
I think it would be perfect if there was a dri3 patch on turnip.

@hansm629
Copy link
Author

@kde-yyds
Unfortunately, it doesn't work on Adreno 750.

@astroskyoffical
Copy link

Anyone at all have termux native working for the 750? Try as I might I get get hardware acceleration working for native....idk what to do. All this stuff is confusing but I'm trying to learn. I understand the freedreno package and I installed it. Unfortunately not working or causes errors. Hard to work around. Is there a way to built it to support it? What can I do?

@stevefan1999-personal
Copy link

I used the driver from https://github.com/K11MCH1/WinlatorTurnipDrivers/releases/tag/winlator_v25.0_r5, it works inside proot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests