You are not logged in.

#901 2023-10-04 12:32:16

dandownapp
Member
Registered: 2020-12-27
Posts: 2

Re: chromium: hardware video acceleration with VA-API

kolana wrote:
dandownapp wrote:

Is there a way to enable acceleration on older than Broadwell Intel GPUs?

As far as I understand, they disabled VDAVideoDecoder, which worked with the libva-intel-driver package and left VaapiVideoDecoder, which works with the intel-media-driver one. Is this correct?

hello, i have Intel i965 driver for Intel(R) Broadwell - 2.4.1. vaapi no longer works for me, is that the problem ?

You should try switching from the libva-intel-driver (i965) to the intel-media-driver (iHD) package.

https://wiki.archlinux.org/title/Hardwa … ing_VA-API

Offline

#902 2023-10-04 13:33:55

kolana
Member
Registered: 2021-02-12
Posts: 76

Re: chromium: hardware video acceleration with VA-API

dandownapp wrote:
kolana wrote:
dandownapp wrote:

Is there a way to enable acceleration on older than Broadwell Intel GPUs?

As far as I understand, they disabled VDAVideoDecoder, which worked with the libva-intel-driver package and left VaapiVideoDecoder, which works with the intel-media-driver one. Is this correct?

hello, i have Intel i965 driver for Intel(R) Broadwell - 2.4.1. vaapi no longer works for me, is that the problem ?

You should try switching from the libva-intel-driver (i965) to the intel-media-driver (iHD) package.

https://wiki.archlinux.org/title/Hardwa … ing_VA-API

not work too...

Offline

#903 2023-10-04 15:21:38

bwidlar
Member
Registered: 2018-02-06
Posts: 29

Re: chromium: hardware video acceleration with VA-API

Maybe your problem is here

mine:

vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.3.3 ()

yours:

vainfo: Driver version: Intel i965 driver for Intel(R) Broadwell - 2.4.1

my packages:

extra/libva 2.20.0-1 [installed]
extra/libva-utils 2.20.0-1 [installed]
extra/intel-media-driver 23.3.3-1 [installed]

Offline

#904 2023-10-05 20:42:39

digitalone
Member
Registered: 2011-08-19
Posts: 350

Re: chromium: hardware video acceleration with VA-API

--enable-features=VaapiVideoDecodeLinuxGL does not work on AMDGPU.

Offline

#905 2023-10-09 00:02:17

hmann
Member
Registered: 2023-10-08
Posts: 3

Re: chromium: hardware video acceleration with VA-API

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214). It only works with Vulkan so these flags need to be set:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport

Building mesa-git with the patches can be done like this:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23214.patch" | git am
curl -L "https://github.com/hannesmann/mesa/commit/c3a318016df57858eec2ff54828e01f9bd43744a.patch" | git am
# Optional, this is a workaround for the blocky filtering on videos
curl -L "https://github.com/hannesmann/mesa/commit/99f5bf72000de3ed49bd3f8acdac1bd162361986.patch" | git am

# Build and install package
cd ../..
makepkg -sei

I've tested it with an RX 6700 XT and Ryzen 5 5500U. If it causes any problems in other applications, let me know.

EDIT: See https://bbs.archlinux.org/viewtopic.php … 4#p2133444

Last edited by hmann (2023-11-24 17:48:28)

Offline

#906 2023-10-09 12:53:33

nfrenay
Member
Registered: 2023-09-13
Posts: 1

Re: chromium: hardware video acceleration with VA-API

hmann wrote:

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214).

Just installed these patches, and I can confirm I have hw video decode on 6850U (Radeon 680M).

Chrome logs are a little mad throwing this error many times per second, but it looks like it's working:

ERROR:vulkan_swap_chain.cc(409)] Swapchain is suboptimal.

Thanks for sending these patches!

Offline

#907 2023-10-09 19:18:57

hmann
Member
Registered: 2023-10-08
Posts: 3

Re: chromium: hardware video acceleration with VA-API

nfrenay wrote:

Just installed these patches, and I can confirm I have hw video decode on 6850U (Radeon 680M).

Good to know it's working! I updated the second patch so that it only applies linear filtering to video textures. It should now be safe to apply without breaking CSS image-rendering or WebGL.

nfrenay wrote:

Chrome logs are a little mad throwing this error many times per second, but it looks like it's working:

ERROR:vulkan_swap_chain.cc(409)] Swapchain is suboptimal.

Yeah, that shows up when you use Vulkan even without any patches. It goes away after the window is resized.

Offline

#908 2023-10-12 09:35:02

dezogojo
Member
Registered: 2023-10-12
Posts: 2

Re: chromium: hardware video acceleration with VA-API

hmann wrote:

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214). It only works with Vulkan so these flags need to be set:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport

Building mesa-git with the patches can be done like this:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23214.patch" | git am
curl -L "https://github.com/hannesmann/mesa/commit/c3a318016df57858eec2ff54828e01f9bd43744a.patch" | git am
# Optional, this is a workaround for the blocky filtering on videos
curl -L "https://github.com/hannesmann/mesa/commit/99f5bf72000de3ed49bd3f8acdac1bd162361986.patch" | git am

# Build and install package
cd ../..
makepkg -sei

I've tested it with an RX 6700 XT and Ryzen 5 5500U. If it causes any problems in other applications, let me know.

I can confirm , after installing the patch HW video decode works (Radeon 680M) on Brave and Chromium, but i observed some randomy lags during the video playback on youtube.
And i have this errors in browser logs :

 ERROR:gl_utils.cc(402)] : [.RendererMainThread-0x320000333f00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)
ERROR:shared_image_manager.cc(220)] : SharedImageManager::ProduceSkia: Trying to Produce a Skia representation from a non-existent mailbox

Offline

#909 2023-10-12 09:37:24

246tnt
Member
Registered: 2023-07-26
Posts: 9

Re: chromium: hardware video acceleration with VA-API

I wonder if with this patch the intel decoder also works with Vulkan ? Anyone tried ?
(I mean the one about GBM not the radeonsi one).

Offline

#910 2023-10-12 17:01:12

Adiker
Member
Registered: 2023-10-12
Posts: 1

Re: chromium: hardware video acceleration with VA-API

hmann wrote:

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214). It only works with Vulkan so these flags need to be set:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport

Building mesa-git with the patches can be done like this:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23214.patch" | git am
curl -L "https://github.com/hannesmann/mesa/commit/c3a318016df57858eec2ff54828e01f9bd43744a.patch" | git am
# Optional, this is a workaround for the blocky filtering on videos
curl -L "https://github.com/hannesmann/mesa/commit/99f5bf72000de3ed49bd3f8acdac1bd162361986.patch" | git am

# Build and install package
cd ../..
makepkg -sei

Thank you so much for this ! Applied all the patches and flags, VA-API finally works for me on Chrome. Didn't encounter any bugs, but will report if any shows up. My specs: Ryzen 7 5700X with RX 5700 XT.

Offline

#911 2023-10-13 00:17:34

coolbooks2
Member
Registered: 2009-02-12
Posts: 19

Re: chromium: hardware video acceleration with VA-API

hmann wrote:

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214). It only works with Vulkan so these flags need to be set:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport

Building mesa-git with the patches can be done like this:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23214.patch" | git am
curl -L "https://github.com/hannesmann/mesa/commit/c3a318016df57858eec2ff54828e01f9bd43744a.patch" | git am
# Optional, this is a workaround for the blocky filtering on videos
curl -L "https://github.com/hannesmann/mesa/commit/99f5bf72000de3ed49bd3f8acdac1bd162361986.patch" | git am

# Build and install package
cd ../..
makepkg -sei

I've tested it with an RX 6700 XT and Ryzen 5 5500U. If it causes any problems in other applications, let me know.

Thanks so much Hmann.  It works great on my desktop with an RX 6700XT but it fails to work on my Radeon RX 580 system.  I get this error below. 

00:00:00.864    info    "Selected VaapiVideoDecoder for video decoding, config: codec: h264, profile: h264 high, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
00:00:00.864    pipeline_state    "kPlaying"
00:00:00.910    error    "VideoDecoderPipeline Frame converter returns null frame."
00:00:00.910    error    "VideoDecoderPipeline Frame converter returns null frame."
00:00:00.912    warning    "video decoder fallback after initial decode error."
00:00:00.912    error    "VideoDecoderPipeline Frame converter returns null frame."
00:00:00.912    info    "Cannot select VpxVideoDecoder for video decoding"
00:00:00.912    info    "Cannot select Dav1dVideoDecoder for video decoding"
00:00:00.913    error    "VideoDecoderPipeline Frame converter returns null frame."
00:00:00.915    error    "VideoDecoderPipeline Frame converter returns null frame."

Then it falls back to software decoding.

My vainfo for the RX 580 is:
Trying display: wayland
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Mesa Gallium driver 23.3.0-devel for AMD Radeon RX 580 2048SP (polaris10, LLVM 16.0.6, DRM 3.54, 6.5.7-arch1-1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSlice
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSlice
      VAProfileHEVCMain               :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointEncSlice
      VAProfileHEVCMain10             :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointVLD
      VAProfileNone                   :    VAEntrypointVideoProc

It has the correct profile so it should be playing so I don't know what the issue is.

Last edited by coolbooks2 (2023-10-13 01:25:55)

Offline

#912 2023-10-14 00:23:20

MacTavishAO
Member
Registered: 2022-12-29
Posts: 11

Re: chromium: hardware video acceleration with VA-API

hmann wrote:

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214). It only works with Vulkan so these flags need to be set:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport

Building mesa-git with the patches can be done like this:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23214.patch" | git am
curl -L "https://github.com/hannesmann/mesa/commit/c3a318016df57858eec2ff54828e01f9bd43744a.patch" | git am
# Optional, this is a workaround for the blocky filtering on videos
curl -L "https://github.com/hannesmann/mesa/commit/99f5bf72000de3ed49bd3f8acdac1bd162361986.patch" | git am

# Build and install package
cd ../..
makepkg -sei

I've tested it with an RX 6700 XT and Ryzen 5 5500U. If it causes any problems in other applications, let me know.

Tested with RX 6800 and 5700X (I don't think CPU matters). I can confirm it works. Thanks!

Offline

#913 2023-10-14 05:21:19

bluestang
Member
Registered: 2023-01-20
Posts: 7

Re: chromium: hardware video acceleration with VA-API

hmann wrote:

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214). It only works with Vulkan so these flags need to be set:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport

Building mesa-git with the patches can be done like this:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23214.patch" | git am
curl -L "https://github.com/hannesmann/mesa/commit/c3a318016df57858eec2ff54828e01f9bd43744a.patch" | git am
# Optional, this is a workaround for the blocky filtering on videos
curl -L "https://github.com/hannesmann/mesa/commit/99f5bf72000de3ed49bd3f8acdac1bd162361986.patch" | git am

# Build and install package
cd ../..
makepkg -sei

I've tested it with an RX 6700 XT and Ryzen 5 5500U. If it causes any problems in other applications, let me know.

It doesn't work on my 6800XT here:

Error msg as follows:

00:00:00.350	info	"Cannot select DecryptingVideoDecoder for video decoding"
00:00:00.350	seek_target	120
00:00:00.359	info	"VideoDecoderPipeline |decoder_| Initialize() successful"
00:00:00.359	kIsVideoDecryptingDemuxerStream	false
00:00:00.359	kVideoDecoderName	"VaapiVideoDecoder"
00:00:00.359	kIsPlatformVideoDecoder	true
00:00:00.359	info	"Selected VaapiVideoDecoder for video decoding, config: codec: vp9, profile: vp9 profile0, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
00:00:00.359	pipeline_state	"kPlaying"
00:00:00.359	pipeline_state	"kSeeking"
00:00:00.952	pipeline_state	"kPlaying"
00:00:00.960	error	"VideoDecoderPipeline Frame converter returns null frame."
00:00:00.960	error	"VideoDecoderPipeline Frame converter returns null frame."
00:00:00.962	warning	"video decoder fallback after initial decode error."
00:00:00.962	error	"VideoDecoderPipeline Frame converter returns null frame."
00:00:00.962	error	"VideoDecoderPipeline Frame converter returns null frame."
00:00:00.963	kIsVideoDecryptingDemuxerStream	false
00:00:00.963	kVideoDecoderName	"VpxVideoDecoder"
00:00:00.963	kIsPlatformVideoDecoder	false
00:00:00.963	info	"Selected VpxVideoDecoder for video decoding, config: codec: vp9, profile: vp9 profile0, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
00:00:00.082	duration	324.621
00:00:00.976	audio_buffering_state	{"state":"BUFFERING_HAVE_ENOUGH"}
00:00:01.201	dimensions	"1920x1080"
00:00:01.201	kResolution	"1920x1080"
00:00:01.204	pipeline_buffering_state	{"for_suspended_start":false,"state":"BUFFERING_HAVE_ENOUGH"}

Offline

#914 2023-10-15 10:34:36

MK73DS
Member
Registered: 2023-05-06
Posts: 8

Re: chromium: hardware video acceleration with VA-API

hmann wrote:

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214). It only works with Vulkan so these flags need to be set:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport

Building mesa-git with the patches can be done like this:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23214.patch" | git am
curl -L "https://github.com/hannesmann/mesa/commit/c3a318016df57858eec2ff54828e01f9bd43744a.patch" | git am
# Optional, this is a workaround for the blocky filtering on videos
curl -L "https://github.com/hannesmann/mesa/commit/99f5bf72000de3ed49bd3f8acdac1bd162361986.patch" | git am

# Build and install package
cd ../..
makepkg -sei

I've tested it with an RX 6700 XT and Ryzen 5 5500U. If it causes any problems in other applications, let me know.

I can confirm this works on a 680M (Ryzen 7 6800HS). It's a pita to manually compile mesa each time a new version will come out but at least it works. I hope chromium will get fixed soon although I'm losing hope...

Last edited by MK73DS (2023-10-16 09:31:09)

Offline

#915 2023-10-18 00:16:10

4internetanonymity
Member
Registered: 2009-07-09
Posts: 56

Re: chromium: hardware video acceleration with VA-API

nowy wrote:

On chrome 115.0.5790.110 with 12th gen intel:

vaapi is working with just this flag

--enable-features=VaapiVideoDecodeLinuxGL

I tested it on youtube with vp9 and av1 video.

Wow thanks - this is the only place I found this info, also using a 12th gen intel iGPU... Videos now show as "FFmpegVideoDecoder" in media-internals, which most places claim means software decoding is still being used... However, now intel_gpu_top shows 90+ GPU usage and CPU usage is way lower. So it seems like success!

For banging their heads in a search engine:
flatpak, intel, iGPU, 12th generation, chromium, acceleration, VpxVideoDecoder, iHD_drv_video.so, cpu usage,

Last edited by 4internetanonymity (2023-10-18 00:38:51)

Offline

#916 2023-10-19 15:06:01

matt3us
Member
Registered: 2023-10-19
Posts: 2

Re: chromium: hardware video acceleration with VA-API

https://chromium-review.googlesource.co … /+/4938496

Already merged to main. Hopefully this will land in 119 to make VAAPI actually work natively on Wayland.

edit: landed in 120.0.6066.0. need to wait a bit longer smile

Last edited by matt3us (2023-10-24 06:42:38)

Offline

#917 2023-10-24 22:22:23

nado
Member
Registered: 2023-10-24
Posts: 1

Re: chromium: hardware video acceleration with VA-API

hmann wrote:

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214). It only works with Vulkan so these flags need to be set:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport

Building mesa-git with the patches can be done like this:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23214.patch" | git am
curl -L "https://github.com/hannesmann/mesa/commit/c3a318016df57858eec2ff54828e01f9bd43744a.patch" | git am
# Optional, this is a workaround for the blocky filtering on videos
curl -L "https://github.com/hannesmann/mesa/commit/99f5bf72000de3ed49bd3f8acdac1bd162361986.patch" | git am

# Build and install package
cd ../..
makepkg -sei

I've tested it with an RX 6700 XT and Ryzen 5 5500U. If it causes any problems in other applications, let me know.


Hi, thank you for the patch.

I tried it on my 4600H (discrete gpu) on youtube with VP9 codec and now i can use "VaapiVideoDecoder" as intended.
But on Geforce Now (game streaming service https://wiki.archlinux.org/title/GeForce_Now ) now I get blocky filtering issues like "VSync-ish", even if i install your optional patch.

Offline

#918 2023-10-26 18:02:48

rudarg
Member
Registered: 2023-10-26
Posts: 1

Re: chromium: hardware video acceleration with VA-API

Has anyone had any luck with Intel ARC GPUs (a770)?

I'm using xorg:

vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.3.5 ()

I've tried a lot of AUR packages, with most of the command line flags offered in this thread. Hilariously, and as a few people have observed here, the chrome://gpu 'report' often claims hardware video decoding is enabled except that it is not according to chrome://media-internals/ or intel_gpu_top.

Note: IIRC this soft of worked (on both wayland / xorg) on this same hardware sometime around chromium 114 (although I am not sure when this broke exactly). Thought, I had at the time to use --use-gl=egl and decoding had all sorts of bugs. In recent releases, this flag now leads to these splendid error messages:

[38818:38818:1026/105920.155004:FATAL:gpu_init.cc(500)] Passthrough is not supported, GL is egl, ANGLE is 
[38782:38782:1026/105920.225563:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=133

Note 2.0: works perfectly in firefox.

Offline

#919 2023-10-29 13:45:31

xPrzybyLx
Member
From: Poland
Registered: 2015-09-30
Posts: 20

Re: chromium: hardware video acceleration with VA-API

I am using

6.4.3160.34 (Stable channel) stable (64-bit) 

chrome://gpu page shows

Video Acceleration Information
==============================
Decoding                      : 
Decode h264 baseline          : 64x64 to 4096x4096 pixels
Decode h264 main              : 64x64 to 4096x4096 pixels
Decode h264 high              : 64x64 to 4096x4096 pixels
Decode vp9 profile0           : 64x64 to 8192x4352 pixels
Decode vp9 profile2           : 64x64 to 8192x4352 pixels
Decode hevc main              : 64x64 to 8192x4352 pixels
Decode hevc main 10           : 64x64 to 8192x4352 pixels
Decode hevc main still-picture: 64x64 to 8192x4352 pixels
Decode av1 profile main       : 64x64 to 8192x4352 pixels
Encoding                      : 
Encode h264 baseline          : 321x241 to 4096x2304 pixels, and/or 30.000 fps.
Encode h264 main              : 321x241 to 4096x2304 pixels, and/or 30.000 fps.
Encode h264 high              : 321x241 to 4096x2304 pixels, and/or 30.000 fps.
Encode av1 profile main       : 321x241 to 8192x4352 pixels, and/or 30.000 fps.

But when I go on Youtube no video is actually hardware accelerated...

mpv video acceleration works fine.

$ vainfo                    
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Mesa Gallium driver 23.2.1-arch1.2 for AMD Radeon RX 7900 XTX (gfx1100, LLVM 16.0.6, DRM 3.54, 6.5.9-zen2-1-zen)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointEncSlice
      VAProfileNone                   :	VAEntrypointVideoProc

My vivaldi logs have a bunch of errors:

Log Messages
============
[1742:1742:1029/131039.632731:WARNING:sandbox_linux.cc(393)] : InitializeSandbox() called with multiple threads in process gpu-process.
[1742:2728:1029/131125.391805:ERROR:vaapi_video_decoder.cc(1245)] : failed Initialize()ing the frame pool
[1742:2737:1029/131128.459179:ERROR:vaapi_video_decoder.cc(1245)] : failed Initialize()ing the frame pool

What is going on and why it suddenly stops working?

Where can I post a bug report about this?

Last edited by xPrzybyLx (2023-10-29 13:46:21)


Newbie

Offline

#920 2023-11-01 10:02:53

gilvbp
Member
Registered: 2022-10-05
Posts: 9

Re: chromium: hardware video acceleration with VA-API

Finally, working natively on Nvidia:

**Good news! Luckily, while setting up a new laptop with a recent enough Nvidia GPU, I was able to repro this reliably and could confirm that:

There is a bug in the Nvidia proprietary driver, as initially pointed out by reporters of issue 1463851. It prevents from getting a bo's plane fd after having destroyed a corresponding imported bo for it.
For some reason, bisect didn't help, but the chromium change that unveiled the bug was https://crrev.com/1124657, which added the BO creation/import loop to verify modifiers support. That'd explain the recent regression reports here.
The best workarounds I could come up with are:

https://chromium-review.googlesource.co … /+/4989782
https://chromium-review.googlesource.co … /+/4989962
I've tested both, but I would appreciate it if others experiencing this could try as well. Hopefully, reviewers will point out the best approach, and it will land soon.**

And I did the following instructions:

https://github.com/elFarto/nvidia-vaapi … 1789655783

gilvbp wrote:

I Uploaded the last working Wayland nvidia version here (https://www.dropbox.com/scl/fi/6x65jhgd … pk631&dl=0)

please use this version!

PS: Here are the old diffs https://aur.archlinux.org/cgit/aur.git/ … land-vaapi (you should use 111.0.5563.146-1 source files)


OpinionatedLinuxNerd wrote:
gilvbp wrote:

Log shows this:

Failed to export buffer to dma_buf: No such file or directory (2) 


Anyone?

UPDATE: It was a regression chromium bug, already addressed: https://bugs.chromium.org/p/chromium/is … 273758#c11

Just to share my recent experiences with this on Wayland+nvidia, this absolutely would not work with any build of chromium except chromium-wayland-vaapi.

The regression bug listed is still open and has only been triaged on Jun 30th with radio silence from the dev assigned to the bug report. I suggest anyone facing issues with Wayland + nvidia to star bug report.

https://bugs.chromium.org/p/chromium/is … 273758#c11

Last edited by gilvbp (2023-11-01 21:49:02)

Offline

#921 2023-11-01 23:38:35

benvosper
Member
Registered: 2019-01-28
Posts: 9

Re: chromium: hardware video acceleration with VA-API

Confirming that:

--enable-features=VaapiVideoDecodeLinuxGL

is all that's needed when running in Xwayland with Intel drivers on Chromium 119.

But this seems to have no effect when running in wayland with:

 --ozone-platform-hint=auto

Does anyone know if we can get the acceleration working on wayland somehow?

Otherwise, the patch coming in 120 mentioned above looks interesting!

matt3us wrote:

https://chromium-review.googlesource.co … /+/4938496

Already merged to main. Hopefully this will land in 119 to make VAAPI actually work natively on Wayland.

edit: landed in 120.0.6066.0. need to wait a bit longer smile

Last edited by benvosper (2023-11-01 23:38:56)

Offline

#922 2023-11-04 10:56:28

MK73DS
Member
Registered: 2023-05-06
Posts: 8

Re: chromium: hardware video acceleration with VA-API

xPrzybyLx wrote:

I am using

6.4.3160.34 (Stable channel) stable (64-bit) 

chrome://gpu page shows

Video Acceleration Information
==============================
Decoding                      : 
Decode h264 baseline          : 64x64 to 4096x4096 pixels
Decode h264 main              : 64x64 to 4096x4096 pixels
Decode h264 high              : 64x64 to 4096x4096 pixels
Decode vp9 profile0           : 64x64 to 8192x4352 pixels
Decode vp9 profile2           : 64x64 to 8192x4352 pixels
Decode hevc main              : 64x64 to 8192x4352 pixels
Decode hevc main 10           : 64x64 to 8192x4352 pixels
Decode hevc main still-picture: 64x64 to 8192x4352 pixels
Decode av1 profile main       : 64x64 to 8192x4352 pixels
Encoding                      : 
Encode h264 baseline          : 321x241 to 4096x2304 pixels, and/or 30.000 fps.
Encode h264 main              : 321x241 to 4096x2304 pixels, and/or 30.000 fps.
Encode h264 high              : 321x241 to 4096x2304 pixels, and/or 30.000 fps.
Encode av1 profile main       : 321x241 to 8192x4352 pixels, and/or 30.000 fps.

But when I go on Youtube no video is actually hardware accelerated...

mpv video acceleration works fine.

$ vainfo                    
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Mesa Gallium driver 23.2.1-arch1.2 for AMD Radeon RX 7900 XTX (gfx1100, LLVM 16.0.6, DRM 3.54, 6.5.9-zen2-1-zen)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointEncSlice
      VAProfileNone                   :	VAEntrypointVideoProc

My vivaldi logs have a bunch of errors:

Log Messages
============
[1742:1742:1029/131039.632731:WARNING:sandbox_linux.cc(393)] : InitializeSandbox() called with multiple threads in process gpu-process.
[1742:2728:1029/131125.391805:ERROR:vaapi_video_decoder.cc(1245)] : failed Initialize()ing the frame pool
[1742:2737:1029/131128.459179:ERROR:vaapi_video_decoder.cc(1245)] : failed Initialize()ing the frame pool

What is going on and why it suddenly stops working?

Where can I post a bug report about this?

See these posts for more information about what's going on:

Offline

#923 2023-11-16 23:03:56

4internetanonymity
Member
Registered: 2009-07-09
Posts: 56

Re: chromium: hardware video acceleration with VA-API

4internetanonymity wrote:
nowy wrote:

On chrome 115.0.5790.110 with 12th gen intel:

vaapi is working with just this flag

--enable-features=VaapiVideoDecodeLinuxGL

I tested it on youtube with vp9 and av1 video.

Wow thanks - this is the only place I found this info, also using a 12th gen intel iGPU... Videos now show as "FFmpegVideoDecoder" in media-internals, which most places claim means software decoding is still being used... However, now intel_gpu_top shows 90+ GPU usage and CPU usage is way lower. So it seems like success!

For banging their heads in a search engine:
flatpak, intel, iGPU, 12th generation, chromium, acceleration, VpxVideoDecoder, iHD_drv_video.so, cpu usage,

Disregard my answer; I still don't understand this. The above did result in the correct decoder being used as show in chromium's media-internals. However, I just couldn't handle how many frames were being dropped in videos within any website in chromium. So, I removed all flags, about:gpu still claims decode is accelerated, but of course all YT videos on media-internals claim "VpxVideoDecoder" is being used to decode them. This supposedly means no GPU accelerated video decoding is working. This is ridiculously tedious to debug due to inconsistent and bad information across the web. Whether or not the decoder shows vaapi or "VpxVideoDecoder" in media-internals, intel_gpu_top shows 90%+ usage in "render/3d" while a video is playing! The only difference is I don't get loads of stuttering and frame dropping with "VpxVideoDecoder" (whatever that is).

Offline

#924 2023-11-24 15:00:21

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: chromium: hardware video acceleration with VA-API

hmann wrote:

I've created a patch for Mesa that enables the new VA-API decoder to work on AMD (more info here: https://gist.github.com/thubble/235806c … nt-4718214). It only works with Vulkan so these flags need to be set:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport

Building mesa-git with the patches can be done like this:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23214.patch" | git am
curl -L "https://github.com/hannesmann/mesa/commit/c3a318016df57858eec2ff54828e01f9bd43744a.patch" | git am
# Optional, this is a workaround for the blocky filtering on videos
curl -L "https://github.com/hannesmann/mesa/commit/99f5bf72000de3ed49bd3f8acdac1bd162361986.patch" | git am

# Build and install package
cd ../..
makepkg -sei

I've tested it with an RX 6700 XT and Ryzen 5 5500U. If it causes any problems in other applications, let me know.

This looked very promising, but the second patch fails to apply...

Applying: frontends/va: Export one descriptor for contiguous planes
.git/rebase-apply/patch:31: trailing whitespace.
      /* If the driver stores all planes in the same buffer, only one descriptor 
.git/rebase-apply/patch:32: trailing whitespace.
       * needs to be exported. resource_get_info is used to obtain pitch and 
error: patch failed: src/gallium/frontends/va/surface.c:1628
error: src/gallium/frontends/va/surface.c: patch does not apply
Patch failed at 0001 frontends/va: Export one descriptor for contiguous planes

[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#925 2023-11-24 17:46:48

hmann
Member
Registered: 2023-10-08
Posts: 3

Re: chromium: hardware video acceleration with VA-API

Soukyuu wrote:

This looked very promising, but the second patch fails to apply...

Applying: frontends/va: Export one descriptor for contiguous planes
.git/rebase-apply/patch:31: trailing whitespace.
      /* If the driver stores all planes in the same buffer, only one descriptor 
.git/rebase-apply/patch:32: trailing whitespace.
       * needs to be exported. resource_get_info is used to obtain pitch and 
error: patch failed: src/gallium/frontends/va/surface.c:1628
error: src/gallium/frontends/va/surface.c: patch does not apply
Patch failed at 0001 frontends/va: Export one descriptor for contiguous planes

Yes, sorry, that patch is outdated. I submitted a merge request to Mesa: https://gitlab.freedesktop.org/mesa/mes … ests/26165

Hopefully it will be merged soon but until then you can apply it manually:

# Download mesa-git PKGBUILD
curl "https://aur.archlinux.org/cgit/aur.git/snapshot/mesa-git.tar.gz" -o mesa-git.tar.gz
tar -xvf mesa-git.tar.gz
cd mesa-git

# Extract and patch sources
makepkg -so
cd src/mesa
curl -L "https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26165.patch" | git am

# Build and install package
cd ../..
makepkg -sei

You don't need any other patches for Chromium 119. These flags are all you need for hardware video decoding:

--use-gl=angle
--use-angle=vulkan
--enable-accelerated-video-decode
--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport,UseMultiPlaneFormatForHardwareVideo

Offline

Board footer

Powered by FluxBB