I am on Debian 11 and use home-manager
.
I am trying to get ffmpeg
with NVIDIA GPU Hardware Acceleration support on my system. I see two packages ffmpeg_5-full
and arcanPackages.ffmpeg
but both of them have this line:
Not packaged:
aacplus avisynth cdio-paranoia crystalhd libavc1394 libiec61883
libnut libquvi nvenc oss shine twolame
utvideo vo-aacenc vo-amrwbenc xvmc zvbi blackmagic-design-desktop-video
Can I do something so nvenc
is indeed packaged?
Sandro
November 11, 2022, 10:54am
2
You can package it bad jokes aside. Even with it packaged you probably need nixGL, too.
1 Like
The comment is outdated. nvenc
is in fact enabled in ffmpeg-full
on Linux amd64:
, libxcb ? null # X11 grabbing using XCB
, libxcbshmExtlib ? true # X11 grabbing shm communication
, libxcbxfixesExtlib ? true # X11 grabbing mouse rendering
, libxcbshapeExtlib ? true # X11 grabbing shape rendering
, libXv ? null # Xlib support
, libXext ? null # Xlib support
, libxml2 ? null # libxml2 support, for IMF and DASH demuxers
, xz ? null # xz-utils
, nv-codec-headers ? null
, nvdec ? !stdenv.isDarwin && !stdenv.isAarch64 # NVIDIA NVDEC support
, nvenc ? !stdenv.isDarwin && !stdenv.isAarch64 # NVIDIA NVENC support
, openal ? null # OpenAL 1.1 capture support
, ocl-icd ? null # OpenCL ICD
, opencl-headers ? null # OpenCL headers
, opencore-amr ? null # AMR-NB de/encoder & AMR-WB decoder
#, opencv ? null # Video filtering
, openglExtlib ? false, libGL ? null, libGLU ? null # OpenGL rendering
, openh264 ? null # H.264/AVC encoder
, openjpeg ? null # JPEG 2000 de/encoder
, opensslExtlib ? false, openssl ? null
, libpulseaudio ? null # Pulseaudio input support
I can’t say I’ve tried it with non-NixOS though.
Yep, ffmpeg-full
has the required support and it’s working on a non-NixOS setup:
❯ ffmpeg -codecs | grep h264
DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_qsv libopenh264 **h264_cuvid** ) (encoders: libx264 libx264rgb libopenh264 h264_nvenc h264_qsv h264_v4l2m2m h264_vaapi nvenc **nvenc_h264** )
Can I ask you how you found this package? When I search in https://search.nixos.org/packages
for “ffmpeg full ” that package is not listed.
I plan to be pretty proficient with NixOS and am starting small with Nix Package manager because some day when I am comfortable I will full switch to it.
Yes, nixGL is needed. The default installation doesn’t seem to install the proprietary drivers so I specifically went for nixgl.auto.nixGLNvidia
.
ffmpeg-full
is arcan.ffmpeg
. It’s fortunate that the search page lists it that way, seems to be a result of arcan
re-exporting it’s dependencies and being defined as arcanPackages = recurseIntoAttrs (callPackage ../desktops/arcan { });
.
ffmpeg_5-full
is the same derivation, just overriden to use v5 source code, rather than v4. So feel free to use that, it should work the same for your use-case.
1 Like
So how do i enable this in my configuration.nix
?
nixgl.auto.enable = true;
nixgl.auto.nixGLNvidia = true;
i only have:
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
hardware.nvidia.modesetting.enable = true;
But I’d like to see a lot more acceleration in all areas: chrome, FF, and overall performance.
Any suggestions?
PS:
i have this in my harware-acceleration.nix and commented out nvidia-x11 as none of it worked:
in configuration.nix:
{ config, pkgs, lib, ... }:
let scriptPath = "/etc/nixos/scripts/test.sh";
in {
imports = [
./hardware/hardware-configuration.nix
./hardware/hardware-acceleration.nix
./pkgs/system-packages.nix
./network/system-networking.nix
./nix/system-nix-settings.nix
./printer/system-scanner-printer-settings.nix
];
in harware-acceleration.nix:
{ config, pkgs, ... }:
let nixpkgs = import <nixpkgs> { };
in {
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
# nvidia_x11 = pkgs.nvidia_x11.override { enableGeforce1030 = true; };
};
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
# nvidia_x11 # Nvidia X11 driver for GT1030
];
};
}