I just want to make sure I actually need to file a bug report with upstream nixpkgs, and that I haven’t done anything really stupid. So I don’t expect to find a solution here.
Simply put, trying to play a video file using the mpv packaged in nixpkgs (via nix-shell -p mpv or any other standard way) outputs some errors, and then segfaults.
[nix-shell:~]$ mpv output.mkv
(+) Video --vid=1 (h264 1920x1080 25.000fps)
(+) Audio --aid=1 --alang=eng (opus 2ch 48000Hz)
[vo/gpu/drm] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/drm] Failed to set up VT switcher. Terminal switching will be unavailable.
MESA-LOADER: failed to open apple: /run/opengl-driver/lib/dri/apple_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri, suffix _dri)
MESA-LOADER: failed to open kms_swrast: /run/opengl-driver/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri, suffix _dri)
MESA-LOADER: failed to open swrast: /run/opengl-driver/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri, suffix _dri)
[vo/gpu] Failed to create GBM device.
[vo/gpu] Failed to setup GBM.
[vo/gpu] Failed to commit atomic request: No such file or directory
Segmentation fault (core dumped)
I think I figured it out. Nixpkgs uses all of its own software, and mesa-asahi-edge with the graphics drivers is not provided there. There is a third party Nix package providing it, but I need to either:
Replace the mesa dependency at runtime (not possible by default with flakes)
Override nixpkgs’s mesa package altogether, which is possible, but forces me to recompile everything.
Right now, I can use Fedora’s provided mpv package instead, but Nix should be working as soon as graphics drivers are merged in upstream mesa.
Graphics drivers are merged on upstream Mesa but can’t be enabled/ungated until the kernel UAPI is stable, and that is blocked on the kernel driver being upstream, and that is blocked on kernel developers generally being assholes towards the Rust people [1] [2], so unfortunately it might still take a very long time.
Regardless, I want to thank you (as many people already have) and the Asahi Linux team for all the work you’ve done. It’s still incredible to me that I can daily drive a Linux system on what is still a pretty new platform.