Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Valmar33 opened this issue Sep 14, 2018 · 6 comments

Comments

@Valmar33
Copy link

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

@haasn
Copy link
Member

haasn commented Sep 14, 2018

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.

@Valmar33
Copy link
Author

I see... thanks @haasn :)

@sfan5 sfan5 closed this as completed Sep 26, 2018
@aufkrawall
Copy link

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. :)

@haasn
Copy link
Member

haasn commented Oct 5, 2018

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.

@laichiaheng
Copy link

laichiaheng commented Jan 2, 2019

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?

@baryluk
Copy link

baryluk commented Jan 5, 2021

No shaderc in Debian or Ubuntu yet. There was a plan to do it, but currently it looks nobody is working on it - : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890472

If there is some other well known user of shaderc, maybe that would provide a better motivation to expedite the packaging of shaderc into Debian.

Other than that, you can build it yourself from shaderc git repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants