Skip to content

WSL2 VulkanContext creation failure lacking device extension #6163

@rcorsi

Description

@rcorsi

Summary

Related and followup to #5963 where on WSL2 the VulkanContext fails to be created because the Microsoft Linux Kernel 6.6.x used with all WSL2 Linux distributions is lacking support for shareable vulkan image.

Because the VulkanContext fails to be created the system falls back to Software GPU (--force-cpu-painting) and that appears to be another bug as described in #5963 for WSL2 and also #6031 for other environments, leading to the browser painting being transparent or very broken.

When starting Ladybird, the following output shows that the VulkanContext failed to be created

1319.390 WebContent(15777): Vulkan context creation failed: Logical device creation failed
1319.407 WebContent(15784): Vulkan context creation failed: Logical device creation failed

Specifically the device extension support for VK_EXT_image_drm_format_modifier is missing on WSL2 due to the Kernel 6.6.x lacking the needed device drivers.

Missing device extension might also be known as:

VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME

To workaround the issue, comment out the line on Libraries/LibGfx/VulkanContext.h:18 with the text

#        define USE_VULKAN_IMAGES 1

And if the VulkanContext works as expected after building ladybird with the workaround, meaning that the following lines DO NOT appear,

1319.390 WebContent(15777): Vulkan context creation failed: Logical device creation failed
1319.407 WebContent(15784): Vulkan context creation failed: Logical device creation failed

then the system is correctly configured.

It might be possible to build a custom kernel to resolve the lacking device driver support or lacking that request that Microsoft fix the issue by requesting that the feature be supported by creating an issue at the link below. It will probably take some time to get resolved...

https://github.com/microsoft/WSL2-Linux-Kernel

Operating system

Linux

Steps to reproduce

  1. On Windows 10/11 install the latest Ubuntu in WSL2 virtual environment
  2. build ladybird in Ubuntu WSL2 environment
  3. VulkanContext will fail to be created and system will fall back to software CPU (--force-cpu-painting)
  4. It is important to make sure the all required Ubuntu packages to properly support llvmpipe be installed (or whatever physical GPU is being used)

Expected behavior

VulkanContext should work.

Actual behavior

VulkanContext fails due to device extension VK_EXT_image_drm_format_modifier is not available on WSL2

VulkanContext may also be failing due to the environment missing packages to properly support llvmpipe software GPU (or physical GPU if one is being used). So that must be ruled out first.

URL for a reduced test case

none available

HTML/SVG/etc. source for a reduced test case

none available

Log output and (if possible) backtrace

$ ./Meta/ladybird.py run
ninja: Entering directory `/home/bobo/projects/myladybird/Build/release'
[1809/1809] Linking CXX executable bin/Ladybird
QStandardPaths: wrong permissions on runtime directory /run/user/1000/, 0755 instead of 0700
1319.390 WebContent(15777): Vulkan context creation failed: Logical device creation failed
1319.407 WebContent(15784): Vulkan context creation failed: Logical device creation failed

Screenshots or screen recordings

No response

Build flags or config settings

No response

Contribute a patch?

  • I’ll contribute a patch for this myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions