Vulkan is broken and does not work at all in mata of lineage-18.1
Expected Behavior
The Adreno GPU driver does not fail to initialize Vulkan, and apps that use drawing with Vulkan work. (Similar to how it works with Stock Firmware and lineage-17.1)
Current Behavior
The Adreno GPU driver fails to initialize Vulkan, and apps that use Vulkan rendering will not work.
Tested with 3DMark's "Sling Shot Extreme - Vulkan" logs:
Example
- 3DMark ( com.futuremark.dmandroid.application, Google Play, v2.2.4785)
When running the benchmark "Sling Shot Extreme - Vulkan", the benchmark will force close with an error.
- RetroArch (com.retroarch, F-Droid, v1.9.0_GIT)
When "vulkan" is set as Video Driver, it does not work and cannot be operated with a black screen. When I read logcat, it tries to initialize and repeats failure.
- DuckStation ( com.github.stenzek.duckstation, Google Play, v0.1-4568 )
When "Hardware (Vulkan)" is selected as GPU Renderer and run it, the error message "Failed to acquire host display.
Possible Solution
Unfortunately, I have no idea. The only thing I can say for sure is that "Vulkan is not working", and OpenGL does not seem to have the same problem. I've also tried setting SELinux to permissive with setenforce 0, but that didn't change the broken behavior.
Also, I haven't tested these exactly, but there were no problems with lineage-17.1, and it looks like they were already broken when the Nightly build became lineage-18.1 in April 2021.
The error message contained in the attached logcat is as follows. Maybe there is a clue to fix it before or after the log.
09-01 17:01:06.632 I/AdrenoVK(31197): Shader compilation failed for shaderType: 0
09-01 17:01:06.632 I/AdrenoVK(31197): Info log: ERROR: 0:1: '' : Unknown char
09-01 17:01:06.632 I/AdrenoVK(31197): INTERNAL ERROR: no main() function!
09-01 17:01:06.632 I/AdrenoVK(31197): ERROR: 1 compilation errors. No code generated.
EDIT (2021/11/12): Found a workaround!
Of the versions that have been officially released as Nightly builds on LOS, lineage-17.1-20210329-nightly-mata-signed.zip is not broken, and lineage-18.1 seems to have broken Vulkan behavior in all of them. So I tried to find the changes made between the branches that might be related.
And I found the following changes made in the intervening lineage-18.0 (17.1->18.0->18.1).
289647: mata: Pin SDM/Adreno stack from Lavender (Redmi Note 7) 10.0 | https://review.lineageos.org/c/LineageOS/android_device_essential_mata/+/289647
At this point, we can see that the blobs in the Adreno GPU driver have been replaced with those from lavender (Redmi Note 7).
The lavender's SoC/GPU is Snapdragon 660/Adreno 509, which is technically different from mata's Snapdragon 835/Adreno 540, although they are siblings of the same generation.
I thought this problem might be related to the blobs in the Adreno GPU driver. At the same time, I thought it might be possible to solve this problem by replacing it with the appropriate version.
[DRIVER] [9.0+] Adreno 500 Series OpenGL & Vulkan Drivers [V@474.0] [1.1.128] | XDA Forums | https://forum.xda-developers.com/t/driver-9-0-adreno-500-series-opengl-vulkan-drivers-v-474-0-1-1-128.4042619/
I installed the existing mod ([M]TeamDrivers_OpenGL-Vulkan_SD835_v5.5(55).zip) to replace the GPU driver with a newer one. As a result, Vulkan now works properly!
This suggests that the problem can be easily solved by simply replacing the blobs in the Adreno GPU driver with a more appropriate version.
Steps to Reproduce
- Install 3DMark ( com.futuremark.dmandroid.application )
- Install the benchmark "Sling Shot Extreme" in the same application.
- Select "Sling Shot Extreme - Vulkan" in the "Sling Shot Extreme" option and run the test.
- The app will show an error message "Benchmark stopped" and confirm that the benchmark cannot be executed normally.
/device mata /version lineage-18.1 /date 2021-09-01 /kernel 4.4.281-lineage-g1196fd62fac4 /baseband 2.0.c4-M2.0.10 /mods Google Apps, F-Droid, Magisk
I have read the directions.