termux-user-repository / tur

A place for all types of Termux packages.
Other
472 stars 87 forks source link

[Bug]: chromium browser "ANGLE: Vulkan Back-end" not work issue #1314

Open hansm629 opened 2 days ago

hansm629 commented 2 days ago

Problem description

I am currently testing mesa-vulkan-icd-wrapper, which allows the use of the Android host Vulkan driver in Termux.

Most SoC GPUs showed poor compatibility with mesa zink, and the Chromium browser either didn’t launch or GPU acceleration didn’t work.

To use ANGLE with the Vulkan backend, I tried launching the Chromium browser as follows, but it didn’t start.

What steps will reproduce the bug?

~$ chromium-browser --use-angle=vulkan --in-process-gpu
[19727:19727:1114/210957.496016:ERROR:file_path_watcher_inotify.cc(890)] Failed to read /proc/sys/fs/inotify/max_user_watches
[19726:19726:1114/210957.496016:ERROR:file_path_watcher_inotify.cc(890)] Failed to read /proc/sys/fs/inotify/max_user_watches
[19720:19734:1114/210957.508727:ERROR:file_path_watcher_inotify.cc(890)] Failed to read /proc/sys/fs/inotify/max_user_watches
[19720:19738:1114/210957.509002:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /data/data/com.termux/files/usr/var/run/dbus/system_bus_socket: No such file or directory
[19720:19745:1114/210957.607297:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /data/data/com.termux/files/usr/var/run/dbus/system_bus_socket: No such file or directory
[19720:19745:1114/210957.607447:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /data/data/com.termux/files/usr/var/run/dbus/system_bus_socket: No such file or directory
[19720:19739:1114/210957.610925:ERROR:address_tracker_linux.cc(230)] Could not bind NETLINK socket: Permission denied (13)
[19720:19750:1114/210957.625408:ERROR:angle_platform_impl.cc(44)] vk_renderer.cpp:187 (VerifyExtensionsPresent): Extension not supported: VK_KHR_surface
ERR: vk_renderer.cpp:187 (VerifyExtensionsPresent): Extension not supported: VK_KHR_surface
[19720:19750:1114/210957.625480:ERROR:angle_platform_impl.cc(44)] vk_renderer.cpp:187 (VerifyExtensionsPresent): Extension not supported: VK_KHR_xcb_surface
ERR: vk_renderer.cpp:187 (VerifyExtensionsPresent): Extension not supported: VK_KHR_xcb_surface
[19720:19750:1114/210957.625511:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-7): A requested extension is not supported, in ../../../src/third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, enableInstanceExtensions:1763.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-7): A requested extension is not supported, in ../../../src/third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, enableInstanceExtensions:1763.
[19720:19750:1114/210957.625544:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-7): A requested extension is not supported, in ../../../src/third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, enableInstanceExtensions:1763.
[19720:19750:1114/210957.625614:ERROR:gl_display.cc(796)] eglInitialize Vulkan failed with error EGL_NOT_INITIALIZED
[19720:19750:1114/210957.625700:ERROR:gl_display.cc(830)] Initialization of all EGL display types failed.
[19720:19750:1114/210957.625743:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[19720:19750:1114/210957.628049:ERROR:angle_platform_impl.cc(44)] vk_renderer.cpp:187 (VerifyExtensionsPresent): Extension not supported: VK_KHR_surface
ERR: vk_renderer.cpp:187 (VerifyExtensionsPresent): Extension not supported: VK_KHR_surface
[19720:19750:1114/210957.628108:ERROR:angle_platform_impl.cc(44)] vk_renderer.cpp:187 (VerifyExtensionsPresent): Extension not supported: VK_KHR_xcb_surface
ERR: vk_renderer.cpp:187 (VerifyExtensionsPresent): Extension not supported: VK_KHR_xcb_surface
[19720:19750:1114/210957.628127:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-7): A requested extension is not supported, in ../../../src/third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, enableInstanceExtensions:1763.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-7): A requested extension is not supported, in ../../../src/third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, enableInstanceExtensions:1763.
[19720:19750:1114/210957.628143:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-7): A requested extension is not supported, in ../../../src/third_party/angle/src/libANGLE/renderer/vulkan/vk_renderer.cpp, enableInstanceExtensions:1763.
[19720:19750:1114/210957.628180:ERROR:gl_display.cc(796)] eglInitialize Vulkan failed with error EGL_NOT_INITIALIZED
[19720:19750:1114/210957.628191:ERROR:gl_display.cc(830)] Initialization of all EGL display types failed.
[19720:19750:1114/210957.628198:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[19720:19811:1114/210957.769358:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /data/data/com.termux/files/usr/var/run/dbus/system_bus_socket: No such file or directory
[19720:19811:1114/210957.769448:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /data/data/com.termux/files/usr/var/run/dbus/system_bus_socket: No such file or directory
[19720:19811:1114/210957.769502:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /data/data/com.termux/files/usr/var/run/dbus/system_bus_socket: No such file or directory
[19720:19811:1114/210957.769534:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /data/data/com.termux/files/usr/var/run/dbus/system_bus_socket: No such file or directory
[19720:19811:1114/210957.769562:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /data/data/com.termux/files/usr/var/run/dbus/system_bus_socket: No such file or directory
[19720:19750:1114/210957.770060:FATAL:check.cc(375)] Check failed: false. NOTREACHED log messages are omitted in official builds. Sorry!
[1114/210957.772992:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[1114/210957.773363:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[1114/210957.774531:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[1114/210957.777516:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[1114/210957.779035:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[1114/210957.779128:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[1114/210957.779281:ERROR:elf_dynamic_array_reader.h(64)] tag not found
Trap

When checking with the vulkaninfo command, even though most extensions required for X11 are supported through mesa-vulkan-icd-wrapper, an error shows that VK_KHR_surface and VK_KHR_xcb_surface are not supported.

vulkaninfo

``` ~$ vulkaninfo ========== VULKANINFO ========== Vulkan Instance Version: 1.3.301 Instance Extensions: count = 24 =============================== VK_EXT_acquire_drm_display : extension revision 1 VK_EXT_debug_report : extension revision 10 VK_EXT_debug_utils : extension revision 2 VK_EXT_direct_mode_display : extension revision 1 VK_EXT_display_surface_counter : extension revision 1 VK_EXT_headless_surface : extension revision 1 VK_EXT_surface_maintenance1 : extension revision 1 VK_EXT_swapchain_colorspace : extension revision 4 VK_GOOGLE_surfaceless_query : extension revision 2 VK_KHR_device_group_creation : extension revision 1 VK_KHR_display : extension revision 23 VK_KHR_external_fence_capabilities : extension revision 1 VK_KHR_external_memory_capabilities : extension revision 1 VK_KHR_external_semaphore_capabilities : extension revision 1 VK_KHR_get_display_properties2 : extension revision 1 VK_KHR_get_physical_device_properties2 : extension revision 2 VK_KHR_get_surface_capabilities2 : extension revision 1 VK_KHR_portability_enumeration : extension revision 1 VK_KHR_surface : extension revision 25 VK_KHR_surface_protected_capabilities : extension revision 1 VK_KHR_wayland_surface : extension revision 6 VK_KHR_xcb_surface : extension revision 6 VK_KHR_xlib_surface : extension revision 6 VK_LUNARG_direct_driver_loading : extension revision 1 Layers: ======= Presentable Surfaces: ===================== GPU id : 0 (Samsung Xclipse 940): Surface types: count = 2 VK_KHR_xcb_surface VK_KHR_xlib_surface Formats: count = 2 SurfaceFormat[0]: format = FORMAT_B8G8R8A8_UNORM colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR SurfaceFormat[1]: format = FORMAT_B8G8R8A8_SRGB colorSpace = COLOR_SPACE_SRGB_NONLINEAR_KHR ```

How can I implement OpenGL ES 3.2 acceleration in the Chromium browser using "ANGLE: Vulkan Back-end"?

What is the expected behavior?

No response

System information

termux-info:

Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP__APK_PATH=/data/app/~~p1oPAinlL1zHyWTG6-mJQg==/com.termux-Ab-kRe0QmvX1uRj2OJV7Gw==/base.apk
TERMUX_APP__APK_RELEASE=GITHUB
TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files
TERMUX_APP__IS_DEBUGGABLE_BUILD=true
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__PACKAGE_MANAGER=apt
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PACKAGE_VARIANT=apt-android-7
TERMUX_APP__PID=14102
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c127,c257,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c127,c257,c512,c768
TERMUX_APP__TARGET_SDK=28
TERMUX_APP__UID=10383
TERMUX_APP__USER_ID=0
TERMUX_APP__VERSION_CODE=118
TERMUX_APP__VERSION_NAME=0.118.0+e59e5c1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0+e59e5c1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://termux.niranjan.co/termux-main stable main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://termux.niranjan.co/termux-x11 x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.44.3
Android version:
14
Kernel build information:
Linux localhost 6.1.75-android14-11 #1 SMP PREEMPT Wed Oct  2 04:19:04 UTC 2024 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-S926N
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.widget versionCode:13
com.termux.x11 versionCode:14
com.termux.api versionCode:51
licy183 commented 2 days ago

IIRC chromium ships its own vulkan loader, so I don't know how to make it work...

hansm629 commented 2 days ago

@licy183 Is it possible to implement OpenGL & OpenGL ES in X11 by combining mesa-vulkan-icd-wrapper with Google ANGLE instead of using a virgl environment?

Since mesa-vulkan-icd-wrapper allows Termux to access the Android host Vulkan driver and supports X11 WSI, this approach could offer significant performance improvements and better compatibility compared to the existing angle-android + virglrenderer-android setup.

This might also serve as an alternative solution for implementing OpenGL & OpenGL ES on Vulkan drivers that lack compatibility with Zink.

Could you review this?