-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
mesa: Enable Zink support #10103
Comments
This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
That looks awesome. I'm not sure I understand why it doesn't get more attention, maybe I'm missing something? I think the second part of your patch is now obsolete thanks to https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18848 If I'm not mistaken, the first one is needed only for building on device itself right? I couldn't manage to get build to even start at all so... Concerning the meson build parameters, would you know what changes you did? ATM I'm just trying with |
FWIW I managed to get Zink over Android Vulkan to work on termux but that has been very painful. I'll try to push all I did, and test it on more devices, but in the meantime, a gist of what worked for me:
(and then I used virgl to have GL in proot but that's another story) |
I might have successfully used Zink on Termux on locked bootloader OFW Samsung Galaxy S9 SM-G960U by:
I say "might have successfully used Zink" because unfortunately I am not getting great performance. My FPS in phhusson posted while I wrote this. Soon I might try what he suggested, in the hope of finding a way to improve performance, but it is possible that maybe my OFW Android installation's Vulkan driver is just not good enough for this. Credit to Thundersnow#7929, RICK#7270 for helping me and writing some parts of the method I described. |
FWIW, In my case, it looks like framerate is limited by the many memcpys, because I can set UT2004 graphic settings to the maximum and still get the same FPS. That's a given since I'm using glx=xlib. |
Okay, I have Zink from mesa
where Unfortunately, at least in my case, none of this seems to have changed anything for me, since I get exactly the same performance in |
for zink proot, you additionally need (outside the proot) custom |
Actually for proot, if you don't mind destroying performances, you can proot --disable-shm (or whatever it's called), and it'll work without any patch. It'll just do even more memcpys. I have UT2004 demo in wine in box86 (or more simply glxgears or supertux2) in debian proot on unmodified epoxy/virgl/epoxy with that Thanks @robertkirkman for the detailed up-to-date documentation, I'll give it a try. FWIW I tried reverting the renderpass2 commit (because my Snapdragon 835 doesn't have it) and failed, but I didn't spend much time on it yet.
Nope, issue was something along the lines of "can't open dri screen" |
try compiling Xwayland with
these were enabled in my build of Xorg |
is this really zink or its just cpu rendering |
Here's another patch I made that includes all the changes of the previous patch I posted, plus my attempt to remove the |
That is the same method we are discussing here, so it should be the same, plus it does have the virgl steps you wanted; how much of the rendering ends up being done by CPU and how much by GPU, seems like it could vary depending on device, since in my case at the moment there's not an observable difference in performance between |
Finally, I have been able to test on some other devices, which do not support
I can move on to testing what I really want. I will also try to see if I can fix or at least work around the |
WRT performances, I believe that the main issue is that framebuffer is memcpy-ed, so if you were to trying a much more complicated 3D scene, you'd still get the same FPS over zink, but much lower on llvmpipe |
Testing on FxTec Pro1 (Snapdragon 835, Android 9 vendor/drivers, Android 13 ROM), following your instructions @robertkirkman, using IYvs1, I get null pointer segfault:
From a quick look it looks related to SHM. I'll spend more time looking at it, but I'm just posting here in case you have an idea/know what's happening |
Thanks for the report, unfortunately for our situation, some parts of
|
Thanks for the =debug, =release was right in the command line but i couldn't understand why i didn't get debugging symbols So far, nopper looks like a big nope:
but then it returns null, but zink explicitly wants non-null So far I have a hard time seeing how it works for you. I'm guessing it goes to a whole different code path, but I don't really see how |
@robertkirkman WRT the benchmarks result, have you tried running glmark2 with |
On ROG Phone 3 (Snapdragon 865), which has the zink glx=xlib + virgl + proot setup I mentioned earlier, I get those results on glmark2, 800x600 32bits: So yeah in my case, zink definitely works, the bottleneck is the rendering to display which does a lot of buffer copies |
Unfortunately, I don't fully understand that code ( As for So it does look like the scores increase across the board and shows |
But when I try to apply the patch it says error: scripts/build/setup/termux_setup_meson.sh: No such file or directory |
I've compared mesa source used in exagear mod and wrote this patch:
Unfortunately gl programs with
|
@licy183 maybe you can help? |
Ok, this seems to fix assert in driQueryOptionb, but there is some other fault.
Now zink falls with SIGBUS/BUS_ADRALN. |
Sorry for my late reply. I have many exams these days. You can compile mesa with |
He can't work normally. Do you have any ideas? |
I have a new patch. |
No changes patch -p1 < mesa.patch
meson . build -Dgallium-va=disabled -Dgallium-drivers=virgl,zink,swrast -Ddri3=disabled -Dvulkan-drivers= -Dglx=xlib -Dplatforms=x11 -Dbuildtype=release -Dxmlconfig=disabled && sudo ninja -C build && ninja install -C build
|
Why are you using Zink-Mesa-Xlib repo? It already has these patches... |
Sorry, I don't know |
Quite off topic but can someone setup github action that build deb file of turnip driver ? I have successfully built turnip driver for proot ubuntu, but i dont know how to make deb file from it This is how i compile the driver :
|
After I compile it DISPLAY=:1 TU_DEBUG=noconform MESA_VK_WSI_DEBUG=sw VK_ICD_FILENAMES=~/freedreno_icd.aarch64.json glxgears
MESA: error: ZINK: vkEnumeratePhysicalDevices failed (VK_ERROR_INITIALIZATION_FAILED)
MESA: error: ZINK: failed to choose pdev
MESA: error: ZINK: vkEnumeratePhysicalDevices failed (VK_ERROR_INITIALIZATION_FAILED)
MESA: error: ZINK: failed to choose pdev
MESA: error: ZINK: vkEnumeratePhysicalDevices failed (VK_ERROR_INITIALIZATION_FAILED)
MESA: error: ZINK: failed to choose pdev
Error: couldn't get an RGB, Double-buffered visual |
@lateautumn233 i think you are missing |
Nothing happened |
@lateautumn233 Maybe driver for a7xx isnt ready ? It works fine with adreno 610 |
@lateautumn233 run some pure vulkan test first, without zink. More layers you add, more potentials points of failure you have and that's bad when you try to troubleshoot anything. |
I'm trying DISPLAY=:1 TU_DEBUG=noconform MESA_VK_WSI_DEBUG=sw VK_ICD_FILENAMES=~/freedreno_icd.aarch64.json vkcube output vkcube: ./cube/cube.c:3444: demo_init_vk: Assertion `!err' failed.
Aborted |
Maybe |
@lateautumn233 I compiled turnip/feature/a7xx-basic-support and vkcube works just fine with it on SD 8gen1 |
But I'm using chroot |
This is the patch I'm using, basically https://github.com/termux-user-repository/tur/tur/mesa-zink with some modification. |
i'm also using chroot, vkcube works on turnip adreno 730 |
Revert "zink: require extensions, delete the code" (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904/diffs) - removes the requirements for VK_KHR_xcb_surface, VK_KHR_wayland_surface, VK_KHR_imageless_framebuffer and VK_KHR_timeline_semaphore. This is necessary for Zink to work with the Vulkan driver built into Android (termux/termux-packages#10103 (comment)).
Version 22.0 of mesa was released quite recently, and it includes some fixes which makes it possible to use the Zink(opengl over vulkan) driver in termux to achieve hardware accelerated openGL without root
i had tried to build it in GitHub actions and always ended up with errors saying
llvm-config
was not found and i faced some Linking issues if i tried to build only the Zink driver, i hope someone can figure out how to fix the build issues and package thissorry for my bad English...
![Screenshot_2022-03-16-14-59-33-370_com termux](https://user-images.githubusercontent.com/74525818/158604873-6e0172ef-3bab-48d7-9412-1ed5b090b85c.jpg)
as for devices which lacks vulkan support, the swrast llvmpipe driver works without any modifications
the patch which I applied is this:
and mesa can be built on device with these configuration options
The text was updated successfully, but these errors were encountered: