sujaldev
(Sujal Singh)
April 2, 2022, 9:55am
1
Hi, I am trying to get google chrome to use my GPU for video decoding as when I play 8k video my CPU usage skyrockets to 100% usage whereas GPU usage is well below 20% but unable to find any documentation for achieving the said task. I heard about this va api thing but I have no clue how to get it working, any guidance is much appreciated!
Specs
CPU: AMD Ryzen 5 3600
GPU: Nvidia GTX 1650
OS: Fedora 35
Window Manger: X11
Kernel Version: 5.16
Google Chrome Version: 100.0.4896.60
grumpey
(Joe Walker)
April 2, 2022, 11:03am
2
Welcome to please have a look at Welcome to Ask Fedora! Please read me first!
try starting chrome with --use-gl=desktop --enable-features=VaapiVideoDecoder
To make the changes persistent have a look here
edit:
You may also need to install additional packages: libva , libva-utils and ffmpeg
sujaldev
(Sujal Singh)
April 2, 2022, 11:12am
3
Hi,
Firstly, thanks for the new user guide! Second, I launched chrome with those flags but nothing seems to change, I have libva, libva-utils and ffmpeg
installed. Is there any other step I am missing? do I need to restart after installing libva and libva-utils?
Thanks!
sujaldev
(Sujal Singh)
April 2, 2022, 11:19am
4
If it helps I see this message when launching chrome:
[4301:4301:0402/164856.837480:ERROR:gpu_init.cc(446)] Passthrough is not supported, GL is desktop, ANGLE is
grumpey
(Joe Walker)
April 2, 2022, 11:25am
5
you may also need libva-vdpau-driver
sujaldev
(Sujal Singh)
April 2, 2022, 11:27am
6
That also seems to be already installed.
sujaldev
(Sujal Singh)
April 2, 2022, 11:30am
7
I can see this other package which is not installed libva-v4l2-request
do I need this?
grumpey
(Joe Walker)
April 2, 2022, 12:21pm
8
What driver are you using for the nvidia GPU? If using the default nouveau drivers you cannot get full function out of the GPU. You may need to install the nvidia driver from rpmfusion if you have not done so.
sujaldev
(Sujal Singh)
April 3, 2022, 10:32am
10
I am using the proprietary nvidia drivers, version: 510.60.02
grumpey
(Joe Walker)
April 3, 2022, 1:34pm
11
sujaldev
(Sujal Singh)
April 3, 2022, 2:42pm
12
Output of vainfo:
libva info: VA-API version 1.13.0
libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_12
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG4Simple : VAEntrypointVLD
VAProfileMPEG4AdvancedSimple : VAEntrypointVLD
<unknown profile> : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
Output of vdpauinfo:
display: :1 screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library 510.60.02 Wed Mar 16 11:15:55 UTC 2022
Video surface:
name width height types
-------------------------------------------
420 8192 8192 NV12 YV12
422 8192 8192 UYVY YUYV
444 8192 8192 NV24 YV24
420_16 8192 8192 P010 P016
422_16 8192 8192 UYVY YUYV
444_16 8192 8192 Y_U_V_444_16
Decoder capabilities:
name level macbs width height
----------------------------------------------------
MPEG1 0 65536 4096 4096
MPEG2_SIMPLE 3 65536 4096 4096
MPEG2_MAIN 3 65536 4096 4096
H264_BASELINE 51 65536 4096 4096
H264_MAIN 51 65536 4096 4096
H264_HIGH 51 65536 4096 4096
VC1_SIMPLE 1 8190 2048 2048
VC1_MAIN 2 8190 2048 2048
VC1_ADVANCED 4 8190 2048 2048
MPEG4_PART2_SP 3 8192 2048 2048
MPEG4_PART2_ASP 5 8192 2048 2048
DIVX4_QMOBILE 0 8192 2048 2048
DIVX4_MOBILE 0 8192 2048 2048
DIVX4_HOME_THEATER 0 8192 2048 2048
DIVX4_HD_1080P 0 8192 2048 2048
DIVX5_QMOBILE 0 8192 2048 2048
DIVX5_MOBILE 0 8192 2048 2048
DIVX5_HOME_THEATER 0 8192 2048 2048
DIVX5_HD_1080P 0 8192 2048 2048
H264_CONSTRAINED_BASELINE 51 65536 4096 4096
H264_EXTENDED 51 65536 4096 4096
H264_PROGRESSIVE_HIGH 51 65536 4096 4096
H264_CONSTRAINED_HIGH 51 65536 4096 4096
H264_HIGH_444_PREDICTIVE 51 65536 4096 4096
VP9_PROFILE_0 1 262144 8192 8192
VP9_PROFILE_1 --- not supported ---
VP9_PROFILE_2 1 262144 8192 8192
VP9_PROFILE_3 --- not supported ---
HEVC_MAIN 153 262144 8192 8192
HEVC_MAIN_10 153 262144 8192 8192
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 153 262144 8192 8192
HEVC_MAIN_444 153 262144 8192 8192
HEVC_MAIN_444_10 153 262144 8192 8192
HEVC_MAIN_444_12 153 262144 8192 8192
Output surface:
name width height nat types
----------------------------------------------------
B8G8R8A8 32768 32768 y Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
R10G10B10A2 32768 32768 y Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
Bitmap surface:
name width height
------------------------------
B8G8R8A8 32768 32768
R8G8B8A8 32768 32768
R10G10B10A2 32768 32768
B10G10R10A2 32768 32768
A8 32768 32768
Video mixer:
feature name sup
------------------------------------
DEINTERLACE_TEMPORAL y
DEINTERLACE_TEMPORAL_SPATIAL y
INVERSE_TELECINE y
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 1 8192
VIDEO_SURFACE_HEIGHT y 1 8192
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
sujaldev
(Sujal Singh)
April 26, 2022, 9:20am
13
So I have finally managed to get it working, I am not sure what finally fixed it but I suspect this flag --disable-features=UseChromeOSDirectVideoDecoder
.
Here are the flags I am using:
--disable-features=UseChromeOSDirectVideoDecoder
--disable-software-rasterizer
--disable-gpu-driver-bug-workarounds
--disable-gpu-driver-workarounds
--disable-gpu-vsync
--disable-reading-from-canvas
--enable-accelerated-2d-canvas
--enable-accelerated-video-decode
--enable-accelerated-mjpeg-decode
--enable-features=VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization
--enable-gpu-compositing
--enable-native-gpu-memory-buffers
--enable-gpu-rasterization
--enable-oop-rasterization
--enable-raw-draw
--enable-zero-copy
--ignore-gpu-blocklist
--use-gl=desktop
1 Like
This may looks enable all of the features but in reality it is actually causing more issue then what is suppose to be doing it.
Plus when it is come to vdpau support side, you still can’t do it. Because you need vdpau nvidia support .(For example : GitHub - elFarto/nvidia-vaapi-driver: A VA-API implemention using NVIDIA's NVDEC ) I’m not saying this link is the solution. I just wanted you know, this is not the way you suppose to do it. I enabled couple times and I notice issues like “vsync problems”, “tearing”, sometimes stop functioning properly, so this could leads unexpected problems. as well.
sujaldev
(Sujal Singh)
April 26, 2022, 2:42pm
15
You are right, these flags caused some issues for me like a weird black area under every youtube video and the vimium extension stopped working probably because of this --disable-reading-from-canvas
flag. So I actually ended up just using these three flags and no issues yet
--disable-features=UseChromeOSDirectVideoDecoder
--enable-features=VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization
--use-gl=desktop
1 Like