Replies: 3 comments
-
Update on Vulkan support I suppose. I've been re-testing it on my main instances again over the last couple of days and am seeing the same instability on 6.6.0 that I was seeing on 6.5. Ah, seems the renderer crashes are an unrelated issue. So back to OpenGL for me, nothing to do with Vaapi I don't think, but I'll be testing VDAVideoDecoder instead. |
Beta Was this translation helpful? Give feedback.
-
Another update, this one regarding Qt6.7 beta (chrome 118 based). I can't figure out how to get hardware accelerate video decoding working with an OpenGL backend. I can get it working easy by enabling the Qt vulkan backend ( For AMD users that patch for chrome isn't being updated anymore and they recommend rebuilding mesa with a patch or two. frontends/va: Only export one handle for contiguous planes (!26165) · Merge requests · Mesa / mesa · GitLab and, if on chrome < 119, Draft: gbm: Allow GBM allocation of YUV surfaces (!23214) · Merge requests · Mesa / mesa · GitLab. With them (on 118 based) vulkan is working fine with no patches to chrome/webengine. I'll keep running with the vulkan backend for now, not 100% convinced in its robustness yet but no crashes in 3 days at least. |
Beta Was this translation helpful? Give feedback.
-
Thanks for this guide. Just wanted to provide a data point on VAAPI working:
The only real configuration was setting c.qt.workarounds.disable_accelerated_2d_canvas = 'never' but don't know if it's a workaround for this glitch or something else. It's a minor thing anyway. |
Beta Was this translation helpful? Give feedback.
-
Splitting this out from #5378
With Qt 6.6.0 WebEngine supports VA-API for hardware accelerated video decoding. This discussion is to gather resources and test notes to figure out in what situations it works.
Where can I test?
There are videos you can test with here: http://crosvideo.appspot.com/
How can I test?
chrome://media-internals/
kVideoDecoderName
. If it's using Vaapi I think the decoder should readVaapiVideoDecoder
(this screenshot is showing a configuration without Vaapi). In some cases you can get the slightly older GPU accelerated decoderVDAVideoDecoder
to show up tooYou can also use
intel_gpu_top
ornvtop
to monitor the GPU video decoding state, see https://wiki.archlinux.org/title/Hardware_video_acceleration#VerificationHow can I build Vaapi into Qt?
If you have the development files for libgbm and libva installed the Qt build system should autodetect that and enable Vaapi support. You should see a
VA-API support
entry underQt WebEngineCore
inconfig.summary
.What situations does Vaapi decoding work in?
enable-features=VaapiVideoDecoder
in qt.args (I don't think that is necessary though)ignore-gpu-blocklist
, that's mentioned in the chrome docs, which are a bit out of dateenable-features=VaapiVideoDecodeLinuxGL
in qt.args. Although I don't think this is a supported configurationdisable-features=UseChromeOSDirectVideoDecoder
in qt.args. This switches away from the Vaapi decoder to the slightly older VDAVideoDecoder which also seems to use hardware acceleration!QT_XCB_GL_INTEGRATION=xcb_egl
QSG_RHI_BACKEND=vulkan
enable-features=VaapiIgnoreDriverChecks
. This isn't a supported configuration (but seems to work with a patch)The various platform restrictions are in here: https://github.com/qt/qtwebengine-chromium/blob/a71ba6ffc8e34033b93c0727e8d7eb17f7d6a25f/chromium/media/mojo/services/gpu_mojo_media_client_cros.cc#L96
Although I'm not seeing anything about EGL or GLES in there, so I'm not sure where that comes into it.
There is a bug report here about Vaapi support on Linux in general: https://bugs.chromium.org/p/chromium/issues/detail?id=1236697#c102
Comment 102 seems to have a patch way to get it working on non-intel graphics!
The only slightly out of date Chrome docs on Vaapi are here: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/vaapi.md
There are various switches which may or may not be useful here: https://github.com/qt/qtwebengine-chromium/blob/a71ba6ffc8e34033b93c0727e8d7eb17f7d6a25f/chromium/ui/gl/gl_switches.cc
Long arch thread about Vaapi and Chrome here: https://bbs.archlinux.org/viewtopic.php?id=244031&p=35
What ubuntu is shipping: https://discourse.ubuntu.com/t/an-overview-of-hardware-acceleration-in-chromium/36672
More things to test:
ignore-gpu-blocklist, enable-accelerated-video-decode, enable-features=VaapiVideoDecoder, enable-features=VaapiVideoDecodeLinuxGL, enable-features=VaapiIgnoreDriverChecks
export QSG_RHI_BACKEND=vulkan
)export QT_XCB_GL_INTEGRATION=xcb_egl
)GL_VERSION
inchrome://gpu
)k_comment_id=4718214#gistcomment-4718214) is to compile mesa with patches
disable-features=UseChromeOSDirectVideoDecoder
into qt.args get you hardware acceleration via theVDAVideoDecoder
decoder when not using vulkan?xcb_egl
GL_VERSION
inchrome://gpu
. Without it I'm seeing "4.6 ..." and with it I'm seeing "OpenGL ES 3.2 ..."Recommended config so far:
TODO: turn this into a config.py snippet? Not sure if we can change qt.args in config.py.
Beta Was this translation helpful? Give feedback.
All reactions