Accelerated Video Playback: Difference between revisions
m The option `hardware.opengl.enable' defined in `/etc/nixos/configuration.nix' has been renamed to `hardware.graphics.enable'. |
m Add missing module args to he nvidia config example |
||
(One intermediate revision by the same user not shown) | |||
Line 48: | Line 48: | ||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
<translate> | <translate> | ||
=== NVIDIA === | |||
NVIDIA do not officially support accelerated video playback on Linux. A third-party implementation exists, but does not support Chrome<ref>https://github.com/elFarto/nvidia-vaapi-driver#chrome</ref>, and has significant limitations compared to the other implementations<ref>https://github.com/elFarto/nvidia-vaapi-driver#codec-support</ref>. | |||
NVIDIA users with a separate iGPU should generally prefer to use their iGPU for this, and therefore look to the above Intel and AMD sections instead. | |||
Users with only an NVIDIA GPU can attempt to use the third party implementation; the package is added to <code>hardware.graphics.extraPackages</code> by default, but it requires some additional setup to be useful<ref>https://github.com/elFarto/nvidia-vaapi-driver#configuration</ref>: | |||
</translate> | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
{ config, lib, ...}: { | |||
environment.variables.LIBVA_DRIVER_NAME = "nvidia" | |||
# If used with Firefox | |||
environment.variables.MOZ_DISABLE_RDD_SANDBOX = "1"; | |||
programs.firefox.preferences = let | |||
ffVersion = config.programs.firefox.package.version; | |||
in { | |||
"media.ffmpeg.vaapi.enabled" = lib.versionOlder ffVersion "137.0.0"; | |||
"media.hardware-video-decoding.force-enabled" = lib.versionAtLeast ffVersion "137.0.0"; | |||
"media.rdd-ffmpeg.enabled" = lib.versionOlder ffVersion "97.0.0"; | |||
"gfx.x11-egl.force-enabled" = true; | |||
"widget.dmabuf.force-enabled" = true; | |||
# Set this to true if your GPU supports AV1. | |||
# | |||
# This can be determined by reading the output of the | |||
# `vainfo` command, after the driver is enabled with | |||
# the environment variable. | |||
"media.av1.enabled" = false; | |||
}; | |||
} | |||
</nowiki>}} | |||
<translate> | |||
== Testing your configuration == <!--T:6--> | == Testing your configuration == <!--T:6--> | ||