Chromium: Difference between revisions

From NixOS Wiki
Djf (talk | contribs)
Add details re: blank video acceleration section
Unabomberlive (talk | contribs)
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:
     (chromium.override {
     (chromium.override {
       commandLineArgs = [
       commandLineArgs = [
         "--enable-features=VaapiVideoDecodeLinuxGL"
         "--enable-features=AcceleratedVideoEncoder"
         "--ignore-gpu-blocklist"
         "--ignore-gpu-blocklist"
         "--enable-zero-copy"
         "--enable-zero-copy"
Line 28: Line 28:
     (chromium.override {
     (chromium.override {
       commandLineArgs = [
       commandLineArgs = [
         "--enable-features=VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,Vulkan,VulkanFromANGLE"
         "--enable-features=AcceleratedVideoEncoder,VaapiOnNvidiaGPUs,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
         "--enable-features=VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport"
         "--enable-features=VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport"
         "--enable-features=DefaultANGLEVulkan,UseMultiPlaneFormatForHardwareVideo"
         "--enable-features=UseMultiPlaneFormatForHardwareVideo"
         "--ignore-gpu-blocklist"
         "--ignore-gpu-blocklist"
         "--enable-zero-copy"
         "--enable-zero-copy"
Line 38: Line 38:
}
}
</nowiki>}}
</nowiki>}}
== Enabling native Wayland support ==
== Enabling native Wayland support ==



Latest revision as of 20:48, 10 January 2025

Installation

NixOS

Add chromium to systemPackages.

Accelerated video playback

Make sure Accelerated Video Playback is setup on the system properly. Check chrome://gpu to see if Chromium has enabled hardware acceleration.

If accelerated video playback is not working, check relevant flags at chrome://flags, or enable them using the cli:

/etc/nixos/configuration.nix
{
  environment.systemPackages = with pkgs; [
    (chromium.override {
      commandLineArgs = [
        "--enable-features=AcceleratedVideoEncoder"
        "--ignore-gpu-blocklist"
        "--enable-zero-copy"
      ];
    })
  ];
}

In some cases, chrome://gpu will show Video Decode as enabled, but Video Acceleration Information as blank, with chrome://media-internals using FFmpeg Video Decoder (software decoding). If this happens, try to enable the following features:

/etc/nixos/configuration.nix
{
  environment.systemPackages = with pkgs; [
    (chromium.override {
      commandLineArgs = [
        "--enable-features=AcceleratedVideoEncoder,VaapiOnNvidiaGPUs,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
        "--enable-features=VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport"
        "--enable-features=UseMultiPlaneFormatForHardwareVideo"
        "--ignore-gpu-blocklist"
        "--enable-zero-copy"
      ];
    })
  ];
}

Enabling native Wayland support

You can turn on native Wayland support in all chrome and most electron apps by setting an environment variable: environment.sessionVariables.NIXOS_OZONE_WL = "1".

Enabling DRM (Widevine support)

By default, chromium does not support playing DRM protected media. However, there is a build time flag to include the unfree Widevine blob from nixpkgs:

/etc/nixos/configuration.nix
{
  environment.systemPackages = with pkgs; [
    (chromium.override { enableWideVine = true; })
  ];
}