xDoge26 / proot-setup

64 stars 13 forks source link

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

Open hansm629 opened 1 year ago

hansm629 commented 1 year ago

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.

xDoge26 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

hansm629 commented 1 year ago

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 commented 1 year ago

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

hansm629 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

try to compile mesa main without vulkan

xDoge26 commented 1 year ago

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

hansm629 commented 1 year ago

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 commented 1 year ago

@hansm629 you need to install clang libpolly

clang -v

apt-get install libpolly-VERSION-dev

where version is 15/16/17/18

romanovj commented 1 year ago

you can also try to build mesa 22 - 22.1

hansm629 commented 1 year ago

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 commented 1 year ago

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

hansm629 commented 1 year ago

@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 commented 1 year ago

all thanks to xMeM fot his patches

hansm629 commented 1 year ago

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]

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] : 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] : 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] : 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] : 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] : 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] : 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] : 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] : 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] : FPS: 111 FrameTime: 9.009 ms [terrain] : FPS: 58 FrameTime: 17.241 ms [shadow] : FPS: 101 FrameTime: 9.901 ms [refract] : 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] : FPS: 438 FrameTime: 2.283 ms [terrain] : FPS: 131 FrameTime: 7.634 ms [shadow] : FPS: 387 FrameTime: 2.584 ms [refract] : 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 commented 1 year ago

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

hansm629 commented 1 year ago

@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 commented 1 year ago

$ 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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

$ 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 commented 1 year ago

@Xynonners

turnip is an open source Vulkan driver from Adreno.

If you combine it with mesa zink Hardware acceleration for Vulkan1.3, OpenGL4.5, OpenGL ES3.2 is possible on Linux.

To use with PRoot/Chroot

https://github.com/xDoge26/proot-setup/files/12345979/mesa-vulkan-kgsl_23.3.0-devel-DRI3_20230815_arm64.zip

After installing the above deb package

vulkan on

TU_DEBUG=noconform

opengl on

MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform

If you run the program with the above environmental variables, GPU acceleration is achieved through the turnip.

hansm629 commented 1 year ago

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?

@fasti123

What is your PRoot Linux environment like?

Are you using a Termux-X11 that supports DIR3?

What is the version information of the Chromium browser?

hansm629 commented 1 year ago

@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?

@babarosaM33

I think it's because you used Termux-X11 that doesn't support DRI3.

Use the latest version of Termux-X11.

https://github.com/termux/termux-x11/actions

DRI3 is supported starting with Build #474.

Use a higher build version than that

fasti123 commented 1 year ago

image

I start xcfe session with GALLIUM_DRIVER=virpipe xfce4-session using

termux-x11 :1.0 &
virgl_test_server_android --angle-gl &

I use the latest termux-x11 build

hansm629 commented 1 year ago

image

I start xcfe session with GALLIUM_DRIVER=virpipe xfce4-session using

termux-x11 :1.0 &
virgl_test_server_android --angle-gl &

I use the latest termux-x11 build

@fasti123

The environment I am using is PRoot-Distro Ubuntu 22.04.3 LTS XFCE4-SESSIN 4.18, so I don't think it will help much.

neofetch

fasti123 commented 1 year ago

@hansm629 if i just use zink alone and not vulkan 1.3 zink the problems are gone. As soon as i install the mesa-zink package i get these font displaying issues.

hansm629 commented 1 year ago

@hansm629 if i just use zink alone and not vulkan 1.3 zink the problems are gone. As soon as i install the mesa-zink package i get these font displaying issues.

@fasti123

What package did you install in Termux?

mesa-vulkan-icd-freedreno-dri3_23.1.4_aarch64.deb? (with mesa, vulkan-loader-generic) or vulkan-loader-android.deb? (with mesa-zink)

I both packages I tested it on the Galaxy S23 Ultra and Galaxy Tab S9 Ultra, but the XFCE4 session itself did not run.

https://github.com/termux/termux-packages/issues/17567 https://github.com/termux-user-repository/tur/issues/530

So in PRoot-Distro Ubuntu You have build a Turnip with DRI3 patch.

fasti123 commented 1 year ago

i don't have anything in termux installed i just run it with xcfe-session &

If i just install your https://github.com/xDoge26/proot-setup/files/12345979/mesa-vulkan-kgsl_23.3.0-devel-DRI3_20230815_arm64.zip package in proot i get the following output for glmark2: zink if i install mesa-zink (pkg install mesa-zink) i then get: Vulkan 1.3 zink even if i compile & install mesa myself i just get zink output from glmark2 without vulkan. Not sure what im missing.

hansm629 commented 1 year ago

i don't have anything in termux installed i just run it with xcfe-session &

If i just install your https://github.com/xDoge26/proot-setup/files/12345979/mesa-vulkan-kgsl_23.3.0-devel-DRI3_20230815_arm64.zip package in proot i get the following output for glmark2: zinkif i install mesa-zink (pkg install mesa-zink) i then get: Vulkan 1.3 zink even if i compile & install mesa myself i just get zink output from glmark2 without vulkan. Not sure what im missing.

@fasti123

The screenshot you posted is not PRoot-Distro.

$ proot-distro install ubuntu

Install PRoot Ubuntu with the above command.

Log in to PRoot Ubuntu and Install key applications including XFCE4.

https://github.com/cheadrian/termux-chroot-proot-wine-box86_64/blob/main/Setup_Proot.md

You may want to refer to the link above.

After installing Ubuntu, install the turnip package I built.

[vulkan on]

TU_DEBUG=noconform applicationname

[OpenGL or OpenGL ES on]

MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform applicationname

If you run the program through the above environment variable command, turnip acceleration is applied.

And termux-x11 should use a version that supports DRI3.

recommend using at least mesa 23.1.3 or higher due to zink compatibility.

You can build it after downloading the source from PRoot.

fasti123 commented 1 year ago

Thanks @hansm629 i got it to work. What does vulkaninfo print out for you? i got an VK_ERROR_INITIALIZATION_FAILED error. Does vulkaninfo work for you in proot?

hansm629 commented 1 year ago

Thanks @hansm629 i got it to work. What does vulkaninfo print out for you? i got an VK_ERROR_INITIALIZATION_FAILED error. Does vulkaninfo work for you in proot?

@fasti123 I too have the same symptoms. It appears to be probably a PRoot bug.

You won't have any problems using it.

MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform glxinfo -B

If the command is entered, the GPU information is normally displayed.

Fcucgvhhhvjv commented 1 year ago

@fasti123 what command do i have to use in termux like virgl_test_server_android and then in proot MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform applicationname ?

fasti123 commented 1 year ago

Exactly, but you don't need to use virgl_test_server_androidif you just want to use zink within proot. AFAIK zink doesn't work with virgl_test_server_android at the moment

Fcucgvhhhvjv commented 1 year ago

@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

@fasti123 I tried it , it fails to start , I get crash log that heap size allocation failed or out of memory . installing the deb kgsl works but i dont see an improvement in video play back , I tested this with a 4k and 2k video with mpv on termux-x11 and glmark 2 , maybe glmark 2 got some 20-30 fps more . Am I missing something ?

fasti123 commented 1 year ago

I guess there won't ever be any hardware accelerated video decoding / encoding within termux. This would require e.g. VA-API support on the freedreno driver, which is not availaible. So only software side video decoding possible for e.g. youtube / vlc / mpv or any other software that is running within termux.

Fcucgvhhhvjv commented 1 year ago

@fasti123 For some reason vlc works for 2k video without any noticeable lag for about 10 seconds then its stops video playback , and for 4k video it doesnt even work for 1 second

Here is the log root@localhost:~# vblank_mode=0 MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform vlc /sdcard/DCIM/b.mp4

VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2) [0000003000019270] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. QStandardPaths: wrong permissions on runtime directory /tmp, 0777 instead of 0700 ATTENTION: default value of option vblank_mode overridden by environment. libGL error: glx: failed to create drisw screen libGL error: failed to load driver: zink [0000007ae8c1cde0] mp4 demux: Fragment sequence discontinuity detected 1 != 0 ATTENTION: default value of option vblank_mode overridden by environment. libEGL warning: egl: failed to create dri2 screen ATTENTION: default value of option vblank_mode overridden by environment. libGL error: glx: failed to create drisw screen libGL error: failed to load driver: zink [0000007ab8004680] glx gl error: cannot create GLX context ATTENTION: default value of option vblank_mode overridden by environment. libEGL warning: egl: failed to create dri2 screen [0000007ab80013f0] xcb_xv vout display error: no available XVideo adaptor [0000007ab80013f0] xcb vout display error: shared memory server-side error: X11 error 10 [0000007ab80013f0] xcb vout display error: same error on retry: X11 error 10 [0000007ab80013f0] xcb_x11 vout display: using buggy X11 server - SSH proxying? [0000007ab80013f0] xcb vout display error: shared memory server-side error: X11 error 10 [0000007ab80013f0] xcb vout display error: same error on retry: X11 error 10 [0000007ab80013f0] xcb_x11 vout display: using buggy X11 server - SSH proxying? [0000007ab80013f0] xcb vout display error: shared memory server-side error: X11 error 10 [0000007ab80013f0] xcb vout display error: same error on retry: X11 error 10 [0000007ab80013f0] xcb_x11 vout display: using buggy X11 server - SSH proxying? [0000007ab80013f0] xcb vout display error: shared memory server-side error: X11 error 10 [0000007ab80013f0] xcb vout display error: same error on retry: X11 error 10 [0000007ab80013f0] xcb_x11 vout display: using buggy X11 server - SSH proxying? [0000007ab80013f0] xcb vout display error: shared memory server-side error: X11 error 10 [0000007ab80013f0] xcb vout display error: same error on retry: X11 error 10 [0000007ab80013f0] xcb_x11 vout display: using buggy X11 server - SSH proxying? [0000007ab80013f0] xcb vout display error: shared memory server-side error: X11 error 10 [0000007ab80013f0] xcb vout display error: same error on retry: X11 error 10 [0000007ab80013f0] xcb_x11 vout display: using buggy X11 server - SSH proxying?

Im using the latest termux-x11 apk and compiled mesa 23.1.5 and im using https://github.com/xDoge26/proot-setup/files/12364475/mesa-vulkan-kgsl_23.3.0-devel-DRI3_20230815_arm64.zip , it says screen is not dri3 compatible .

Fcucgvhhhvjv commented 1 year ago

I managed to run a 2k video using vblank_mode=0 MESA_LOADER_DRIVER_OVERRIDE=zink TU_DEBUG=noconform vlc /sdcard/DCIM/video.mp4 . It doesnt have any noticeable lag . can anyone confirm this ?

yt-dlp LXb3EKWsInQ --format 623 the video i used

I made sure termux-x11 is set to 2k

Jacobw1oo commented 1 year ago

https://github.com/xDoge26/proot-setup/files/12345979/mesa-vulkan-kgsl_23.3.0-devel-DRI3_20230815_arm64.zip works great but where is it companion armhf
(not real) https://github.com/xDoge26/proot-setup/files/12345979/mesa-vulkan-kgsl_23.3.0-devel-DRI3_20230815_armhf.zip

lazimk commented 12 months ago

Hi @hansm629 , I am trying to achieve this in Proot-Debian xcfe4 with my Tab S8 plus.

Is every step mention need to be done inside Proot, or some on termux outside proof? I am new to this. I tried installing ur .Deb in proof. But failed. Can u walk me through steps, how to build, how to apply patches, what are each commands, how to check if it is done successfully?

hansm629 commented 12 months ago

Hi @hansm629 , I am trying to achieve this in Proot-Debian xcfe4 with my Tab S8 plus.

Is every step mention need to be done inside Proot, or some on termux outside proof? I am new to this. I tried installing ur .Deb in proof. But failed. Can u walk me through steps, how to build, how to apply patches, what are each commands, how to check if it is done successfully?

That's Right. Log in to the PRoot-Distro Debian and install the DRI3 patch Turnip driver I build.

Termux-X11 must also be installed with a version that supports DRI3.

hansm629 commented 12 months ago

mesa-vulkan-kgsl_23.3.0-devel-20230905_arm64.deb

This is the DRI3 patch Turnip driver newly build by PRoot-Distro Debian.

The latest commit contents of mesa git are reflected.

Confirmed Issue :