Skip to content

possible problems with syncing of vulkan and metal events #2697

@Akemi

Description

@Akemi

some time ago i noticed that our media player mpv that uses moltenvk via libplacebo + vulkan started to exhibit glitches in rendering:

  • green artifacts
  • weirdly scaled/shifted frames in-between normal frames (noticable on playback)
  • OSC/stats glitching, no background colour
  • sometimes several swapchain errors, when seeking/next file switch, rendering stops

i can reliable reproduce the problem when putting enough pressure on the GPU and it being close to its limits, with the current moltenvk release.

bisected the problem to following libplacebo commit haasn/libplacebo@11b3350. everything is fine before this. the changes of that commit seems fine and in general we don't see anything obviously wrong with it. furthermore, even though i don't like to argument that way, no other vulkan driver on any other platform exhibits that problem currently.

i tried the following, which still exhibits the problems:

  • MVK_CONFIG_ALLOW_METAL_EVENTS=0
  • MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE=0

following does not exhibit the problems or can't be observed:

  • MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE=3

MVK_CONFIG_VK_SEMAPHORE_SUPPORT_STYLE=3 is very slow and doesn't really saturate my GPU, it only renders between 35-45fps in my tests and not the ~60fps like the other setups. so it might still exhibit the problem if it were faster.

some screenshots and videos of the problem:
green artifacts:
Image

stats glitch, vanishing background between frames:
Image
Image

screen recording of the glitches:
background + green: https://0x0.st/PXjm.mov
scale-shift: https://0x0.st/PXja.mov

original issue as reference with more infos mpv-player/mpv#17258

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