GhostNaN/mpvpaper

SIGFPE when running

mcginty opened this issue · 4 comments

I'm on Arch Linux (kernel 6.0.10, Wayland 1.21.0) with an NVIDIA GPU running driver 525.60.11. Not sure if this is a mpvpaper-related issue, or if it's only MPV/libva/NVIDIA. The weird part is that the regular mpv command runs and plays videos just fine...

$ mpvpaper -o "vo=libmpv gpu-context=auto gpu-api=auto" -vv 'DP-1' my_video.mkv
[*] Verbose Level 2 enabled
[+] Connected to Wayland compositor
[*] Output DP-1 (LG Electronics LG Ultra HD 0x00008DEF) selected
[*] OpenGL 4.6 EGL context created
[+] EGL initialized
[*] Loaded [ mpv.conf input.conf ] user configs from "~/.config/mpv/"
fish: Job 1, 'mpvpaper -vv 'DP-1' …' terminated by signal SIGFPE (Floating point exception)

GDB output:

Thread 1 "mpvpaper" received signal SIGFPE, Arithmetic exception.
0x00007fffe2c625c7 in ?? () from /usr/lib/dri/nvidia_drv_video.so
(gdb) bt
#0  0x00007fffe2c625c7 in  () at /usr/lib/dri/nvidia_drv_video.so
#1  0x00007fffe2c626ad in  () at /usr/lib/dri/nvidia_drv_video.so
#2  0x00007fffe2c676bb in __vaDriverInit_1_13 () at /usr/lib/dri/nvidia_drv_video.so
#3  0x00007ffff5277c9c in  () at /usr/lib/libva.so.2
#4  0x00007ffff527cdf1 in vaInitialize () at /usr/lib/libva.so.2
#5  0x00007ffff7d5eb43 in  () at /usr/lib/libmpv.so.2
#6  0x00007ffff7d27ad6 in  () at /usr/lib/libmpv.so.2
#7  0x00007ffff7d0dcc2 in  () at /usr/lib/libmpv.so.2
#8  0x00007ffff7d16f15 in  () at /usr/lib/libmpv.so.2
#9  0x00007ffff7d17835 in  () at /usr/lib/libmpv.so.2
#10 0x00007ffff7d4ce67 in mpv_render_context_create () at /usr/lib/libmpv.so.2
#11 0x000055555555a05c in  ()
#12 0x00007ffff7f424f6 in  () at /usr/lib/libffi.so.8
#13 0x00007ffff7f3ef5e in  () at /usr/lib/libffi.so.8
#14 0x00007ffff7f41b73 in ffi_call () at /usr/lib/libffi.so.8
#15 0x00007ffff7f64645 in  () at /usr/lib/libwayland-client.so.0
#16 0x00007ffff7f64e03 in  () at /usr/lib/libwayland-client.so.0
#17 0x00007ffff7f64ffc in wl_display_dispatch_queue_pending () at /usr/lib/libwayland-client.so.0
#18 0x0000555555558892 in main ()

Great, probably another Nvidia driver issue.

0x00007fffe2c625c7 in ?? () from /usr/lib/dri/nvidia_drv_video.so

That's your issue and I don't see how mpvpaper is involved here besides using libmpv to render.

Yep... I regret ever getting an NVIDIA card. Anyway, just thought I'd post it since it's happening, knowing it's unlikely to be caused by mpvpaper's code.

Yep... I regret ever getting an NVIDIA card. Anyway, just thought I'd post it since it's happening, knowing it's unlikely to be caused by mpvpaper's code.

What drivers are you using?

AMD cards are not absolutely better, as they have glitches or have crashes on some games (see here) and some DL frameworks do not run on ROCm

Same problem here, I made a minimal libmpv program to verify it was working fine (mpv works perfectly).

This minimal program also works fine (archlinux + nvidia), maybe we can narrow down the bogus part by either making this simple example closer to mpvpaper or making things optional in mpvpaper ?

#include <stdio.h>
#include <mpv/client.h>

int main(int argc, char *argv[]) {
    // Check if a file path is provided as a command-line argument
    if (argc < 2) {
        fprintf(stderr, "Usage: %s <video_file>\n", argv[0]);
        return 1;
    }

    // Initialize libmpv
    mpv_handle *mpv = mpv_create();
    if (!mpv) {
        fprintf(stderr, "Failed to initialize libmpv.\n");
        return 1;
    }

    // Initialize the player
    if (mpv_initialize(mpv) != MPV_ERROR_SUCCESS) {
        fprintf(stderr, "Failed to initialize the player.\n");
        mpv_terminate_destroy(mpv);
        return 1;
    }

    // Load the video file
    if (mpv_command(mpv, (const char *[]){"loadfile", argv[1], NULL}) != MPV_ERROR_SUCCESS) {
        fprintf(stderr, "Failed to load the video file.\n");
        mpv_terminate_destroy(mpv);
        return 1;
    }

    // Enter the main loop (this loop will keep the player running)
    mpv_event *event;
    while (1) {
        event = mpv_wait_event(mpv, -1);
        if (event->event_id == MPV_EVENT_NONE)
            break;
    }

    // Clean up and destroy the player
    mpv_terminate_destroy(mpv);

    return 0;
}