Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zink, but swapchain-based #4246

Open
wants to merge 1 commit into
base: v3_openjdk
Choose a base branch
from
Open

Zink, but swapchain-based #4246

wants to merge 1 commit into from

Conversation

artdeell
Copy link
Member

@artdeell artdeell commented Jun 5, 2023

Features:

  • Zink with swapchain
  • Auto-loading of Turnip for Adreno users

Bugs:

  • Broken rendering and awful performance on Adreno due to a bug in either Zink or Turnip

Mesa: https://github.com/artdeell/zink-mesa
Turnip: https://github.com/MrPurple666/freedreno-CI/actions/runs/5165805314

@Eggir
Copy link

Eggir commented Jun 6, 2023

Android 13 (Poco X4 GT), (Dimensity 8100) Mali-G610 MC6.
Crashes when entering version 1.7.10 and 1.12.2.
just throws out of the launcher on the main screen, without errors

@Mario191209
Copy link

At this moment, the renderer is only work with 1.17+ above only. try downgrade your version to The Judge build zink.

@Heartbeat23333
Copy link

8gen2选用zink渲染器打开游戏闪退

@rhjdvsgsgks
Copy link
Contributor

is it possible to use vendor vulkan driver rather than turnip? currently turnip dont have too much compatibility (only works for a6xx). and also have bad performance compare to vendor(qcom) one.
here is a example of how to compile a mesa/zink that using vendor vulkan driver. it should works on device even turnip not supported

@artdeell
Copy link
Member Author

@rhjdvsgsgks the problem is that the vendor qcom driver doesn't support enough features for zink to work, so we use turnip by default. It's planned to add checks if your adreno is supported and not swapping the driver if necessary

@rhjdvsgsgks
Copy link
Contributor

@artdeell in my test. glxinfo shows it (zink on qcom vulkan driver) can provide upto compat profile 2.1. which is similar to gl4es. i think the logic should: if a gpu (a6xx) supported by turnip. then use it to get higher opengl version. otherwise, use vendor vulkan driver (just like current state for mali gpu). at least it may able to run some old version that not requiring high opengl version. it is better force all adreno to use turnip and cause a crash on startup.

@artdeell
Copy link
Member Author

When i tested it on my device it didn't work at all cuz my version of the driver ioesn't have VK_KHR_imageless_framebuffer and VK_KHR_timeline_semaphore

@rhjdvsgsgks
Copy link
Contributor

rhjdvsgsgks commented Jun 13, 2023

i just tried the last commit before zink been removed (fa78ff0). seems it works fine even without these extension. but got pretty bad performance (25fps compare to virgl 90fps).

i also compared performance of gl4es on this commit and head. it is a big drop. from 45fps (or 200fps with sodium) to 2. what happened to it?

@artdeell
Copy link
Member Author

This commit had old Zink from Mesa 20.3 if i recall correctly, which had leaner requirements and worse performance overall

@rhjdvsgsgks
Copy link
Contributor

rhjdvsgsgks commented Jun 13, 2023

VK_KHR_timeline_semaphore and VK_KHR_imageless_framebuffer introduced in 22.2 . maybe we can ship a mesa 22.1.7 for the device doesnt support them? or revert part of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904

@artdeell
Copy link
Member Author

VK_KHR_timeline_semaphore and VK_KHR_imageless_framebuffer introduced in 22.2 . maybe we can ship a mesa 22.1.7 for the device doesnt support them? or revert part of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904

Zink had a lot of performance improvement commits between 22 and 23, so yeah, no
Reverting is not possible anymore, changes in zink are too big

@unilock
Copy link

unilock commented Jun 14, 2023

Vanilla Minecraft 1.20.1 loads to a black screen, then crashes on my Pixel 6 Pro. Same with 1.19.2.

latestlog.txt (1.20.1)

Is there more setup required than just setting the renderer to "zink"?

@rhjdvsgsgks
Copy link
Contributor

VK_KHR_timeline_semaphore and VK_KHR_imageless_framebuffer introduced in 22.2 . maybe we can ship a mesa 22.1.7 for the device doesnt support them? or revert part of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904

Zink had a lot of performance improvement commits between 22 and 23, so yeah, no Reverting is not possible anymore, changes in zink are too big

i just found that there already have the revert patch exist. which is small and easy to apply
alexvorxx/Zink-Mesa-Xlib@8dde62c
alexvorxx/Zink-Mesa-Xlib@23c9c9b

@Pevernow
Copy link

VK_KHR_timeline_semaphore and VK_KHR_imageless_framebuffer introduced in 22.2 . maybe we can ship a mesa 22.1.7 for the device doesnt support them? or revert part of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15904

Zink had a lot of performance improvement commits between 22 and 23, so yeah, no Reverting is not possible anymore, changes in zink are too big

i just found that there already have the revert patch exist. which is small and easy to apply alexvorxx/Zink-Mesa-Xlib@8dde62c alexvorxx/Zink-Mesa-Xlib@23c9c9b

So this patch can be used to make some devices that do not support the above features use GPU-based Zink?

@mcghjbcg

This comment was marked as outdated.

@mcghjbcg
Copy link

Android 13, CPU: Dimensity9200+, GPU:Immortalis-G715,Mesa23.0.4zink,What is the solution to crashes when starting loading?

@Mario191209
Copy link

Send latestlog

@mcghjbcg
Copy link

发送最新日志
--------- beginning with launcher debug
Info: Launcher version: LOCAL-20230605
Info: Architecture: arm64
Info: Device model: vivo V2302A
Info: API version: 33
Info: Selected Minecraft version: 1.20.1
Info: Custom Java arguments: ""
logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

Added custom env: TMPDIR=/data/user/0/net.kdt.pojavlaunch.debug/cache
Added custom env: AWTSTUB_WIDTH=2726
Added custom env: FORCE_VSYNC=false
Added custom env: POJAV_NATIVEDIR=/data/app/~~GEOEkdk6iJNLhzStjbxQBg==/net.kdt.pojavlaunch.debug-xflPVyTQ79RRjyQ-hSxfAg==/lib/arm64
Added custom env: REGAL_GL_VERSION=4.5
Added custom env: REGAL_GL_VENDOR=Android
Added custom env: LIBGL_MIPMAP=3
Added custom env: allow_higher_compat_version=true
Added custom env: MESA_GLSL_CACHE_DIR=/data/user/0/net.kdt.pojavlaunch.debug/cache
Added custom env: HOME=/storage/emulated/0/Android/data/net.kdt.pojavlaunch.debug/files
Added custom env: PATH=/data/user/0/net.kdt.pojavlaunch.debug/runtimes/Internal-17/bin:/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
Added custom env: LIBGL_NOINTOVLHACK=1
Added custom env: force_glsl_extensions_warn=true
Added custom env: LIBGL_NORMALIZE=1
Added custom env: LD_LIBRARY_PATH=/data/user/0/net.kdt.pojavlaunch.debug/runtimes/Internal-17/lib/jli:/data/user/0/net.kdt.pojavlaunch.debug/runtimes/Internal-17/lib:/system/lib64:/vendor/lib64:/vendor/lib64/hw:/data/app/~~GEOEkdk6iJNLhzStjbxQBg==/net.kdt.pojavlaunch.debug-xflPVyTQ79RRjyQ-hSxfAg==/lib/arm64
Added custom env: POJAV_RENDERER=vulkan_zink
Added custom env: LIBGL_ES=2
Added custom env: VTEST_SOCKET_NAME=/data/user/0/net.kdt.pojavlaunch.debug/cache/.virgl_test
Added custom env: MESA_LOADER_DRIVER_OVERRIDE=zink
Added custom env: MESA_GLSL_VERSION_OVERRIDE=460
Added custom env: JAVA_HOME=/data/user/0/net.kdt.pojavlaunch.debug/runtimes/Internal-17
Added custom env: MESA_GL_VERSION_OVERRIDE=4.6
Added custom env: allow_glsl_extension_directive_midshader=true
Added custom env: REGAL_GL_RENDERER=Regal
Added custom env: AWTSTUB_HEIGHT=1260
logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

2023-07-29 20:54:05,283 main ERROR appender Console has no parameter that matches element Policies
logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

[20:54:05] [main/WARN]: Failed retrieving info for group processor
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at com.sun.jna.NativeLong.(NativeLong.java:35) ~[jna-5.12.1.jar:5.12.1 (b0)]
at oshi.util.FileUtil.readNativeLongFromBuffer(FileUtil.java:240) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.driver.linux.proc.Auxv.queryAuxv(Auxv.java:59) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.software.os.linux.LinuxOperatingSystem.(LinuxOperatingSystem.java:106) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.platform.linux.LinuxCentralProcessor.initProcessorCounts(LinuxCentralProcessor.java:171) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.common.AbstractCentralProcessor.(AbstractCentralProcessor.java:83) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.platform.linux.LinuxCentralProcessor.(LinuxCentralProcessor.java:71) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.createProcessor(LinuxHardwareAbstractionLayer.java:62) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.util.Memoizer$1.get(Memoizer.java:87) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:68) ~[oshi-core-6.2.2.jar:6.2.2]
at ab.c(SourceFile:75) ~[1.20.1.jar:?]
at ab.a(SourceFile:82) ~[1.20.1.jar:?]
at ab.a(SourceFile:75) ~[1.20.1.jar:?]
at ab.c(SourceFile:52) ~[1.20.1.jar:?]
at ab.a(SourceFile:82) ~[1.20.1.jar:?]
at ab.(SourceFile:52) ~[1.20.1.jar:?]
at o.(SourceFile:34) ~[1.20.1.jar:?]
at o.h(SourceFile:274) ~[1.20.1.jar:?]
at net.minecraft.client.main.Main.main(SourceFile:164) ~[1.20.1.jar:?]
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /storage/emulated/0/Android/data/net.kdt.pojavlaunch.debug/files/.cache/JNA/temp/jna14518903647044409225.tmp: dlopen failed: library "/storage/emulated/0/Android/data/net.kdt.pojavlaunch.debug/files/.cache/JNA/temp/jna14518903647044409225.tmp" needed or dlopened by "/data/data/net.kdt.pojavlaunch.debug/runtimes/Internal-17/lib/server/libjvm.so" is not accessible for the namespace "classloader-namespace" [in thread "main"]
at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]
at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source) ~[?:?]
at jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) ~[?:?]
at jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) ~[?:?]
at java.lang.ClassLoader.loadLibrary(Unknown Source) ~[?:?]
at java.lang.Runtime.load0(Unknown Source) ~[?:?]
at java.lang.System.load(Unknown Source) ~[?:?]
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1045) ~[jna-5.12.1.jar:5.12.1 (b0)]
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1015) ~[jna-5.12.1.jar:5.12.1 (b0)]
at com.sun.jna.Native.(Native.java:221) ~[jna-5.12.1.jar:5.12.1 (b0)]
at com.sun.jna.platform.linux.Udev.(Udev.java:37) ~[jna-platform-5.12.1.jar:5.12.1 (b0)]
at oshi.software.os.linux.LinuxOperatingSystem.(LinuxOperatingSystem.java:93) ~[oshi-core-6.2.2.jar:6.2.2]
... 15 more
[20:54:05] [main/WARN]: Failed retrieving info for group memory
java.lang.NoClassDefFoundError: Could not initialize class oshi.software.os.linux.LinuxOperatingSystem
at oshi.hardware.platform.linux.LinuxGlobalMemory.(LinuxGlobalMemory.java:47) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.createMemory(LinuxHardwareAbstractionLayer.java:57) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.util.Memoizer$1.get(Memoizer.java:87) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.common.AbstractHardwareAbstractionLayer.getMemory(AbstractHardwareAbstractionLayer.java:80) ~[oshi-core-6.2.2.jar:6.2.2]
at ab.a(SourceFile:77) ~[1.20.1.jar:?]
at ab.a(SourceFile:82) ~[1.20.1.jar:?]
at ab.a(SourceFile:77) ~[1.20.1.jar:?]
at ab.c(SourceFile:52) ~[1.20.1.jar:?]
at ab.a(SourceFile:82) ~[1.20.1.jar:?]
at ab.(SourceFile:52) ~[1.20.1.jar:?]
at o.(SourceFile:34) ~[1.20.1.jar:?]
at o.h(SourceFile:274) ~[1.20.1.jar:?]
at net.minecraft.client.main.Main.main(SourceFile:164) ~[1.20.1.jar:?]
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native [in thread "main"]
at com.sun.jna.NativeLong.(NativeLong.java:35) ~[jna-5.12.1.jar:5.12.1 (b0)]
at oshi.util.FileUtil.readNativeLongFromBuffer(FileUtil.java:240) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.driver.linux.proc.Auxv.queryAuxv(Auxv.java:59) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.software.os.linux.LinuxOperatingSystem.(LinuxOperatingSystem.java:106) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.platform.linux.LinuxCentralProcessor.initProcessorCounts(LinuxCentralProcessor.java:171) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.common.AbstractCentralProcessor.(AbstractCentralProcessor.java:83) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.platform.linux.LinuxCentralProcessor.(LinuxCentralProcessor.java:71) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.createProcessor(LinuxHardwareAbstractionLayer.java:62) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.util.Memoizer$1.get(Memoizer.java:87) ~[oshi-core-6.2.2.jar:6.2.2]
at oshi.hardware.common.AbstractHardwareAbstractionLayer.getProcessor(AbstractHardwareAbstractionLayer.java:68) ~[oshi-core-6.2.2.jar:6.2.2]
at ab.c(SourceFile:75) ~[1.20.1.jar:?]
at ab.a(SourceFile:82) ~[1.20.1.jar:?]
at ab.a(SourceFile:75) ~[1.20.1.jar:?]
... 6 more
logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.

ERROR: Unable to get more log.
[20:54:08] [Datafixer Bootstrap/INFO]: 188 Datafixer optimizations took 167 milliseconds
[20:54:10] [Render thread/INFO]: [STDERR]: [LWJGL] Failed to load a library. Possible solutions:
a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
b) Add the JAR that contains the shared library to the classpath.
[20:54:10] [Render thread/INFO]: [STDERR]: [LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[20:54:10] [Render thread/INFO]: [STDERR]: [LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
[20:54:10] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[20:54:11] [Render thread/ERROR]: Failed to verify authentication
com.mojang.authlib.exceptions.InvalidCredentialsException: Status: 401
at com.mojang.authlib.exceptions.MinecraftClientHttpException.toAuthenticationException(MinecraftClientHttpException.java:56) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:156) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.(YggdrasilUserApiService.java:55) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.createUserApiService(YggdrasilAuthenticationService.java:124) ~[authlib-4.0.43.jar:?]
at enn.a(SourceFile:733) ~[1.20.1.jar:?]
at enn.(SourceFile:442) ~[1.20.1.jar:?]
at net.minecraft.client.main.Main.main(SourceFile:211) ~[1.20.1.jar:?]
Caused by: com.mojang.authlib.exceptions.MinecraftClientHttpException: Status: 401
at com.mojang.authlib.minecraft.client.MinecraftClient.readInputStream(MinecraftClient.java:85) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.minecraft.client.MinecraftClient.get(MinecraftClient.java:48) ~[authlib-4.0.43.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilUserApiService.fetchProperties(YggdrasilUserApiService.java:129) ~[authlib-4.0.43.jar:?]
... 5 more
[20:54:11] [Render thread/INFO]: Setting user: tgub
Registered forkAndExec
[20:54:11] [Render thread/ERROR]: Error parsing option value off for option Fullscreen: Not a boolean: "off"
[20:54:11] [Render thread/ERROR]: Error parsing option value for option Text Background Opacity: Not a boolean: ""
[20:54:11] [Render thread/INFO]: Backend library: LWJGL version 3.2.3 SNAPSHOT
OSMDroid: generating context
WARNING: Some incorrect rendering might occur because the selected Vulkan device (Mali-G715-Immortalis MC11) doesn't support base Zink requirements: feats.features.logicOp feats.features.fillModeNonSolid feats.features.shaderClipDistance

@Mario191209
Copy link

The zink branch doesn't support 1.20+ I guess

@mcghjbcg
Copy link

The zink branch doesn't support 1.20+ I guess
Version 1.12 and above crashes during startup loading

@Mario191209
Copy link

Known Issue afaik

@FrostNovaHD
Copy link
Contributor

The zink branch doesn't support 1.20+ I guess
Version 1.12 and above crashes during startup loading

so 1.11 and down work?

@mcghjbcg
Copy link

It doesn't work, it just crashes

@Mario191209
Copy link

Mario191209 commented Jul 29, 2023

It crashed for me as well.

@Mario191209
Copy link

My Gpu is Mali G77-MC9

@FrostNovaHD
Copy link
Contributor

so what version do work

It crashed for me as well.

@Pevernow
Copy link

Pevernow commented Jul 29, 2023

@mcghjbcg lol
The real reason is your device(Same to me) does not support a basic vulkan extension for the new mesa version.
I had report it to the cellphone provider company.You have no choice but use old mesa version(cpu only) instead of it.

@mcghjbcg
Copy link

@mcghjbcg lol The real reason is your device(Same to me) does not support a basic vulkan extension for the new mesa version. I had report it to the cellphone provider company.You have no choice but use old mesa version(cpu only) instead of it.

Mali-G715 supports Vulkan1.3, which is a VK extension that supports Mesa23.0.4

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

Successfully merging this pull request may close these issues.

None yet