#18901 closed enhancement (fixed)
mpv-0.37.0 (needs additional packages to be added)
Reported by: | Bruce Dubbs | Owned by: | Douglas R. Reno |
---|---|---|---|
Priority: | normal | Milestone: | 12.1 |
Component: | BOOK | Version: | git |
Severity: | normal | Keywords: | |
Cc: |
Description
New minor version.
Change History (13)
comment:1 by , 15 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 15 months ago
follow-up: 5 comment:3 by , 15 months ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
Summary: | mpv-0.37.0 → mpv-0.37.0 (needs additional packages to be added) |
Bruce has asked me to take this on because it requires several new packages. The libplacebo dependency is unconditional.
The chain essentially goes...
libplacebo
- Vulkan: needs vulkan-icd-loader and vulkan-headers
- OpenGL: needs glad and then glfw
For a while we've sort of ignored Vulkan, but I think it's time that we add support for it to the book. It's now used in a lot of different applications, and in the book currently we have references to mesa, gtksourceview5, gtk4, qt5, qt6, gst-plugins-bad, and pipewire.
Looking at Arch paints a slightly different picture. They also have Vulkan listed for ffmpeg, and libplacebo listed for VLC. I will add both of those in as optionals in a commit later today so it's easier for me to track them.
Vulkan drivers will need to be enabled in Mesa, and that's where most hardware support will come from, but that should be good. :)
Vulkan is described as "a low-overhead, cross-platform API, open standard for 3D graphics and computing developed by Khronos Group, a successor to OpenGL.". On benchmarks and applications which use it, the performance increase is quite notable. The support should be present for AMDGPU and Intel GPUs, as well as SWRast and Nouveau through the NVK driver in Mesa. The kernel support for this driver, known as NVK, was added in February.
For testing, I'm going to use Half-Life 2 with Vulkan support, Portal, and VKMark. I'll also use MPV and VLC to play videos and try to get those both to use the Vulkan renderer. I will also handle testing on 32-bit.
This will take me a few days to get to, but I may have it in as early as the weekend.
comment:4 by , 15 months ago
Status: | new → assigned |
---|
comment:5 by , 15 months ago
Replying to Douglas R. Reno:
Bruce has asked me to take this on because it requires several new packages. The libplacebo dependency is unconditional.
The chain essentially goes...
libplacebo
- Vulkan: needs vulkan-icd-loader and vulkan-headers
- OpenGL: needs glad and then glfw
Is it select-able at build time or we must have these four dependencies? If it's select-able I prefer only adding Vulkan dependencies.
comment:6 by , 15 months ago
I installed glad and then tried to build libplacebo, using the following commands:
meson setup --prefix=/opt/X11 --buildtype=release -Dvulkan=disabled ..
../src/include/libplacebo/vulkan.h:21:10: fatal error: vulkan/vulkan.h: No such file or directory
21 | #include <vulkan/vulkan.h>
So, it seems, it needs at least some vulkan headers.
What package does provide those?
comment:7 by , 15 months ago
Sorry for asking before checking myself, they are here:
https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.270.tar.gz
comment:8 by , 15 months ago
Just as some input from me:
I successfully built mpv-0.37.0 by
- First installing glad 2.0.4 from https://github.com/Dav1dde/glad/, with the standard pip3 stuff
- Installing the vulkan headers 1.3.270 from https://github.com/KhronosGroup/Vulkan-Headers with:
mkdir build cd build || exit cmake -DCMAKE_INSTALL_PREFIX=/usr -S .. sudo make install
- Installing libplacebo-6.338.1 from https://github.com/haasn/libplacebo/ with:
mkdir build cd build || exit meson setup --prefix=/opt/X11 --buildtype=release -Ddemos=false -Dvulkan=disabled .. ninja || exit DESTDIR=$DESTDIR ninja install # or sudo, of course
After that, the new mpv builds and runs fine, and by specifying:
mpv -vo gpu-next $file
it will use the new "Shader-based GPU renderer"
So, I suppose, these are the minimal new dependencies.
comment:9 by , 15 months ago
Seems that vlc 3.0.20 and libplacebo-6.338.1 don't mix well, my vlc compile failed with placebo installed.
Maybe there is a patch for vlc, in the meantime
--disable-libplacebo
in vlc also works.
comment:10 by , 15 months ago
Things are moving decently well with Vulkan.
I've installed assimp and vkmark on my system to run a series of tests/benchmarks using Vulkan. Here are the results from my development system:
renodr [ /sources ]$ vkmark ======================================================= vkmark 2017.08 ======================================================= Vendor ID: 0x1002 Device ID: 0x67EF Device Name: AMD Radeon RX 460 Graphics (RADV POLARIS11) Driver Version: 96473096 Device UUID: d3184c17208c9a5d65803da956b51387 ======================================================= [vertex] device-local=true: FPS: 14025 FrameTime: 0.071 ms [vertex] device-local=false: FPS: 5675 FrameTime: 0.176 ms [texture] anisotropy=0: FPS: 12628 FrameTime: 0.079 ms [texture] anisotropy=16: FPS: 12579 FrameTime: 0.079 ms [shading] shading=gouraud: FPS: 11828 FrameTime: 0.085 ms [shading] shading=blinn-phong-inf: FPS: 11852 FrameTime: 0.084 ms [shading] shading=phong: FPS: 11704 FrameTime: 0.085 ms [shading] shading=cel: FPS: 11977 FrameTime: 0.083 ms [effect2d] kernel=edge: FPS: 12339 FrameTime: 0.081 ms [effect2d] kernel=blur: FPS: 6740 FrameTime: 0.148 ms [desktop] <default>: FPS: 7619 FrameTime: 0.131 ms [cube] <default>: FPS: 15514 FrameTime: 0.064 ms [clear] <default>: FPS: 16170 FrameTime: 0.062 ms ======================================================= vkmark Score: 11588 =======================================================
I can tell that the results above are not using llvmpipe. The CPU usage is almost negligible, and forcing it to use llvmpipe (with a -D option to vkmark) results in much lower framerates and very high CPU usage.
I think I'm about 3/4s of the way done. The next step is going to be to test building the packages that can use Vulkan in the book (currently that is pipewire, gst10-plugins-bad, ffmpeg, qt5, qt6, and gtksourceview5). In addition I still need to finish testing on Intel and on my 32-bit system, and libplacebo and it's dependencies still need to be added to the book. VLC also needs to be fixed and tested to work with libplacebo. I will do all of this in my branch, which can be merged once I am done with it. I have been keeping it on-base with trunk to make it easier to merge. On the 32-bit system I primarily plan to test VLC and MPV, as well as run vkmark to get an idea of the results and the performance difference.
GNOME Terminal was recently ported to use Vulkan's codepath for GTK-4 by one of it's developers (https://x.com/hergertme/status/1730070318117699976?s=20). From the tweet:
Christian Hergert @hergertme@fosstodon.org @hergertme Got my 15 year old Thinkpad X300 out of storage. It's a 1200mhz Core 2 Duo w/ 4GB RAM and Intel 965GM graphics. The terminal work myself and others have done took a test case from 4 minutes to 2m21s. Over 40% reduction in running time even on ancient machines.
When it comes to VLC, Arch has a patch to make it build with libplacebo: https://gitlab.archlinux.org/archlinux/packaging/packages/vlc/-/blob/main/libplacebo-5.patch?ref_type=heads. I haven't tested that yet since I do not currently have libplacebo on my system, but will report back if that works.
For now I'm going to continue building out my 32-bit system, and tonight will also begin doing build tests on packages in the book which use Vulkan.
At this time I do not believe the AMD Vulkan driver is needed. The one from Mesa seems to do a good enough job, at least for my RX 460. Running 'lsof' seems to indicate that the Mesa drivers are being utilized.
comment:11 by , 15 months ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
MPV, libplacebo, and Vulkan have been added to the book at the following commits:
- sha:c10941270a Add the Vulkan-headers package to the book
- sha:b02d8501ee Vulkan Headers: don't hardcode the version
- sha:cb1ac77678 Add the Vulkan loader to the book
- sha:1a574e0f73 Add a note to the Vulkan Loader package to remind users to rebuild Mesa if it has been installed prior to installing this package
- sha:82d46cc6a1 Add the SPIRV-Headers package to the book
- sha:3ed1f2d304 Use a better URL for SPIRV-Headers
- sha:c46031c1d8 Add the SPIRV-Tools package to the book
- sha:f46dc8ea18 Change the URL for SPIRV-Headers again for consistency
- sha:1751778683 Add glslang to the book
- sha:e929885ea2 Update Mesa to build drivers for Vulkan
- sha:0b570f57b3 Add support for Vulkan to Pipewire
- sha:d88a080e1b gst-plugins-bad: change Vulkan to internal
- sha:e4524d7674 Document how to use Vulkan in GTK-4
- sha:bdfff0bbca Make the vulkan dependency internal in gtksourceview5
- sha:46cb389f52 Use the correct version for SPIRV-Tools
- sha:23c4cec1cc Add support for Vulkan to Qt5
- sha:990c920537 ffmpeg: add support for Vulkan
- sha:ee66136871 Add support for Vulkan to Qt6
- sha:664f94b633 Add Glad to the book.
- sha:79d741cc14 Add libplacebo to the book
- sha:b397566ed0 Disable using libplacebo in VLC
- sha:5f8ade3d6a Update to mpv-0.37.0
- sha:c82b1d4559 Add changelog entries for all of the additions
follow-up: 13 comment:12 by , 15 months ago
Hmm, why are we using a .rc1 for SPIRV-Tools? The latest stable release seems 2023.2.
comment:13 by , 15 months ago
Replying to Xi Ruoyao:
Hmm, why are we using a .rc1 for SPIRV-Tools? The latest stable release seems 2023.2.
<renodr> It's what is supposed to match 1.3.268.0 of SPIRV-Headers.
Release 0.37.0
This release requires FFmpeg 4.4 or newer and libplacebo 6.338.0 or newer.
This is the first release to unconditionally require libplacebo, but note that the new improved renderer (vo_gpu_next) is not yet the default.
Features
New
Changed
Removed
Options and Commands
Added
Changed
Deprecated
Removed
Fixes and Minor Enhancements
This listing is not complete. Check DOCS/client-api-changes.rst for a history of changes to the client API, and DOCS/interface-changes.rst for a history of changes to other user-visible interfaces.