Skip to content

wescene renderer unusable on pre-GFX9 AMD: VK_EXT_image_drm_format_modifier required on the offscreen path #99

Description

@Crono141

wescene renderer unusable on pre-GFX9 AMD: VK_EXT_image_drm_format_modifier required on the offscreen path

Summary

On pre-GFX9 AMD hardware (GCN 1.0–GFX8: SI/CIK/VI, e.g. Polaris), RADV does not expose
VK_EXT_image_drm_format_modifier. The offscreen path marks that extension required, which
makes waywallen-wescene-renderer fail on all such GPUs. The user-visible failure is misleading:
depending on the render_node setting it appears either as a missing DRM render node or as an
unsupported extension.

RADV limits this extension to GFX9+ because pre-GFX9 tiling layouts are difficult to express
through that interface. It is not a driver bug and is not fixable by configuration.

Environment

  • GPU: AMD Radeon RX 590 (Polaris10, GFX8), amdgpu
  • Mesa: 26.1.5 (host) — also reproduced against a Mesa 26.2.0_devel build
  • Kernel: 7.1.5-1-cachyos (CachyOS)
  • Flatpak: org.waywallen.waywallen 0.3.2, runtime org.kde.Platform 6.11
  • Plugin: org.waywallen.open-wallpaper-engine 0.2.3

Reproduce

Apply any scene (.pkg) wallpaper on a pre-GFX9 AMD GPU.

With [plugin.wescene-renderer] render_node = "" (default):

ERROR ww_pool[vulkan]: drm_render_fd=-1 and drm_render_minor=0 — producer must populate
  drm_render_minor (use ww_bridge_vk_query_render_node from probe_vk.h) or share an
  already-opened drm_render_fd
ERROR waywallen-wescene-renderer: ww_bridge_pool_create failed: -22
ERROR owe::vulkan::VulkanRender::Impl] ex_swapchain_factory returned null

With render_node = "/dev/dri/renderD128" (pinned to the real GPU):

ERROR owe::vulkan::Device] required vulkan device extension
  "VK_EXT_image_drm_format_modifier" is not supported
ERROR owe::vulkan::VulkanRender::Impl] init vulkan device failed
ERROR waywallen-wescene-renderer: VulkanRender did not finish init within 10s

Root cause

src/Scene/VulkanRender/VulkanRender.cpp:417 (offscreen path):

device_exts.push_back({ true, VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME });

Marked required, so Device::Create rejects any device lacking it
(src/Vulkan/Device.cpp:133). The same extension is optional on the non-offscreen path
(VulkanRender.cpp:86).

Because it is required, device selection skips the AMD GPU and falls through to llvmpipe,
which is present in the Flatpak runtime. llvmpipe advertises the modifier extension but has no
DRM render node, so ww_bridge_vk_query_render_node yields drm_render_minor=0 and the pool
fails with -22. That is the entire explanation for the first error above — it reads like a
device-permission problem but is a device-selection consequence.

Vulkan device enumeration inside the sandbox (probe using VK_EXT_physical_device_drm):

[0] AMD Radeon RX 590 Series (RADV POLARIS10)
    hasRender=1 renderMinor=128
    VK_EXT_image_drm_format_modifier: NOT SUPPORTED
[1] llvmpipe (LLVM 21.1.8, 256 bits)
    hasRender=0 renderMinor=0
    VK_EXT_image_drm_format_modifier: SUPPORTED

(Deduplicated for readability — the Flatpak runtime registers each ICD twice, once under
GL/default/lib/vulkan/icd.d/ and again under the merged GL/vulkan/icd.d/, so the loader
actually reports four physical devices. That duplication is a runtime packaging artifact and
not related to this issue.)

No device on the system satisfies both requirements, which is why both render_node settings
fail and why pinning it only changes which error surfaces.

Note on the capability flag

src/Vulkan/Device.cpp:248 records support as a capability:

.drm_format_modifier = exists(tested_exts, VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME),

but drm_format_modifier (src/Vulkan/Vulkan.cppm:817) is never read anywhere in the tree.
The flag appears to anticipate a fallback that was never wired up.

Suggestions

  1. Consider preferring a device with a DRM render node during selection. If falling back to
    a software rasterizer isn't intended on the offscreen path, filtering it out would turn a
    confusing failure into a clear one.
  2. Improve the diagnostic. When no device satisfies the offscreen requirements, report that
    directly — naming the missing extension and the rejected devices — rather than surfacing
    drm_render_fd=-1 from the pool layer.
  3. Consider a no-modifier export path. For export (as opposed to the CEF import case noted
    at viewer/WebViewer/VulkanBlitter.cpp:436), a VK_IMAGE_TILING_LINEAR image with the row
    pitch from vkGetImageSubresourceLayout, exported via VK_EXT_external_memory_dma_buf and
    advertised as DRM_FORMAT_MOD_LINEAR, may be viable without the extension. This depends on
    the bridge accepting such a buffer — filed separately against waywallen.

Upstream context

DRM format modifier support for GFX6–GFX8 has been implemented by Timur Kristóf (Valve):
kernel-side patches target Linux 7.3, with matching RADV/RadeonSI userspace merged in Mesa.
Once that ships — and once the Flatpak runtime's GL extension picks it up — this should resolve
itself on affected hardware. Until then these GPUs cannot run scene wallpapers at all.

Related

The same underlying RADV/GFX8 limitation has already been reported against the waywallen repo
from other angles:

This report is filed here because the required flag and the resulting device selection are in
this repository's scene renderer.

A working (if heavy) workaround is documented in waywallen/waywallen#98: apply Timur Kristóf's
four kernel patches plus Mesa MR !41557 with backport patches, then rebuild both. That matches
what I observed — a stock Mesa 26.2.0_devel build alone did not expose the extension on
this GPU, so the kernel side appears to be required as well.

Line numbers are from main @ 92af22d.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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