brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.94k stars 2.35k forks source link

[linux] Brave not using vaapi for hardware rendering #41993

Open solomoncyj opened 3 weeks ago

solomoncyj commented 3 weeks ago

Description

Hi, when i activated hardware acclerated decoding on Fedora 41, i noticed my gpu was not being used to render youtube videos. I am using vaapi with a intel mesa 4400 gpu driver. it works perfectly fine on firefox tho

Steps to reproduce

  1. ensure hardware decodeing is enabled in settings
  2. watch a avc1 video in youtube
  3. check gpu engine usage

Actual result

video decoding engine is at 0%

Expected result

gpu decoding engine shows usage

Reproduces how often

Easily reproduced

Brave version (brave://version info)

1.71.118 Chromium: 130.0.6723.70 (Official Build) (64-bit) d29310b051bde8ba041cd7b4edcb41ce951be12c Linux Command Line:

    /opt/brave.com/brave/brave
 --disable-domain-reliability 
--enable-dom-distiller 
--enable-distillability-service 
--origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld9Mw3E=,fMS4mpO6buLQ/QMd+zJmxzty/VQ6B1EUZqoCU04zoRU= 
--lso-url=https://no-thanks.invalid 
--sync-url=https://sync-v2.brave.com/v2 
--variations-server-url=https://variations.brave.com/seed 
--variations-insecure-server-url=https://variations.brave.com/seed 
--flag-switches-begin 
--cast-streaming-force-enable-hardware-h264
 --cast-streaming-force-enable-hardware-vp8
 --cast-streaming-force-enable-hardware-vp9 
--ozone-platform-hint=auto 
--enable-features=GlobalVaapiLock,ParallelDownloading,ScrollableTabStrip 
--flag-switches-end 
--ozone-platform=wayland 
--component-updater=url-source=https://go-updater.brave.com/extensions

Channel information

Reproducibility

Miscellaneous information

No response

ObsidianMaximus commented 2 weeks ago

Facing similar issue.

Have an AMD gpu and Intel gpu. Hardware acceleration is on in settings.

Still youtube videos can't use it. Tried all formats, avc, av1, vp9, it just doesn't work.

Confirmed using mission center, video decoding stays at 0%.

BUT, if I use firefox on the AMD system, it works after I enable either media.hardware-video-decoding.force-enabled or media.ffmpeg.vaapi.enabled . And in case of the Intel one, it works even without these flags.

So the issue is in brave only.

Please fix it, or atleast tell the flags to properly get it working.

Tested on X11, not sure about wayland.

CodeDead commented 1 week ago

Same problem on Fedora 41 + Wayland + KDE. I use an AMD RX 7900 XT and I have to start brave-browser with the following command to get it to work:

brave-browser --enable-features=AcceleratedVideoDecodeLinuxZeroCopyGL,AcceleratedVideoDecodeLinuxGL,VaapiIgnoreDriverChecks --ozone-platform-hint=auto %U

(With brave browser Version 1.73.89 Chromium: 131.0.6778.69 (Official Build) (64-bit) ) See: https://issues.chromium.org/issues/40225939

Firefox, as usual, just works.

ObsidianMaximus commented 1 week ago

Same problem on Fedora 41 + Wayland + KDE. I use an AMD RX 7900 XT and I have to start brave-browser with the following command to get it to work:

brave-browser --enable-features=AcceleratedVideoDecodeLinuxZeroCopyGL,AcceleratedVideoDecodeLinuxGL,VaapiIgnoreDriverChecks --ozone-platform-hint=auto %U

(With brave browser Version 1.73.89 Chromium: 131.0.6778.69 (Official Build) (64-bit) ) See: https://issues.chromium.org/issues/40225939

Firefox, as usual, just works.

Hello and thank you!

I followed the issue you linked and this flag worked for intel gpu on fedora gnome under wayland:

brave-browser --enable-features=AcceleratedVideoDecodeLinuxZeroCopyGL,AcceleratedVideoDecodeLinuxGL --ozone-platform-hint=auto

Although trying it in linux mint with x11 or wayland (experimental on it) didn't work, so I believe it is a wayland only fix.

Edit 1:

Tested the same with ubuntu 24.04.1 with intel gpu and it works.

Tested with amd gpu on ubuntu 24.04.1, it did NOT work. Then tested this with fedora 41 and it works! So I believe it might be some fault in ubuntu related to amd drivers (?), although firefox will do hardware decode, regardless of any distribution or any gpu (AMD gpu requires force vaapi via about:config).

Edit 2:

I believe the error on ubuntu with amd gpu without the Ignore driver checks flag was something related to vaapi_video_decoder.cc

And when I used that Ignore checks flag and played any video, I would errors related to gpu_process_host.cc GPU process exited unexpectedly