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

SkiaVK support #5

Open
asuka-mio opened this issue Sep 28, 2023 · 30 comments
Open

SkiaVK support #5

asuka-mio opened this issue Sep 28, 2023 · 30 comments

Comments

@asuka-mio
Copy link

Hi, I have just implement AHB support https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25454 , but it needs IMapper4 API, to build with IMapper4 support https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25410#note_2104573 is needed
And GloDroid/aospext#11 may help
Would you like add ci support?
Thanks

@ilhan-athn7
Copy link
Owner

Hi, i have succesfully built it following instructions of Roman Stratiienko and using your own mesa fork as you gave me these.

I obtained the file `./aospless/install/vendor/lib64/libvulkan_freedreno.so" and pushed to my phone.

i got those lines on logcat.

09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Build Date                       : 09/24/20                                                                          09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.32.02.01                                                                    09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Local Branch                     : mybrancheafe5b6d-fb5b-f1b0-b904-5cb90179c3e0                                      09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Remote Branch                    : quic/gfx-adreno.lnx.1.0.r114-rel                                                  09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Remote Branch                    : NONE                                                                              09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Reconstruct Branch               : NOTHING                                                                           09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Build Config                     : S P 10.0.7 AArch64                                                                09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so                                             09-29 01:52:22.252  6155  6176 I AdrenoGLES-0: PFP: 0x016ee190, ME: 0x00000000    09-29 01:52:22.265  6155  6176 E OpenGLRenderer: Unable to match the desired swap behavior.
09-29 01:52:22.267  6155  6182 I Gralloc4: mapper 4.x is not supported
09-29 01:52:22.267  6155  6182 W Gralloc3: mapper 3.x is not supported
09-29 01:52:22.269  6155  6182 W Gralloc4: allocator 4.x is not supported
09-29 01:52:22.269  6155  6182 W Gralloc3: allocator 3.x is not supported
09-29 01:52:22.270  6155  6182 I Gralloc2: Adding additional valid usage bits: 0x8202000
09-29 01:52:22.318  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.318  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.319  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.319  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.319  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.320  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.320  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.322  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.517  6155  6179 I vulkanCapsViewer: Loading libvulkan.so...
09-29 01:52:22.526  6155  6179 W MESA    : Gralloc doesn't support lock_ycbcr (video buffers won't be supported)
09-29 01:52:22.526  6155  6179 I MESA    : Using fallback gralloc implementation
09-29 01:52:22.527  6155  6179 D vulkan  : searching for layers in '/data/app/~~UIjl4kunxeB1rPrGqW7_tg==/de.saschawillems.vulkancapsviewer-3U1Y5zkVJnyf7R9YdV2Qdg==/lib/arm64'
09-29 01:52:22.527  6155  6179 D vulkan  : searching for layers in '/data/app/~~UIjl4kunxeB1rPrGqW7_tg==/de.saschawillems.vulkancapsviewer-3U1Y5zkVJnyf7R9YdV2Qdg==/base.apk!/lib/arm64-v8a'
09-29 01:52:22.527  6155  6179 I vulkanCapsViewer: Loading instance based function pointers...
09-29 01:52:22.528  6155  6179 D libvulkanCapsViewer_arm64-v8a.so: true
09-29 01:52:22.528  6155  6179 D libvulkanCapsViewer_arm64-v8a.so: true
09-29 01:52:22.534  6155  6155 W qtMainLoopThrea: type=1400 audit(0.0:190): avc: denied { read } for name="dri" dev="tmpfs" ino=16294 scontext=u:r:untrusted_app:s0:c67,c257,c512,c768 tcontext=u:object_r:device:s0 tclass=dir permissive=0 app=de.saschawillems.vulkancapsviewer
09-29 01:52:22.541  6155  6155 D CompatibilityChangeReporter: Compat change id reported: 171228096; UID 10323; state: ENABLED
09-29 01:52:22.551  6155  6176 W Parcel  : Expecting binder but got null!
09-29 01:52:22.565  6155  6176 E OpenGLRenderer: Unable to match the desired swap behavior.
09-29 01:52:23.552  6155  6179 I libvulkanCapsViewer_arm64-v8a.so: Application start
09-29 01:52:23.561  6155  6179 D libvulkanCapsViewer_arm64-v8a.so: Unknown property align
09-29 01:52:23.562  6155  6179 D libvulkanCapsViewer_arm64-v8a.so: Unknown property align
09-29 01:52:23.582  6155  6155 W Resources: Drawable android:drawable/screen_background_selector_light has unresolved theme attributes! Consider using Resources.getDrawable(int, Theme) or Context.getDrawable(int).
09-29 01:52:23.582  6155  6155 W Resources: java.lang.RuntimeException
09-29 01:52:23.582  6155  6155 W Resources:     at android.content.res.Resources.getDrawable(Resources.java:914)
09-29 01:52:23.582  6155  6155 W Resources:     at org.qtproject.qt5.android.QtActivityDelegate.createSurface(QtActivityDelegate.java:1175)
09-29 01:52:23.582  6155  6155 W Resources:     at org.qtproject.qt5.android.QtNative$20.run(QtNative.java:1196)
09-29 01:52:23.582  6155  6155 W Resources:     at android.os.Handler.handleCallback(Handler.java:942)
09-29 01:52:23.582  6155  6155 W Resources:     at android.os.Handler.dispatchMessage(Handler.java:99)
09-29 01:52:23.582  6155  6155 W Resources:     at android.os.Looper.loopOnce(Looper.java:201)
09-29 01:52:23.582  6155  6155 W Resources:     at android.os.Looper.loop(Looper.java:288)
09-29 01:52:23.582  6155  6155 W Resources:     at android.app.ActivityThread.main(ActivityThread.java:7936)
09-29 01:52:23.582  6155  6155 W Resources:     at java.lang.reflect.Method.invoke(Native Method)
09-29 01:52:23.582  6155  6155 W Resources:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
09-29 01:52:23.582  6155  6155 W Resources:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:854)
09-29 01:52:23.596  6155  6155 E BLASTBufferQueue: Cannot find perfservice
09-29 01:52:25.648  6155  6155 E BufferQueueProducer: [SurfaceView[de.saschawillems.vulkancapsviewer/org.qtproject.qt5.android.bindings.QtActivity]#2(BLAST Consumer)2](id:180b00000003,api:0,p:-1,c:6155) disconnect: not connected (req=2)

Did i miss something?

@asuka-mio
Copy link
Author

Hi, i have succesfully built it following instructions of Roman Stratiienko and using your own mesa fork as you gave me these.

I obtained the file `./aospless/install/vendor/lib64/libvulkan_freedreno.so" and pushed to my phone.

i got those lines on logcat.

09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Build Date                       : 09/24/20                                                                          09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.32.02.01                                                                    09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Local Branch                     : mybrancheafe5b6d-fb5b-f1b0-b904-5cb90179c3e0                                      09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Remote Branch                    : quic/gfx-adreno.lnx.1.0.r114-rel                                                  09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Remote Branch                    : NONE                                                                              09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Reconstruct Branch               : NOTHING                                                                           09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Build Config                     : S P 10.0.7 AArch64                                                                09-29 01:52:22.248  6155  6176 I AdrenoGLES-0: Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so                                             09-29 01:52:22.252  6155  6176 I AdrenoGLES-0: PFP: 0x016ee190, ME: 0x00000000    09-29 01:52:22.265  6155  6176 E OpenGLRenderer: Unable to match the desired swap behavior.
09-29 01:52:22.267  6155  6182 I Gralloc4: mapper 4.x is not supported
09-29 01:52:22.267  6155  6182 W Gralloc3: mapper 3.x is not supported
09-29 01:52:22.269  6155  6182 W Gralloc4: allocator 4.x is not supported
09-29 01:52:22.269  6155  6182 W Gralloc3: allocator 3.x is not supported
09-29 01:52:22.270  6155  6182 I Gralloc2: Adding additional valid usage bits: 0x8202000
09-29 01:52:22.318  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.318  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.319  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.319  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.319  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.320  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.320  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.322  6155  6179 W libvulkanCapsViewer_arm64-v8a.so: libpng warning: iCCP: known incorrect sRGB profile
09-29 01:52:22.517  6155  6179 I vulkanCapsViewer: Loading libvulkan.so...
09-29 01:52:22.526  6155  6179 W MESA    : Gralloc doesn't support lock_ycbcr (video buffers won't be supported)
09-29 01:52:22.526  6155  6179 I MESA    : Using fallback gralloc implementation
09-29 01:52:22.527  6155  6179 D vulkan  : searching for layers in '/data/app/~~UIjl4kunxeB1rPrGqW7_tg==/de.saschawillems.vulkancapsviewer-3U1Y5zkVJnyf7R9YdV2Qdg==/lib/arm64'
09-29 01:52:22.527  6155  6179 D vulkan  : searching for layers in '/data/app/~~UIjl4kunxeB1rPrGqW7_tg==/de.saschawillems.vulkancapsviewer-3U1Y5zkVJnyf7R9YdV2Qdg==/base.apk!/lib/arm64-v8a'
09-29 01:52:22.527  6155  6179 I vulkanCapsViewer: Loading instance based function pointers...
09-29 01:52:22.528  6155  6179 D libvulkanCapsViewer_arm64-v8a.so: true
09-29 01:52:22.528  6155  6179 D libvulkanCapsViewer_arm64-v8a.so: true
09-29 01:52:22.534  6155  6155 W qtMainLoopThrea: type=1400 audit(0.0:190): avc: denied { read } for name="dri" dev="tmpfs" ino=16294 scontext=u:r:untrusted_app:s0:c67,c257,c512,c768 tcontext=u:object_r:device:s0 tclass=dir permissive=0 app=de.saschawillems.vulkancapsviewer
09-29 01:52:22.541  6155  6155 D CompatibilityChangeReporter: Compat change id reported: 171228096; UID 10323; state: ENABLED
09-29 01:52:22.551  6155  6176 W Parcel  : Expecting binder but got null!
09-29 01:52:22.565  6155  6176 E OpenGLRenderer: Unable to match the desired swap behavior.
09-29 01:52:23.552  6155  6179 I libvulkanCapsViewer_arm64-v8a.so: Application start
09-29 01:52:23.561  6155  6179 D libvulkanCapsViewer_arm64-v8a.so: Unknown property align
09-29 01:52:23.562  6155  6179 D libvulkanCapsViewer_arm64-v8a.so: Unknown property align
09-29 01:52:23.582  6155  6155 W Resources: Drawable android:drawable/screen_background_selector_light has unresolved theme attributes! Consider using Resources.getDrawable(int, Theme) or Context.getDrawable(int).
09-29 01:52:23.582  6155  6155 W Resources: java.lang.RuntimeException
09-29 01:52:23.582  6155  6155 W Resources:     at android.content.res.Resources.getDrawable(Resources.java:914)
09-29 01:52:23.582  6155  6155 W Resources:     at org.qtproject.qt5.android.QtActivityDelegate.createSurface(QtActivityDelegate.java:1175)
09-29 01:52:23.582  6155  6155 W Resources:     at org.qtproject.qt5.android.QtNative$20.run(QtNative.java:1196)
09-29 01:52:23.582  6155  6155 W Resources:     at android.os.Handler.handleCallback(Handler.java:942)
09-29 01:52:23.582  6155  6155 W Resources:     at android.os.Handler.dispatchMessage(Handler.java:99)
09-29 01:52:23.582  6155  6155 W Resources:     at android.os.Looper.loopOnce(Looper.java:201)
09-29 01:52:23.582  6155  6155 W Resources:     at android.os.Looper.loop(Looper.java:288)
09-29 01:52:23.582  6155  6155 W Resources:     at android.app.ActivityThread.main(ActivityThread.java:7936)
09-29 01:52:23.582  6155  6155 W Resources:     at java.lang.reflect.Method.invoke(Native Method)
09-29 01:52:23.582  6155  6155 W Resources:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
09-29 01:52:23.582  6155  6155 W Resources:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:854)
09-29 01:52:23.596  6155  6155 E BLASTBufferQueue: Cannot find perfservice
09-29 01:52:25.648  6155  6155 E BufferQueueProducer: [SurfaceView[de.saschawillems.vulkancapsviewer/org.qtproject.qt5.android.bindings.QtActivity]#2(BLAST Consumer)2](id:180b00000003,api:0,p:-1,c:6155) disconnect: not connected (req=2)

Did i miss something?

It does not use IMapper4 API but use fallback u_gralloc instead
Which soc you using? Does it support IMapper4 HAL?

@asuka-mio
Copy link
Author

Please check if you have such file /vendor/lib64/hw/[email protected]

@asuka-mio
Copy link
Author

We may land gralloc1 support in future, but currently AHB extension only works on IMapper4,
Sorry for that, seems your device have no Gralloc4 support
09-29 01:52:22.267 6155 6182 I Gralloc4: mapper 4.x is not supported

@ilhan-athn7
Copy link
Owner

@asuka-mio It is a sdm710 device.
I only see [email protected]

@asuka-mio
Copy link
Author

@ilhan-athn7 https://github.com/asuka-mio/mesa/commits/tu-gralloc1 try this, we have gralloc1 support

@ilhan-athn7
Copy link
Owner

Thanks, can you tell me how to solve readline.h issue without using this commit?

I already have /usr/include/readline/readline.h but still getting file not found error.

@asuka-mio
Copy link
Author

Thanks, can you tell me how to solve readline.h issue without using this commit?

I already have /usr/include/readline/readline.h but still getting file not found error.

Sorry that I'm not maintainer of aospless build script,
Maybe you can file a issue on GloDroid/aospext

@ilhan-athn7
Copy link
Owner

ilhan-athn7 commented Oct 1, 2023

This time i get these;

10-01 12:19:28.588  4904  4959 I MESA    : Using QCOM gralloc (aosp/hardware/qcom/display/*/libgralloc).
10-01 12:19:28.589  4904  4959 W MESA    : QCOM Gralloc API is old. Consider using Gralloc4 API instead.```

@ilhan-athn7
Copy link
Owner

@asuka-mio Hi, tu_gralloc1 branch works with skiavk when i build with android-ndk

@ilhan-athn7
Copy link
Owner

ilhan-athn7 commented Oct 1, 2023

@ilhan-athn7
Copy link
Owner

Hi, is there any news?

@asuka-mio
Copy link
Author

Hi, is there any news?

Nope, for now, its dependency MR is waiting for review

@romanovj
Copy link

any news?

@ilhan-athn7
Copy link
Owner

ilhan-athn7 commented Mar 30, 2024

any news?

No

You can build from #5 (comment)

I can theoretically apply needed patches on the fly of build process, till the patches being merged to upstream.

@romanovj
Copy link

@ilhan-athn7 thanks. I'd like to test it out, but I can't ask much.

@ilhan-athn7
Copy link
Owner

@ilhan-athn7 thanks. I'd like to test it out, but I can't ask much.

Re-fork my repository and edit turnip_builder.sh with following changes;
In line 11

mesasrc="https://github.com/asuka-mio/mesa/archive/refs/heads/tu-gralloc1.zip"

In line 62

cd mesa-tu-gralloc1

Now you can run workflow and github will generate release for you if everything goes on the way.

@Shatur
Copy link

Shatur commented Jun 21, 2024

@ilhan-athn7 looks like the changes were merged. I think it can be closed now.

@ilhan-athn7
Copy link
Owner

@ilhan-athn7 looks like the changes were merged. I think it can be closed now.

That's a good new, i will review it.

@ilhan-athn7
Copy link
Owner

@Shatur i see turnip now has VK_ANDROID_external_memory_android_hardware_buffer but i still can't use skiavk on it

And weirdly my device restarts upon when i override debug.hwui.renderer using resetprop. i guess my rom got some bugs.

@Shatur
Copy link

Shatur commented Jun 23, 2024

In my rom I can't even activate it, the option is grayed out.

@ilhan-athn7
Copy link
Owner

In my rom I can't even activate it, the option is grayed out.

You don't have rely on GUI options
Just run "setprop debug.hwui.renderer skiavk" on a root shell, or adb shell

You can check what rendering is used through below command;

dumpsys gfxinfo | grep Pipeline

The result will be look like that;

# dumpsys gfxinfo | grep Pipeline
Pipeline=Skia (OpenGL)
Pipeline=Skia (OpenGL)
Pipeline=Skia (OpenGL)
Pipeline=Skia (OpenGL)

You will see Vulkan instead of OpenGL if you launch an activity right after using setprop command.
If the system start to complain about crashes or apps stuck at splash screen, just reboot the device.

@Shatur
Copy link

Shatur commented Jun 23, 2024

I rolled back to the default driver. For some reason Fortnite refused to load into the game if I use turnip. I just get infinity load.

@ilhan-athn7
Copy link
Owner

@Shatur i am just about try fortnite, today

@ilhan-athn7
Copy link
Owner

ilhan-athn7 commented Jun 23, 2024

I rolled back to the default driver. For some reason Fortnite refused to load into the game if I use turnip. I just get infinity load.

Screenshot_20240624-000148_GLview
It runs on my device

The first load will took longer, the game compiles PSO shaders for Vulkan, and ir takes even longer on turnip

@Shatur
Copy link

Shatur commented Jun 23, 2024

Hm... Maybe it's a compatibility issue with my device. It's quite old, OnePlus 6 :)

@ilhan-athn7
Copy link
Owner

Hm... Maybe it's a compatibility issue with my device. It's quite old, OnePlus 6 :)

Oneplus 6 is just better than my Xiaomi Mi 8 SE in terms of processing power.

@Shatur
Copy link

Shatur commented Jun 23, 2024

Hm... Strange.
I also just tried running setprop debug.hwui.renderer skiavk, but gfxinfo still reports OpenGL :(
I even tried rebooting.
I use the latest LineageOS and installed turnip via the latest Magisk.

OnePlus6:/ $ getprop debug.hwui.renderer                                                                                   
skiavk
OnePlus6:/ $ dumpsys gfxinfo | grep Pipeline                                                                               
Pipeline=Skia (OpenGL)
Pipeline=Skia (OpenGL)
Pipeline=Skia (OpenGL)
Pipeline=Skia (OpenGL)
Pipeline=Skia (OpenGL)

@Shatur
Copy link

Shatur commented Jun 23, 2024

Ah, I just tried opening any app and it results in black screen. And now I see the following via ADB:

OnePlus6:/ $ dumpsys gfxinfo | grep Pipeline                                                                               
Pipeline=Skia (Vulkan)

@Shatur
Copy link

Shatur commented Jun 23, 2024

With default drivers it works, the following:

OnePlus6:/ $ dumpsys gfxinfo | grep Pipeline                                                                               
Pipeline=Skia (Vulkan)
Pipeline=Skia (OpenGL)
Pipeline=Skia (Vulkan)
Pipeline=Skia (OpenGL)
Pipeline=Skia (OpenGL)
Pipeline=Skia (OpenGL)
Pipeline=Skia (Vulkan)

I got this phone only recently, so I not sure if it worked before :)

I guess if it works for you, then everything is fine, just a problem with my specific GPU.

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

No branches or pull requests

4 participants