mesa-for-android-container icon indicating copy to clipboard operation
mesa-for-android-container copied to clipboard

Errors about vkEnumeratePhysicalDevices

Open Roger-Qea opened this issue 7 months ago • 5 comments

Hello, I am using Nethunter/Kali (using chroot) on 8Gen1 FD730. I compiled and installed mesa from source code with meson/ninja according to the instructions of this project. The driver generally works, but it looks that vkEnumeratePhysicalDevices does not work. Programs which explicitly select devices will fail.

──(kali㉿kali)-[~]
└─$ vulkaninfo | more
WARNING: [../src/freedreno/vulkan/tu_knl_kgsl.cc:1719] Code 0 : I can't KHR_display (VK_ERROR_INITIALIZATION_FAILED)
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs: Call to 'vkEnumeratePhysicalDevices' in ICD /usr/lib/aarch64-linux-gnu/libvulkan_freedreno.so failed with error code -3
WARNING: [../src/freedreno/vulkan/tu_knl_kgsl.cc:1719] Code 0 : I can't KHR_display (VK_ERROR_INITIALIZATION_FAILED)
ERROR: [Loader Message] Code 0 : setup_loader_term_phys_devs: Call to 'vkEnumeratePhysicalDevices' in ICD /usr/lib/aarch64-linux-gnu/libvulkan_freedreno.so failed with error code -3
WARNING: [Loader Message] Code 0 : ICD for selected physical device does not export vkGetPhysicalDeviceDisplayPlanePropertiesKHR!
WARNING: [Loader Message] Code 0 : ICD for selected physical device does not export vkGetPhysicalDeviceDisplayPropertiesKHR!
==========
VULKANINFO
==========

Vulkan Instance Version: 1.4.341


Instance Extensions: count = 26


There are also some errors messages about pipe when running Godot, although the GPU acceleration generally looks work (with some flashing artifacts, as already mentioned in the other issue). Here is the log.

┌──(kali㉿kali)-[~]
└─$ godot
Godot Engine v4.4.1.stable.official.49a5bc7b6 - https://godotengine.org
WARNING: XOpenIM failed
     at: DisplayServerX11 (platform/linuxbsd/x11/display_server_x11.cpp:6717)
MESA-LOADER: failed to retrieve device information
MESA: error: kgsl_pipe_get_param:103: invalid param id: 13
MESA-LOADER: failed to retrieve device information
MESA: error: kgsl_pipe_get_param:103: invalid param id: 13
MESA-LOADER: failed to retrieve device information
MESA: error: kgsl_pipe_get_param:103: invalid param id: 13
WARNING: XCreateIC couldn't create wd.xic
     at: _create_window (platform/linuxbsd/x11/display_server_x11.cpp:6316)
OpenGL API 4.6 (Core Profile) Mesa 26.1.0-devel - Compatibility - Using Device: freedreno - FD730

I hope someone could help me figure out why this happens or how fix it. Thanks in advance.

Roger-Qea avatar Apr 10 '26 05:04 Roger-Qea

For Turnip (Vulkan), use the turnip-main branch or the turnip-26.1.0-devel-20260404 TAG to build the Turnip driver separately, and then simply overwrite your previous Freedreno installation. Note that the meson setup command needs to be modified. See these parts of the README:

If the Turnip driver from the standard release (whose release title doesn't have the turnip- prefix) fails to work properly, you can use the unpatched Turnip driver (whose release title does have the turnip- prefix) by directly installing it over the standard one.

For Adreno 7xx/8xx, it is generally recommended to first extract the standard installation package (which includes Freedreno), followed by the unpatched Turnip installation package.

If you need to build the Turnip driver separately, you can use the following initialization command:

meson setup build/ \
    --prefix=/usr \
    -Dplatforms=x11,wayland \
    -Dgallium-drivers= \
    -Dgallium-va=disabled \
    -Dgallium-mediafoundation=disabled \
    -Dvulkan-drivers=freedreno \
    -Dvulkan-layers= \
    -Dgles1=disabled \
    -Dgles2=disabled \
    -Dopengl=false \
    -Dgbm=disabled \
    -Dglx=disabled \
    -Dxlib-lease=disabled \
    -Dfreedreno-kmds=kgsl \
    -Degl=disabled \
    -Dglvnd=disabled \
    -Dintel-rt=disabled \
    -Dmicrosoft-clc=disabled \
    -Dllvm=disabled \
    -Dvalgrind=disabled \
    -Dbuild-tests=false \
    -Dlibunwind=disabled \
    -Dlmsensors=disabled \
    -Dandroid-libbacktrace=disabled \
    -Dbuildtype=release

For Freedreno (OpenGL & OpenGL ES), use the dev/adreno-main branch or the mesa-26.1.0-devel-20260404 TAG to build before the build and installation of Turnip driver. Currently, there might be issues with the artifacts built directly using the adreno-main branch mentioned in the "Local Build" section of the README; I will modify the README later.

In summary, currently, if you want Freedreno (OpenGL & OpenGL ES) and Turnip (Vulkan) to work together, you also need to perform two separate builds, just like installing the packages from the Releases.

lfdevs avatar Apr 10 '26 06:04 lfdevs

@lfdevs Thank you for your reply. I followed your new README, built the 2 projects and installed them (on another 8Elite FD830 phone). vkEnumeratePhysicalDevices works now. However, when working with kgsl, OpenGL does not work (tested with Godot and glmark2), but vulkan does work (tested with filament sample program). And it is noticeable the kgsl_pipe_get_param error is still there.

kali@kali:/opt/KaliPub/filament-1.69.4/out/cmake-debug/samples$ export MESA_LOADER_DRIVER_OVERRIDE=kgsl
kali@kali:/opt/KaliPub/filament-1.69.4/out/cmake-debug/samples$ ./hellopbr 
MESA-LOADER: failed to retrieve device information
MESA: error: kgsl_pipe_get_param:103: invalid param id: 13
FEngine (64 bits) created at 0x5c3cb186a0 (threading is enabled)
Vulkan device driver: turnip Mesa driver Mesa 26.1.0-devel
Selected physical device 'Adreno (TM) 830' from 3 physical devices. (vendor 0x5143, device 0x44050001, driver 0x6800063, api 1.4)
Backend feature level: 3
FEngine feature level: 3
Requested linear format but KTX contains a sRGB format. 
Requested linear format but KTX contains a sRGB format. 
vkCreateSwapchain: 1024x640, VK_FORMAT_B8G8R8A8_UNORM, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, swapchain-size=4, identity-transform=true, depth=VK_FORMAT_D32_SFLOAT_S8_UINT, protected=false
Renderer: Commands High watermark 0 KiB (0%), 5 commands, 64 bytes/command
CircularBuffer: High watermark 0 KiB (0%)
cleaning up 1 leaked filament::FIndexBuffer
cleaning up 1 leaked filament::FVertexBuffer
FEngine::mHeapAllocator arena: High watermark 26 KiB
kali@kali:/opt/KaliPub/filament-1.69.4/out/cmake-debug/samples$ godot
Godot Engine v4.6.1.stable.official.14d19694e - https://godotengine.org
MESA-LOADER: failed to retrieve device information
MESA: error: kgsl_pipe_get_param:103: invalid param id: 13
MESA-LOADER: failed to retrieve device information
MESA: error: kgsl_pipe_get_param:103: invalid param id: 13
MESA-LOADER: failed to retrieve device information
MESA: error: kgsl_pipe_get_param:103: invalid param id: 13
OpenGL API 4.6 (Core Profile) Mesa 26.1.0-devel - Compatibility - Using Device: freedreno - FD830

MESA: error: flush_submit_list:92: submit failed -1 (Protocol error)
MESA: error: flush_submit_list:92: submit failed -1 (Protocol error)
MESA: error: flush_submit_list:92: submit failed -1 (Protocol error)
MESA: error: flush_submit_list:92: submit failed -1 (Resource deadlock avoided)
MESA: error: flush_submit_list:92: submit failed -1 (Resource deadlock avoided)
MESA: error: flush_submit_list:92: submit failed -1 (Resource deadlock avoided)
MESA: error: flush_submit_list:92: submit failed -1 (Resource deadlock avoided)
MESA: error: flush_submit_list:92: submit failed -1 (Resource deadlock avoided)

When using zink, both OpenGL and Vulkan work, but obviously Vulkan performance is better with kgsl than zink.

kali@kali:/opt/KaliPub/filament-1.69.4/out/cmake-debug/samples$ export MESA_LOADER_DRIVER_OVERRIDE=zink
kali@kali:/opt/KaliPub/filament-1.69.4/out/cmake-debug/samples$ godot
Godot Engine v4.6.1.stable.official.14d19694e - https://godotengine.org
OpenGL API 4.6 (Core Profile) Mesa 26.1.0-devel - Compatibility - Using Device: Mesa - zink Vulkan 1.4(Adreno (TM) 830 (MESA_TURNIP))

kali@kali:/opt/KaliPub/filament-1.69.4/out/cmake-debug/samples$ ./hellopbr 
FEngine (64 bits) created at 0x5e866ea870 (threading is enabled)
Vulkan device driver: turnip Mesa driver Mesa 26.1.0-devel
Selected physical device 'Adreno (TM) 830' from 3 physical devices. (vendor 0x5143, device 0x44050001, driver 0x6800063, api 1.4)
Backend feature level: 3
FEngine feature level: 3
Requested linear format but KTX contains a sRGB format. 
Requested linear format but KTX contains a sRGB format. 
vkCreateSwapchain: 1024x640, VK_FORMAT_B8G8R8A8_UNORM, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, swapchain-size=4, identity-transform=true, depth=VK_FORMAT_D32_SFLOAT_S8_UINT, protected=false
Renderer: Commands High watermark 0 KiB (0%), 5 commands, 64 bytes/command
CircularBuffer: High watermark 0 KiB (0%)
cleaning up 1 leaked filament::FIndexBuffer
cleaning up 1 leaked filament::FVertexBuffer
FEngine::mHeapAllocator arena: High watermark 26 KiB
kali@kali:/opt/KaliPub/filament-1.69.4/out/cmake-debug/samples$ 

I am not sure if I have misunderstood the new README. I downloaded the 2 projects; built them with different meson configurations; and "ninja -C build/ install " the mesa-for-android-container-adreno-main firstly, then install "mesa-for-android-container-turnip-26.1.0-devel-20260404" secondly, then ldconfig. After these, OpenGL with kgsl does not work.

kali@kali:/opt/KaliPub/MesaBuild$ ls -l
total 248443
drwxrwxr-x. 17 kali kali      3452 Apr 11 03:08 mesa-for-android-container-adreno-main
-rw-rw-r--.  1 kali kali 126382919 Apr 10 23:47 mesa-for-android-container-adreno-main.zip
drwxrwxr-x. 16 kali kali      3452 Apr 11 03:12 mesa-for-android-container-turnip-26.1.0-devel-20260404
-rw-rw-r--.  1 kali kali 127756744 Apr 10 23:02 mesa-for-android-container-turnip-26.1.0-devel-20260404.zip

Roger-Qea avatar Apr 11 '26 04:04 Roger-Qea

Oh, I haven't corrected the instructions in the README yet. For the first step (i.e., building Freedreno), you can just follow my previous reply and use the mesa-26.1.0-devel-20260404 TAG or the dev/adreno-main branch (instead of the adreno-main branch) to build.

Simply put, the following two TAGs are the only ones you need for your build:

mesa-26.1.0-devel-20260404
turnip-26.1.0-devel-20260404

lfdevs avatar Apr 11 '26 04:04 lfdevs

@lfdevs Thanks, the "mesa-26.1.0-devel-20260404" and "turnip-26.1.0-devel-20260404" combination works for me. Now there's only the MESA: error: kgsl_pipe_get_param:103: invalid param id: 13 , while I don't know what this actually influences as everything seems rendered normally. The performance of the new driver is worse than old ones on 7xx GPU, but for my FD830 phone it is necessary. I hope there will be optimization in the future.

Roger-Qea avatar Apr 13 '26 05:04 Roger-Qea

The error MESA: error: kgsl_pipe_get_param:103: invalid param id: 13 can be ignored, as it does not affect the normal operation of the driver.

Currently, for Freedreno/Turnip drivers, Mesa upstream is actively performing optimizations and new feature development; all we need to do is wait.

lfdevs avatar Apr 13 '26 11:04 lfdevs