-
-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
ffmpeg: add amf support #300764
ffmpeg: add amf support #300764
Conversation
I am able to compile, but:
I think AMF requires AMDGPU-PRO driver, which is not super usable on NixOS (requires an older kernel and whatnot). 😕 nixpkgs/nixos/modules/hardware/video/amdgpu-pro.nix Lines 32 to 38 in 127c068
|
According to the release notes of amf there is experimental support for RADV and full support for pro drivers. https://github.com/GPUOpen-LibrariesAndSDKs/AMF/releases/tag/v1.4.33 |
That's cool! However, we still need
I attempted to hack this together (use the lib from AMDGPU-PRO, but not the driver itself) on my 23.11 machine via: {
hardware.opengl = {
driSupport32Bit = true; # Steam, etc.
enable = true;
extraPackages = with pkgs; [
rocmPackages.clr
rocmPackages.clr.icd
# added this
(pkgs.runCommandNoCC "libamfrt" { } ''
mkdir -p $out/lib
cp ${config.boot.kernelPackages.amdgpu-pro}/opt/amdgpu-pro/lib/libamfrt* $out/lib
ln -s $out/lib/libamfrt64.so{,.1}
'')
];
};
} but no luck: $ ./ffmpeg-amf/bin/ffmpeg -hide_banner -loglevel warning -i ~/Downloads/bigbuck_bunny_8bit_15000kbps_1080p_60.0fps_h264.mp4 -c:v h264_amf out.mp4
zsh: segmentation fault (core dumped) Per GPUOpen-LibrariesAndSDKs/AMF#457 , this might need more shared libraries, a newer Mesa, etc... 😮💨 |
This clearly needs some work. |
Found out that the min version of amdgpu-pro required is 24.1.1 (23.40.02) but the version we packaged is only at 21.30. |
If a new amdgpu-pro version with newer kernel is on unstable I could try things in this PR. |
@Svenum could you also publish that as a draft PR? That way others can pick it up in case you hit a wall you're not able to penetrate. |
I am sorry if I have expressed myself incomprehensibly, but i was not able to achive an amdgpu-pro installation on a newer kernel, but I will try. |
Ah, sorry for the confusion. |
got this to work now can be tested by adding |
5d61a6f
to
2c0bb7f
Compare
Removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM but untested.
A few questions.
What exactly do you mean by that? |
That it also works together with the open-source AMD driver and not just the closed source one. And i don't want to give the impression that it can only be used together with the closed source driver. |
f380d39
to
5e62e33
Compare
What kind of driver are we talking about here? DRM/DRI or OGL/VK? |
I was talking about the VK driver and that it can be mesa's radv instead of just using the one included in amdgpu-pro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully produced a decodable HEVC video using:
LD_LIBRARY_PATH=$(nix-build -A amf)/lib/ $(nix-build -A ffmpeg-full)/bin/ffmpeg -f lavfi -i testsrc -t 10 -c:v hevc_amf -y /tmp/foo.mkv
(I presume you'd place amf
in the system-wide driver path in an actual deployment.)
At least thats what i did while testing. |
Description of changes
I tested that this builds, but I do not have a machine with an AMD GPU to test this on.
Edit: now that i include the amf driver in this pr ot would fix #204502
Closes #204502
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.