termux-user-repository / tur

A place for all types of Termux packages.
Other
404 stars 78 forks source link

[Bug]: mesa-zink doesn't work on Adreno 7xx #469

Open hansm629 opened 1 year ago

hansm629 commented 1 year ago

Name

mesa

Home page URL

https://www.mesa3d.org/

Source code URL

https://github.com/alexvorxx/mesa-zink-11.06.22

Packaging policy acknowledgement

Additional information

I would like to request a new package update. :)

mesa-zink mesa-zink-dev mesa-zink-vulkan-icd-freedreno mesa-zink-vulkan-icd-swrast

Packages to support the Qualcomm Adreno 7xx GPU I hope it will be updated to 23.1.3 version.

On devices with Adreno 7xx GPUs I want to implement GPU acceleration with zink after installing proot Linux.

licy183 commented 1 year ago

mesa-zink wants to provide zink support with native Android vulkan driver, so this package will not update.

hansm629 commented 1 year ago

Adreno 7xx GPU

mesa-zink wants to provide zink support with native Android vulkan driver, so this package will not update.

So can the current mesa-zink support the Adreno 7xx GPU? The usage scenario I'm thinking of is to implement GPU acceleration after installing Debian Linux through proot-distro.

licy183 commented 1 year ago

This package is for native Termux, not for Debian in proot-distro. If you want to use zink-enabled mesa in Debian, you should compile it from source.

hansm629 commented 1 year ago

This package is for native Termux, not for Debian in proot-distro. If you want to use zink-enabled mesa in Debian, you should compile it from source.

It's a slightly different question.

mesa-zink + virglrenderer-mesa-zink on a device with an Adreno 7xx GPU I'm trying to implement proot-distro gpu acceleration

In this case, I wonder if I don't need the latest version of mesa-zink.

$ pkg install tur-repo $ pkg update $ pkg install mesa-zink virglrenderer-mesa-zink

After the installation process

$ MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.0 GALLIUM_DRIVER=zink virgl_test_server --use-egl-surfaceless

$ export DISPLAY=:0 $ termux-x11 :0 & $ proot-distro login debian --user user --shared-tmp $ export DISPLAY=:0 $ dbus-launch --exit-with-session startxfce4 &

After you run xfce4 of Termux-X11 Linux

$ GALLIUM_DRIVER=virpipe MESA_GL_VERSION_OVERRIDE=4.0 glxgears

or

$ GALLIUM_DRIVER=virpipe MESA_GL_VERSION_OVERRIDE=4.0 glmark2

After entering commands in the terminal, we tested GPU acceleration

"lost connection to reandering server on 8 read -1 104 Aborted"

An error appears and does not work. Is there any room for mesa-zink to work if it is updated?

$ pkg install virglrenderer-android $ virgl_test_server_android &

Virgl acceleration through the installation of the 'virglrender-android' worked fine.

But the performance was slower than I thought. I heard that zink + virglrender is a faster performance I've been trying, but it's not easy.

Is there any possibility that it will work if it is updated to version 23.1.3 or higher of mesa-zink? Or are there any mistakes I make?

The test environment is Galaxy S23 Ultra (SD8G2 : Adrnoe 740) Galaxy Tab S8+ 5G (SD8G1 : Adrnoe 730)

licy183 commented 1 year ago

I'm sure that upgrading mesa will break the functionality of zink. And I think your steps are right.

I wonder what kind of vulkan-loader you've installed. Possibly you've installed vulkan-loader-generic rather than vulkan-loader-android. If you want to use Android's vulkan to work with zink (just like what you're doing), you need to install vulkan-loader-android.

licy183 commented 1 year ago

It seems that you're not starting the virglrenderer with gles, try MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.0 GALLIUM_DRIVER=zink virgl_test_server --use-egl-surfaceless --use-gles.

hansm629 commented 1 year ago

It seems that you're not starting the virglrenderer with gles, try MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.0 GALLIUM_DRIVER=zink virgl_test_server --use-egl-surfaceless --use-gles.

Thank you for your kind answer. Unfortunately, the same symptoms are occurring. :(

. . . . . Reading state information... Done mesa-zink is already the newest version (22.0.5-5). virglrenderer-mesa-zink is already the newest version (20220627). vulkan-loader-android is already the newest version (25c). 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. ~ $ MESA_NO_ERROR=1 MESA_GL_VERSION_OVERRIDE=4.0 GALLIUM_DRIVER=zink virgl_test_server --use-egl-surfaceless --use-gles & [1] 24647 ~ $ export DISPLAY=:0 ~ $ termux-x11 :0 & [2] 24706 ~ $ proot-distro login debian --user hsm --shared-tmp N: [pulseaudio] main.c: User-configured server at 127.0.0.1, refusing to start/autospawn. hsm@localhost:~$ ./startx.sh hsm@localhost:~$ /usr/bin/startxfce4: X server already running on display :0 ../src/src/gallium/drivers/zink/zink_resource.c:804: struct zink_resource_object resource_object_create(struct zink_screen , const struct pipe_resource , struct winsys_handle , _Bool , const uint64_t , int): assertion "reqs.memoryTypeBits & BITFIELD_BIT(mai.memoryTypeIndex)" failed lost connection to rendering server on 8 read -1 104 . . . . . .

XFCE4 and glxgeare and glmark2 are not running with this error T_T

Virglrender-android works fine I don't know what's wrong with zink + virglrender... orz

licy183 commented 1 year ago

I can't reproduce it on Adreno 660...

hansm629 commented 1 year ago

Adreno 660에서 재생이 안되네요...

If it work on the A6xx series, should the mesa-zink currently packaged be considered no compatible with the Adreno7xx GPU? T_T

If I'm aware of it As far as I know, A7xx support has been added since the 23.1.0 version of mesa. First of all, there's an Adreno 650 in the house We have the Galaxy S20, so we will test it additionally and reply. :)

2096779623 commented 1 year ago

I can't reproduce it on my Adreno 725 device.(use --use-gles)

termux-report_issue_from_transcript.log

Screenshot_2023-06-28-17-32-13-525_com realvnc viewer android

licy183 commented 1 year ago

As far as I know, A7xx support has been added since the 23.1.0 version of mesa. First of all, there's an Adreno 650 in the house We have the Galaxy S20, so we will test it additionally and reply. :)

If you're using zink, it should not matter what the GPU device is because it contacts with GPU through the system-provided vulkan driver...

hansm629 commented 1 year ago

I can't reproduce it on my Adreno 725 device.

I am using termux-x11. Did you use vnc? I wonder if it works on termux-x11. and proot-distro debian.

hansm629 commented 1 year ago

As far as I know, A7xx support has been added since the 23.1.0 version of mesa. First of all, there's an Adreno 650 in the house We have the Galaxy S20, so we will test it additionally and reply. :)

If you're using zink, it should not matter what the GPU device is because it contacts with GPU through the system-provided vulkan driver...

I will test it again on the Galaxy s20 that I have extra and give you feedback.

hansm629 commented 1 year ago

As far as I know, A7xx support has been added since the 23.1.0 version of mesa. First of all, there's an Adreno 650 in the house We have the Galaxy S20, so we will test it additionally and reply. :)

If you're using zink, it should not matter what the GPU device is because it contacts with GPU through the system-provided vulkan driver...

Screenshot_20230629_000146_TermuxX11

In the Galaxy S20 (SM-G981N), which is SD865 (Adreno 650) specification

Result of running 'zink + virglrender' with the same staff It has been confirmed that it is working normally here.

For the currently packaged mesa-zink In the termux-x11 + proot-distro linux environment I don't think I can support the Adreno 7xx series. T_T

If the bug in the mesa-zink is correct, it seems that it needs to be fixed..

licy183 commented 1 year ago

mesa-zink will use vulkan-loader-android and it will stick its version to 22.0.5, so it will not receive any upgrades from upstream. You can use kgsl driver over zink in newer mesa. I've submitted a PR in Termux main repo.

hansm629 commented 1 year ago

mesa-zink will use vulkan-loader-android and it will stick its version to 22.0.5, so it will not receive any upgrades from upstream. You can use kgsl driver over zink in newer mesa. I've submitted a PR in Termux main repo.

https://github.com/termux/termux-packages/pull/17112

I checked the PR contents!

If this is the case, can I just install "mesa" and "mesa-vulkan-icd-freedreno" to accelerate GPU with a combination of zink+freedreno?

Would the "mesa-vulkan-icd-freedreno" also have to be 23.1.3 version to support the A7xx GPU?

rhjdvsgsgks commented 1 year ago

you can run vulkaninfo to make sure you have a propper vulkan environment in your termux before using zink

rhjdvsgsgks commented 1 year ago

mesa-zink will use vulkan-loader-android and it will stick its version to 22.0.5

im just curious why this specific version? is there anything introduced in new version break the compatibility with vendor vulkan driver?

licy183 commented 1 year ago

im just curious why this specific version? is there anything introduced in new version break the compatibility with vendor vulkan driver?

From 22.1.0, zink uses kopper and it requires X11-WSI, which doesn't provide by any Android vulkan driver.

rhjdvsgsgks commented 1 year ago

im just curious why this specific version? is there anything introduced in new version break the compatibility with vendor vulkan driver?

From 22.1.0, zink uses kopper and it requires X11-WSI, which doesn't provide by any Android vulkan driver.

maybe we can also revert them, just like what alexvorxx did https://github.com/alexvorxx/Zink-Mesa-Xlib/commit/8dde62c532a55b38d715517d69e1fd1fb77ccc45 https://github.com/alexvorxx/Zink-Mesa-Xlib/commit/23c9c9b18977f4b15e4c89c71c5a24bbde5d8c9c

licy183 commented 1 year ago

I don't think it is a good solution to revert these changes. It makes this package hard to maintain anyway. A better solution should be how to simulate a vulkan ICD which actually uses Android's vulkan.

rhjdvsgsgks commented 1 year ago

I don't think it is a good solution to revert these changes. It makes this package hard to maintain anyway. A better solution should be how to simulate a vulkan ICD which actually uses Android's vulkan.

yes. it not a ideal solution. but it may not too hard to maintain as you think. i just tried this 2 patches, and they applied semi cleanly to latest mesa git. it could be a temporary solution before better one comes