Mpv: With "--gpu-api=vulkan", MPV complains that it cannot find SPIRV, despite spirv-tools being installed

Created on 14 Sep 2018  路  5Comments  路  Source: mpv-player/mpv

mpv version and platform

MPV 0.29.0 on Arch Linux.

Running Mesa master and LLVM master from AUR.

Reproduction steps

  1. Install mpv and spirv-tools.
  2. Play a video file using the "--gpu-api=vulkan" switch.

Expected behavior

Detects spirv, and plays video with Vulkan backend. (what binary is it expecting, anyways?)

Actual behavior

Complains with "[vo/gpu/vulkan] Failed initializing SPIR-V compiler!" for both X11 and Wayland backends

Log file

https://paste.kde.org/pgufj4akv

Most helpful comment

This happens because your mpv is compiled without support for libshaderc, which is the only SPIR-V backend that mpv supports for now (apart from the deprecated nvidia-only VK_NV_glsl_shader which we will be dropping support for eventually). To solve the issue you will need to install libshaderc and make sure mpv is built against it.

Note: It wouldn't be too difficult to support using glslang directly instead of shaderc. I have already written a C wrapper for glslang for this purpose for a different project; if you want to try merging it to mpv I could offer some pointers. That said, using shaderc is still preferred to glslang since it means you (i.e. we) get better diagnostics.

How to do it by using the mpv-build.git in Ubuntu?

All 5 comments

This happens because your mpv is compiled without support for libshaderc, which is the only SPIR-V backend that mpv supports for now (apart from the deprecated nvidia-only VK_NV_glsl_shader which we will be dropping support for eventually). To solve the issue you will need to install libshaderc and make sure mpv is built against it.

Note: It wouldn't be too difficult to support using glslang directly instead of shaderc. I have already written a C wrapper for glslang for this purpose for a different project; if you want to try merging it to mpv I could offer some pointers. That said, using shaderc is still preferred to glslang since it means you (i.e. we) get better diagnostics.

I see... thanks @haasn :)

Is shaderc widely available in distribution repos? Would be great if this didn't strip people from using Vulkan in mpv, at least that's the case with Arch Linux. :)

Now that shaderc have adopted a SOVERSION and are possibly thinking about fixing their other packaging errors (e.g. vendored libraries, lack of pkg-config, wrong .so name, ...) it might be more likely to see shaderc packaged.

This happens because your mpv is compiled without support for libshaderc, which is the only SPIR-V backend that mpv supports for now (apart from the deprecated nvidia-only VK_NV_glsl_shader which we will be dropping support for eventually). To solve the issue you will need to install libshaderc and make sure mpv is built against it.

Note: It wouldn't be too difficult to support using glslang directly instead of shaderc. I have already written a C wrapper for glslang for this purpose for a different project; if you want to try merging it to mpv I could offer some pointers. That said, using shaderc is still preferred to glslang since it means you (i.e. we) get better diagnostics.

How to do it by using the mpv-build.git in Ubuntu?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuvadm picture yuvadm  路  3Comments

szg0000 picture szg0000  路  3Comments

jcowgill picture jcowgill  路  3Comments

thebunnyrules picture thebunnyrules  路  3Comments

WoLpH picture WoLpH  路  3Comments