Skip to content

Segfault in fullscreen on Wayland with NVIDIA Vulkan WSI (hybrid GPU) #17581

@pablopda

Description

@pablopda

mpv version and platform

  • mpv v0.40.0
  • libplacebo v7.349.0
  • FFmpeg 7.1.1
  • Ubuntu 25.10 (kernel 6.17.0-14-generic)
  • GNOME Shell 49.0 / Mutter 49.0 (Wayland)
  • NVIDIA driver 590.48.01 (proprietary, nvidia-dkms-590)
  • Vulkan loader 1.4.321.0

Hardware

  • Dell XPS 17 9700 (hybrid GPU, no MUX)
  • iGPU: Intel CometLake-H GT2 [UHD Graphics] (PCI 00:02.0)
  • dGPU: NVIDIA TU106M [GeForce RTX 2060 Max-Q] (PCI 01:00.0)
  • Internal eDP panel (1920x1200 @ 60Hz), physically wired to Intel iGPU
  • NVIDIA set as primary compositor GPU via udev rule (mutter-device-preferred-primary)

Description

mpv segfaults in the "vo" thread when entering Wayland fullscreen with Vulkan rendering on NVIDIA. The crash is inside libnvidia-glcore.so.590.48.01 during swapchain recreation triggered by xdg_toplevel.set_fullscreen.

Windowed mode works perfectly. Only true Wayland fullscreen crashes.

Reproducer

# Crashes — native Wayland Vulkan fullscreen:
mpv --fs --vo=gpu --gpu-api=vulkan \
    --vulkan-device="NVIDIA GeForce RTX 2060 with Max-Q Design" \
    any_video_file.mkv

# Works — windowed:
mpv --no-fs --vo=gpu --gpu-api=vulkan \
    --vulkan-device="NVIDIA GeForce RTX 2060 with Max-Q Design" \
    any_video_file.mkv

# Works — XWayland Vulkan context:
mpv --fs --vo=gpu --gpu-api=vulkan --gpu-context=x11vk \
    --vulkan-device="NVIDIA GeForce RTX 2060 with Max-Q Design" \
    any_video_file.mkv

# Works — maximized borderless (avoids xdg fullscreen):
mpv --no-fs --window-maximized=yes --no-border --vo=gpu --gpu-api=vulkan \
    --vulkan-device="NVIDIA GeForce RTX 2060 with Max-Q Design" \
    any_video_file.mkv

Key observations

  • Not format-specific: crashes with any video file
  • Not hwdec-specific: crashes with --hwdec=no (pure software decode)
  • Not renderer-specific: crashes with both vo=gpu and vo=gpu-next
  • Wayland WSI-specific: gpu-context=waylandvk crashes; gpu-context=x11vk works
  • Fullscreen-specific: only xdg_toplevel.set_fullscreen triggers it; maximized does not
  • OpenGL mode (--gpu-api=opengl) doesn't segfault but Mutter fails with: failed to import supplied dmabufs: Could not bind the given EGLImage to a CoglTexture2D

Stack trace

Thread 31 "vo" received signal SIGSEGV, Segmentation fault.
#0  0x00007fff19301132 in ??? () at /lib/x86_64-linux-gnu/libnvidia-glcore.so.590.48.01
#1  0x00007fff19301ea8 in ??? () at /lib/x86_64-linux-gnu/libnvidia-glcore.so.590.48.01
#2  0x00007fff19302a16 in ??? () at /lib/x86_64-linux-gnu/libnvidia-glcore.so.590.48.01
#3  0x00007ffff2f20635 in ??? () at /lib/x86_64-linux-gnu/libvulkan.so.1
#4  0x00007ffff39421d8 in ??? () at /lib/x86_64-linux-gnu/libplacebo.so.349
#5  0x00007ffff3943473 in ??? () at /lib/x86_64-linux-gnu/libplacebo.so.349
#6  0x0000555555759d44 in ??? ()  [mpv vo thread]
#7  0x00005555556dc81c in ??? ()  [mpv vo thread]
#8  0x00005555556e6030 in ??? ()  [mpv vo thread]
#9  0x00007ffff2ca3d64 in start_thread () at ./nptl/pthread_create.c:448

Registers at crash:
  rsi = 0xffffffffffffff  (corrupt size/offset value)

Analysis

The crash path is:

  1. mpv enters fullscreen → Wayland compositor sends xdg_toplevel.configure with new dimensions
  2. mpv's vo thread handles resize → libplacebo calls pl_swapchain_resize
  3. libplacebo calls vkCreateSwapchainKHR to recreate swapchain
  4. Inside libnvidia-glcore.so, the swapchain creation/teardown dereferences an invalid pointer, causing SIGSEGV

This appears to be the same underlying NVIDIA driver bug reported in:

Related mpv issues

Workaround

Use XWayland Vulkan context:

# ~/.config/mpv/mpv.conf
gpu-context=x11vk

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