Microsoft Edge not doing hardware video acceleration?

When looking up information about Microsoft Edge on Linux, it seems like hardware video acceleration should be working out of the box, but I’m having doubts about this being the case.
Here’s Firefox playing a 4K video after enabling VAAPI through about:config:


And here’s Edge doing the same thing - note the severely higher CPU usage:

Youtube served a VP9 video in both situations.

I’ve tried the following flags for Edge:
--use-gl=angle --use-angle=swiftshader make the situation much worse and cause the CPU usage to increase even further, nearly maxing out all cores and making the entire browser very slow.
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder --disable-features=UseChromeOSDirectVideoDecoder --use-gl=egl does not seem to change anything.
Using either combination seems to disable hardware acceleration completely, at least according to edge://gpu. Without any flags, “Video decode” shows up as “Hardware accelerated”, although “Video Acceleration Information” on the bottom of the page shows empty “Decoding” and “Encoding” rows.

The system is a laptop running dual graphics (Ryzen 5 4600H w/ Radeon Graphics and Nvidia Geforce GTX 1650), running the latest version of Manjaro KDE as of 2024-09-03 with the Nvidia proprietary driver installed.

Output of vdpauinfo seems to indicate VP9 is not supported, but shouldn’t this iGPU support it on the hardware level?

display: :0   screen: 0
API version: 1
Information string: G3DVL VDPAU Driver Shared Library version 1.0

Video surface:

name   width height types
-------------------------------------------
420    16384 16384  NV12 YV12 
422    16384 16384  UYVY YUYV 
444    16384 16384  Y8U8V8A8 V8U8Y8A8 
420_16 16384 16384  P010 P016 
422_16 16384 16384  
444_16 16384 16384  

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                    3 65536  4096  4096
MPEG2_MAIN                      3 65536  4096  4096
H264_BASELINE                  52 65536  4096  4096
H264_MAIN                      52 65536  4096  4096
H264_HIGH                      52 65536  4096  4096
VC1_SIMPLE                      1 65536  4096  4096
VC1_MAIN                        2 65536  4096  4096
VC1_ADVANCED                    4 65536  4096  4096
MPEG4_PART2_SP                  3 65536  4096  4096
MPEG4_PART2_ASP                 5 65536  4096  4096
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE       0 65536  4096  4096
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- not supported ---
VP9_PROFILE_0                  --- not supported ---
VP9_PROFILE_1                  --- not supported ---
VP9_PROFILE_2                  --- not supported ---
VP9_PROFILE_3                  --- not supported ---
HEVC_MAIN                      186 139264  8192  4352
HEVC_MAIN_10                   186 139264  8192  4352
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---
HEVC_MAIN_444_10               --- not supported ---
HEVC_MAIN_444_12               --- not supported ---
AV1_MAIN                       --- not supported ---
AV1_HIGH                       --- not supported ---
AV1_PROFESSIONAL               --- not supported ---

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8         16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 P010 P016 I8A8 
R8G8B8A8         16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 P010 P016 I8A8 
R10G10B10A2      16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 P010 P016 I8A8 
B10G10R10A2      16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 P010 P016 I8A8 

Bitmap surface:

name              width height
------------------------------
B8G8R8A8         16384 16384
R8G8B8A8         16384 16384
R10G10B10A2      16384 16384
B10G10R10A2      16384 16384
A8               16384 16384

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             y
DEINTERLACE_TEMPORAL_SPATIAL     -
INVERSE_TELECINE                 -
NOISE_REDUCTION                  y
SHARPNESS                        y
LUMA_KEY                         y
HIGH QUALITY SCALING - L1        y
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              y        48     4096
VIDEO_SURFACE_HEIGHT             y        48     4096
CHROMA_TYPE                      y  
LAYERS                           y         0        4

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 y  
CSC_MATRIX                       y  
NOISE_REDUCTION_LEVEL            y      0.00     1.00
SHARPNESS_LEVEL                  y     -1.00     1.00
LUMA_KEY_MIN_LUMA                y  
LUMA_KEY_MAX_LUMA                y  

Yet vainfo seems to be providing different information, what gives? Could that be the reason of Edge’s problems?

Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Mesa Gallium driver 24.1.6-arch1.1 for AMD Radeon Graphics (radeonsi, renoir, LLVM 18.1.8, DRM 3.57, 6.9.12-3-MANJARO)
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
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Funny, I was going to mention that the ryzen does not support AV1.
But it would appear that your Nvidia does.

I suppose the next question is … which is edge running on?
(its not both)

If you dont know … then its probably the iGPU.

We can ask for mhwd output;

mhwd -li -l

But even if you have the hybrid profile installed … it does not mean anything unless you launch whatever application with prime-run.

And a follow up may be enhanced-h264ify – Get this Extension for 🦊 Firefox (en-US)

Oh sorry, for chrom* its https://chromewebstore.google.com/detail/enhanced-h264ify/omkfmpieigblcllmkgbflkikinpkodlk

Which is what I use here to disable AV1 and VP8 (but keep VP9 enabled) thanks to my own zen3.

Depending on which gpu you are using with your browser … and I would probably think it should be the iGPU, you may wish to apply similar settings.

But thats just for the case of yt.

Still your :gpu output should show more.

But all of the chrom* browsers have consistently made hw-accel on linux a moving target.

The last time I had it working I was using flags like this:

--flag-switches-begin
--start-maximized
--force-dark-mode
--ignore-gpu-blocklist
--high-dpi-support=1
--enable-parallel-downloading
--enable-accelerated-video
--enable-accelerated-mjpeg-decode
--enable-gpu-rasterization
--enable-oop-rasterization
--enable-quic
--enable-zero-copy
--enable-drdc
--canvas-oop-rasterization
--ozone-platform-hint=wayland
--ozone-platform=wayland
--use-gl=angle
--enable-smooth-scrolling
--enable-accelerated-video-decode
--enable-native-gpu-memory-buffers
--enable-features=UseMultiPlaneFormatForHardwareVideo,VaapiIgnoreDriverChecks,VaapiVideoDecodeLinuxGL,WebUIDarkMode,MarkHttpAs,StrictOriginIsolation,VaapiVideoDecoder,VaapiVideoEncoder,VaapiVideo,CanvasOopRasterization,VaapiIgnoreDriverChecks,PlatformHEVCDecoderSupport
--disable-features=UseChromeOSDirectVideoDecoder,HardwareMediaKeyHandling,OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRef,OmniboxUIExperimentHideSteadyStateUrlScheme,OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains,ShowManagedUi
--flag-switches-end

But I believe those have changed again, if they work at all, which would depend on hardware.

(Hint: Last I checked only intels were able to get hw-accel on chrom*)

2 Likes

Thank you for the response.
I believe I do have hybrid graphics setup correctly, works with games at least. And my browsers are indeed running on the iGPU. Output of mwhd -li -l:

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-amd-nvidia-prime            2023.03.23               false            PCI
           video-linux            2024.05.06                true            PCI


Warning: No installed USB configs!
> 0000:01:00.0 (0300:10de:1f99) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-amd-nvidia-prime            2023.03.23               false            PCI
video-hybrid-amd-nvidia-470xx-prime            2023.03.23               false            PCI
          video-nvidia            2024.05.03               false            PCI
    video-nvidia-470xx            2023.03.23               false            PCI
           video-linux            2024.05.06                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:05:00.0 (0300:1002:1636) Display controller ATI Technologies Inc:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-amd-nvidia-prime            2023.03.23               false            PCI
video-hybrid-amd-nvidia-470xx-prime            2023.03.23               false            PCI
           video-linux            2024.05.06                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI

Edge doesn’t even start with the flags provided for me… I see the flags referring to Wayland, could that be it? Manjaro seems to have defaulted to X11 on my laptop, which from my brief research seems to be based on the fact that Nvidia’s proprietary drivers and Wayland don’t mesh well…?
After having a second look at the Arch wiki page about hardware video acceleration, I learned the nvtop tool can actually show decoder usage on any card and not just Nvidia, so I used this tool to verify for sure if Edge is not doing it. Sure enough, it does not, while Firefox does. I have tried to use the h264ify extension to see if any codec will be accelerated, but nope, none of them are.
I use Edge on PC and I wanted to use Edge on my laptop w/ Linux too for convenience of bookmark and history sync, but I think I’ll prioritize battery life here and I’ll just stick to Firefox on my laptop for now… If however there is anything else I can try, or once there are some news about Edge on Linux about this topic, I’d love to hear it.