Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note in README explaining how to use this with Chrome #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xuanruiqi
Copy link

Since Chrome is now widely reported to work, there is no need to pretend that it will not function, as long as we explain that the support is not official.

Accelerated video decoding has been reported to work on Chrome version >= 129 with NVIDIA driver version >= 565.57.01. It might work on slightly older versions of
Chrome and/or NVIDIA driver, but glitches and bugs have been reported.

These flags should suffice: `--enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL,VaapiOnNvidiaGPUs,VaapiIgnoreDriverChecks`. Note that the [direct backend](#direct-backend) must be used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use the following flags - --use-gl=angle --use-angle=vulkan --enable-features=VaapiOnNvidiaGPUs,AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL,AcceleratedVideoDecode,UseMultiPlaneFormatForHardwareVideo.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but using Vulkan is not required (it has nothing to do with acceleration) and UseMultiPlaneFormatForHardwareVideo does nothing since 129 (it is the default).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and AcceleratedVideoDecode?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that is redundant with AcceleratedVideoDecodeLinuxGL. I never had that flag enabled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about VaapiIgnoreDriverChecks - is it needed? I don't use it and get C in nvidia-smi.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required for some devices, and it can do no harm even if it's not needed - so it's better to include

@littleblack111
Copy link

littleblack111 commented Dec 30, 2024

doesn't seem to work for me

EDIT: after testing, latest chromium seem to be working, but latest electron doesn't...

@HoleHolo
Copy link

HoleHolo commented Feb 4, 2025

❯ google-chrome-stable  --enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL,VaapiOnNvidiaGPUs,VaapiIgnoreDriverChecks
Error: unrecognized flag --no-expose-wasm
Try --help for options
Created TensorFlow Lite XNNPACK delegate for CPU.
[12125:12152:0204/202623.925581:ERROR:registration_request.cc(291)] Registration response error message: DEPRECATED_ENDPOINT
Warning: Couldn't find an EGLConfig rendering to a window for TextureFormat::RGBA8Unorm.
 - While trying to discover a BackendType::OpenGL adapter.
    at Initialize (../../third_party/dawn/src/dawn/native/opengl/ContextEGL.cpp:83)

[12413:10:0204/202635.375322:ERROR:ffmpeg_common.cc(970)] Unsupported pixel format: -1
[12171:12424:0204/202635.548757:ERROR:vaapi_video_decoder.cc(1223)] failed Initialize()ing the frame pool
[12125:12152:0204/202649.542363:ERROR:registration_request.cc(291)] Registration response error message: DEPRECATED_ENDPOINT

Video Acceleration Information
==============================

Decoding :
Decode h264 baseline :48x16 to 4096x4096 pixels
Decode h264 main :48x16 to 4096x4096 pixels
Decode h264 high :48x16 to 4096x4096 pixels
Decode vp9 profile0 :128x128 to 8192x8192 pixels
Decode vp9 profile2 :128x128 to 8192x8192 pixels
Decode hevc main :144x144 to 8192x8192 pixels
Decode hevc main 10 :144x144 to 8192x8192 pixels
Decode hevc main still-picture:144x144 to 8192x8192 pixels
Encoding :

Log Messages
============

  • [12171:12171:0204/202620.491978:WARNING:sandbox_linux.cc(430)] : InitializeSandbox() called with multiple threads in process gpu-process.

  • [12171:12171:0204/202620.497426:WARNING:viz_main_impl.cc(85)] : VizNullHypothesis is disabled (not a warning)
  • [12171:12424:0204/202635.548757:ERROR:vaapi_video_decoder.cc(1223)] : failed Initialize()ing the frame pool

Actually it's not working when playing a video

@Colin1224
Copy link

Does AV1 work for you with this? VP9 and H264 work great but AV1 uses CPU decode.

Using a 4090 with 570.86.16

Trying display: wayland
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_12         : VAEntrypointVLD

I tried chroium, ungoogled-chromium, and edge.

@xuanruiqi
Copy link
Author

Does AV1 work for you with this? VP9 and H264 work great but AV1 uses CPU decode.

Using a 4090 with 570.86.16

Trying display: wayland
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_12         : VAEntrypointVLD

I tried chroium, ungoogled-chromium, and edge.

I don't have a card that supports AV1, unfortunately.
But it's not really working for me with 570.86.16. Have you used nvidia-smi pmon to verify that this is working?

@Colin1224
Copy link

Colin1224 commented Feb 12, 2025

I don't have a card that supports AV1, unfortunately. But it's not really working for me with 570.86.16. Have you used nvidia-smi pmon to verify that this is working?

Yeah nvtop and nvidia-smi pmon both show decode for VP9, H264, and HEVC, just not AV1.

❯ nvidia-smi
Wed Feb 12 11:24:29 2025       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.86.16              Driver Version: 570.86.16      CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090        Off |   00000000:0A:00.0  On |                  Off |
|  0%   46C    P2             59W /  450W |    4662MiB /  24564MiB |      2%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            1122      G   /usr/lib/Xorg                            59MiB |
|    0   N/A  N/A            1210      G   /usr/bin/kwalletd6                        6MiB |
|    0   N/A  N/A            1243      G   /usr/bin/kwin_wayland                   177MiB |
|    0   N/A  N/A            1335      G   /usr/bin/Xwayland                         9MiB |
|    0   N/A  N/A            1371      G   /usr/bin/ksmserver                        6MiB |
|    0   N/A  N/A            1373      G   /usr/bin/kded6                            6MiB |
|    0   N/A  N/A            1394    C+G   /usr/bin/plasmashell                    451MiB |
|    0   N/A  N/A            1432      G   /usr/lib/kactivitymanagerd                6MiB |
|    0   N/A  N/A            1435      G   /usr/bin/gmenudbusmenuproxy               6MiB |
|    0   N/A  N/A            1436      G   /usr/bin/kaccess                          6MiB |
|    0   N/A  N/A            1437      G   ...it-kde-authentication-agent-1          6MiB |
|    0   N/A  N/A            1438      G   /usr/lib/org_kde_powerdevil               6MiB |
|    0   N/A  N/A            1440      G   /usr/bin/xembedsniproxy                   6MiB |
|    0   N/A  N/A            1585      G   /usr/bin/kdeconnectd                      6MiB |
|    0   N/A  N/A            1656      G   /usr/bin/xwaylandvideobridge              6MiB |
|    0   N/A  N/A            1693      G   /usr/lib/xdg-desktop-portal-kde           6MiB |
|    0   N/A  N/A            2859      G   /usr/lib/firefox/firefox                370MiB |
|    0   N/A  N/A            3077      G   ...asma-browser-integration-host          6MiB |
|    0   N/A  N/A            5120      G   ...deo --variations-seed-version       1884MiB |
|    0   N/A  N/A            5506      G   /usr/lib/baloorunner                      6MiB |
|    0   N/A  N/A            7033      G   ...xZeroCopyGL,VaapiOnNvidiaGPUs          6MiB |
|    0   N/A  N/A            7082    C+G   ...per --variations-seed-version       1240MiB |
|    0   N/A  N/A            7858      G   /usr/bin/konsole                          6MiB |
+-----------------------------------------------------------------------------------------+

~
❯ nvidia-smi pmon
# gpu         pid   type     sm    mem    enc    dec    jpg    ofa    command 
# Idx           #    C/G      %      %      %      %      %      %    name 
    0       1122     G      -      -      -      -      -      -    Xorg           
    0       1210     G      -      -      -      -      -      -    kwalletd6      
    0       1243     G      0      0      -      -      -      -    kwin_wayland   
    0       1335     G      -      -      -      -      -      -    Xwayland       
    0       1371     G      -      -      -      -      -      -    ksmserver      
    0       1373     G      -      -      -      -      -      -    kded6          
    0       1394   C+G      -      -      -      -      -      -    plasmashell    
    0       1432     G      -      -      -      -      -      -    kactivitymanage
    0       1435     G      -      -      -      -      -      -    gmenudbusmenupr
    0       1436     G      -      -      -      -      -      -    kaccess        
    0       1437     G      -      -      -      -      -      -    polkit-kde-auth
    0       1438     G      -      -      -      -      -      -    org_kde_powerde
    0       1440     G      -      -      -      -      -      -    xembedsniproxy 
    0       1585     G      -      -      -      -      -      -    kdeconnectd    
    0       1656     G      -      -      -      -      -      -    xwaylandvideobr
    0       1693     G      -      -      -      -      -      -    xdg-desktop-por
    0       2859     G      -      -      -      -      -      -    firefox        
    0       3077     G      -      -      -      -      -      -    plasma-browser-
    0       5120     G      -      -      -      -      -      -    legcord --gpu-p
    0       5506     G      -      -      -      -      -      -    baloorunner    
    0       7033     G      -      -      -      -      -      -    msedge --ozone-
    0       7082   C+G      0      0      -      7      -      -    msedge --type=g

You can see successful hardware decode on a VP9 video with 570.86.16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants