Nix flake that packages AMD's Advanced Media Acceleration (AMA) SDK for NixOS — primarily for the Alveo MA35D card.
Tracks SDK release v1.4.0 (2025-12-17). All binaries are fetched from AMD's
official apt feed (packages.xilinx.com/artifactory/debian-packages); nothing
is vendored in this repo.
| Package | Source | Description |
|---|---|---|
amd-ama-firmware |
amd-ama-driver.deb |
The 8 ama_fw_*.bin blobs that the kernel module loads. |
amd-ama-runtime |
amd-ama-core.deb |
Prebuilt libvpi, libxrm, headers. Patchelf'd for NixOS. |
amd-ama-kmod |
amd-ama-driver.deb (kmod.tar.gz) |
Out-of-tree ama_transcoder.ko, built against your kernel. |
amd-ama-ffmpeg |
amd-ama-ffmpeg-src.deb |
FFmpeg 7.1 with AMD's VPE/AMA patches + a full codec set. |
Add the flake to another flake's inputs and import the NixOS module:
{
inputs.amd-ama.url = "github:GodTamIt/amd-ama-nix";
outputs = { self, nixpkgs, amd-ama, ... }: {
nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
amd-ama.nixosModules.default
({ ... }: {
nixpkgs.config.allowUnfree = true; # runtime libs are redistributable-unfree
hardware.amd-ama.enable = true;
})
./configuration.nix
];
};
};
}That gives you:
ama_transcoder.koauto-loaded at boot, firmware staged in/lib/firmware/- PCI reset-method / SR-IOV autoprobe tweaks applied via udev
ffmpeg-ama(the AMA-patched build) on the systemPATH, installed side-by-side with whateverpkgs.ffmpegyou already have
To install one-off via nix run:
$ nix run github:GodTamIt/amd-ama-nix -- -hide_banner -codecs | grep _amaThe FFmpeg derivation enables the same external codecs as pkgs.ffmpeg-full,
on top of AMD's AMA plugins:
- AMA (via
libvpi+libxrm) —h264_ama,hevc_ama,av1_ama,vp9_ama,jpeg_ama,ljpeg_amaand the matching filters. - Video codecs — libx264, libvpx (VP8/VP9), libaom (AV1 enc), libdav1d (AV1 dec), libopenh264, libtheora, libwebp.
- Audio codecs — libopus, libvorbis, libmp3lame, libspeex.
- HW accel (independent of AMA) — VAAPI, VDPAU, libdrm. Useful on mixed systems (e.g. AMD APU + MA35D card).
- Audio I/O — ALSA, PulseAudio.
- Containers / misc — libass, libbluray, lzma, libxml2 (DASH), OpenSSL, libsrt, libzmq, libfreetype / libfontconfig / libfribidi / libharfbuzz.
Not enabled:
-
libx265— nixpkgs ships 4.1 which breaks the API that AMD's FFmpeg 7.1 expects. Usehevc_amainstead, or add a pinned older x265 viaextraConfigureFlags+extraBuildInputs. -
libsvt-av1— same story, nixpkgs has 3.x with an incompatible signature. Useav1_amaorlibaom. -
libfdk-aac— nonfree, opt-in:(amd-ama.packages.x86_64-linux.amd-ama-ffmpeg.override { withNonfree = true; fdk_aac = pkgs.fdk_aac; })
Want more? extraConfigureFlags and extraBuildInputs are plumbed through:
amd-ama.packages.x86_64-linux.amd-ama-ffmpeg.override {
extraBuildInputs = [ pkgs.libjxl ];
extraConfigureFlags = [ "--enable-libjxl" ];
}By default the package installs bin/ffmpeg-ama and bin/ffprobe-ama so it
cannot collide with pkgs.ffmpeg. Three ways to change that:
As a module option (most users):
hardware.amd-ama = {
enable = true;
ffmpegBinaryName = "ffmpeg"; # → bin/ffmpeg + bin/ffprobe
};If you do this, don't also have pkgs.ffmpeg in your environment.systemPackages
— NixOS will refuse the activation with a bin/ffmpeg collision.
As a package override (if you're pulling the package in yourself rather than using the module):
environment.systemPackages = [
(amd-ama.packages.x86_64-linux.amd-ama-ffmpeg.override {
binaryName = "ffmpeg";
})
];Opt out of installing ffmpeg entirely — the kernel module and firmware are
still wired up, but the binary isn't placed on PATH:
hardware.amd-ama = {
enable = true;
installFfmpeg = false;
};The ffprobe binary is always renamed in lockstep: ffmpeg-ama → ffprobe-ama,
ffmpeg → ffprobe, foo → fooprobe (via a simple s/ffmpeg/ffprobe/
substitution).
AMD's driver hasn't been ported past the from_timer / del_timer_sync
removals in Linux 6.15/6.16. The default kernel for this flake is 6.12 LTS.
If you build against 6.16+ you'll hit compile errors.
To pin a specific kernel inside your system config:
{ config, pkgs, ... }: {
boot.kernelPackages = pkgs.linuxPackages_6_12;
hardware.amd-ama.enable = true;
}- ✅ Builds on
x86_64-linux,nix flake checkpasses. - ✅
ffmpeg -codecslistsh264_ama,hevc_ama,av1_ama,vp9_ama,jpeg_amaalongside libx264, libaom, libdav1d, libvpx, libopus, VAAPI, etc. - ⏳ No hardware-in-loop test yet. Runtime correctness on an actual MA35D has not been verified.
- ⏳ XMA / XRM daemons (
xrmd,mamgmt,mautil) are not packaged yet. AMD ships them as prebuilt ELFs with non-contiguous PT_NOTE segments thatpatchelfcan't rewrite. Onlylibvpiand headers are installed today.
- Kernel
EXTRA_CFLAGSdeprecation — kernel 6.x dropped the legacy name; AMD's Kbuild still uses it. WesubstituteInPlaceit toccflags-yat patch-time. $(AQROOT)path capture — AMD's Kbuild usesAQROOTwhich the kernel's inner make doesn't re-export. We swap it for$(M).MODULE_IMPORT_NS(DMA_BUF)— AMD's source has the version guard inverted; the namespace was introduced in 5.16, not 5.15. Patched.- nixpkgs
apr-1.7.6missing-lm—modfIFUNC fails to resolve atdlopen, segfaultingffmpegstartup. We override APR with--add-needed libm.so.6.
pkgs/
sources.nix # pinned upstream URLs + sha256
firmware.nix # extracts /lib/firmware/ama_fw_*.bin from the driver deb
runtime.nix # libvpi + closure, patchelf'd
kmod.nix # out-of-tree kernel module
ffmpeg.nix # FFmpeg build
default.nix # wires them together (and applies APR fixup)
modules/
default.nix # NixOS module (hardware.amd-ama.enable)
flake.nix # inputs + outputs