updating amdgpu drivers for ffmpeg av1 encoding on bookworm
updating amdgpu drivers for ffmpeg av1 encoding on bookworm
I often convert videos to av1 format. It requires significant time but delivers high quality at a fraction of the space. About two weeks ago, I upgraded my PC after it fell short of minimum requirements for a new game. As a Linux user, I joined Team Red and purchased an RX7000 GPU. While it may improve things, so far it has added more challenges than benefits. I learned that using GPU acceleration for encoding works with that GPU, so I searched online, followed guides, and compiled ffmpeg with amf support. Eventually, I found the issue: "libamfrt64.so.1 missing." On the web, it seems some proprietary components are involved. I tried installing amdgpu-installer, but version 5.6 lacked the needed libraries and had bugs. The latest stable version I could find was 5.4.1, which still didn’t have everything required. After that, I faced a tough situation: most installations worked, but I encountered crashes, black borders around windows, and slow startup. I reinstalled drivers and updated the GPU, which fixed some things. Still, reaching my original objective remains elusive. FFmpeg with av1 encoding via amf isn’t functioning, and I keep hearing about driver updates. I tried updating the drivers but got the same problem with amgpu-6.0.5 DKMS Files, suggesting the issue might be deeper. I’m eager to hear your suggestions and any hope for a resolution... Thanks, Arokan
When using the standard Debian kernel, certain issues might arise. I've noticed that Nvidia GPUs typically offer better initial support compared to AMD options. It's worth noting that Nvidia drivers provide strong day one assistance, while AMD support can take longer. The Radeon 7000 series only received kernel-level support recently. The Linux kernel version is around 6.42, whereas Debian 12 runs on 6.10. Many users prefer installing the Xanmod kernel for more recent hardware, though it's not recommended to rely on newer systems with Debian or Ubuntu due to potential compatibility gaps. For better stability and updates, Arch-based distros like EndeavourOS or Garuda Linux are preferable. Fedora is another solid choice, offering stability and a kernel that incorporates improvements from the Zen series. Nobara Linux is also worth considering, developed by GloriousEggroll, which has strong performance and regular updates.
Same here, folks love the AMD performance on Linux, but it looks like most users aren't leveraging all the features. It seems to outperform the open-source NVIDIA drivers, though nothing matches the closed-source options. Keep in mind, using hardware encoding isn't worth it since it's already highly optimized for real-time use—much less efficient. I'd be surprised if you achieve the same quality at the same bitrate without boosting it too much. It works well for capturing gameplay, but tends to be poor for long-term storage compared to CPU encoding.
It wasn't until February 2022 that I truly started exploring Linux. Around that time, I switched from my 3080 to a 6900 xt, hoping for improved performance since Linux would handle it better. I expected the upgrade to be smoother, especially after selling my 3080 for a lower price to someone stuck with a 1060 for 4K gaming due to expensive GPUs. In reality, the 6900 performed worse on Linux than my Nvidia card. I wasn't aware that AMD GPUs have a default low-power setting—you need to adjust it via terminal commands to get optimal results. Eventually, the 6900 became bricked by a BIOS issue, forcing me to return it twice for a working unit. Since then, I've been using a 3080 ti, which runs much better in Linux than the AMD GPU ever did.
People often say Linux runs well on Intel iGPUs, though it can be inconsistent. I frequently faced screen tearing problems that only resolved when I added an NVIDIA card. OpenCL didn’t work on AMD, and Stable Diffusion became unresponsive. There are definitely limitations—especially with newer kernels where drivers might not compile—and sometimes you’re forced to use an older kernel. Linux isn’t always smooth, but it’s not the only issue; Windows also has its quirks. On the positive side, GPU tasks on Linux load completely, while Windows tries to keep things responsive. This means heavy computation can slow down the desktop on Linux, but it’s ideal for headless setups where full power is needed.
It could also be related to your graphics card. You might have noticed that the AV1 codec isn't supported on your motherboard—make sure to verify that before proceeding.
Don't get distracted by amdgpu-pro matters. AV1 encoding was integrated into Mesa roughly four months ago (in version 23.3). You only need the standard kernel driver, libva, and a sufficiently updated Mesa (along with dependencies such as LLVM). `vdpauinfo` and `vainfo` are helpful resources. Remember, it's AMD's engineers who develop the kernel and Mesa code.
That's nice to hear so far! Soooooo: vainfo libva info: VA-API version 1.17.0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so libva info: Found init function __vaDriverInit_1_14 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.17 (libva 2.12.0) vainfo: Driver version: Mesa Gallium driver 22.3.0-devel for Radeon RX 7900 XTX (gfx1100, LLVM 15.0.3, DRM 3.49, 6.1.0-10-amd64) vainfo: Supported profile and entrypoints VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice VAProfileHEVCMain10 : VAEntrypointVLD VAProfileHEVCMain10 : VAEntrypointEncSlice VAProfileJPEGBaseline : VAEntrypointVLD VAProfileVP9Profile0 : VAEntrypointVLD VAProfileVP9Profile2 : VAEntrypointVLD VAProfileAV1Profile0 : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc display: :0 screen: 0 API version: 1 Information string: G3DVL VDPAU Driver Shared Library version 1.0 Video surface: name width height types ------------------------------------------- 420 16384 16384 NV12 YV12 422 16384 16384 UYVY YUYV 444 16384 16384 Y8U8V8A8 V8U8Y8A8 420_16 16384 16384 422_16 16384 16384 444_16 16384 16384 Decoder capabilities: name level macbs width height ---------------------------------------------------- MPEG1 --- not supported --- MPEG2_SIMPLE --- not supported --- MPEG2_MAIN --- not supported --- H264_BASELINE 52 65536 4096 4096 H264_MAIN 52 65536 4096 4096 H264_HIGH 52 65536 4096 4096 VC1_SIMPLE --- not supported --- VC1_MAIN --- not supported --- VC1_ADVANCED --- not supported --- MPEG4_PART2_SP --- not supported --- MPEG4_PART2_ASP --- not supported --- DIVX4_QMOBILE --- not supported --- DIVX4_MOBILE --- not supported --- DIVX4_HOME_THEATER --- not supported --- DIVX4_HD_1080P --- not supported --- DIVX5_QMOBILE --- not supported --- DIVX5_MOBILE --- not supported --- DIVX5_HOME_THEATER --- not supported --- DIVX5_HD_1080P --- not supported --- H264_CONSTRAINED_BASELINE 0 65536 4096 4096 H264_EXTENDED --- not supported --- H264_PROGRESSIVE_HIGH --- not supported --- H264_CONSTRAINED_HIGH --- not supported --- H264_HIGH_444_PREDICTIVE --- not supported --- VP9_PROFILE_0 --- not supported --- VP9_PROFILE_1 --- not supported --- VP9_PROFILE_2 --- not supported --- VP9_PROFILE_3 --- not supported --- HEVC_MAIN 186 139264 8192 4352 HEVC_MAIN_10 186 139264 8192 4352 HEVC_MAIN_STILL --- not supported --- HEVC_MAIN_12 --- not supported --- HEVC_MAIN_444 --- not supported --- HEVC_MAIN_444_10 --- not supported --- HEVC_MAIN_444_12 --- not supported --- AV1_MAIN --- not supported --- AV1_HIGH --- not supported --- AV1_PROFESSIONAL --- not supported --- Output surface: name width height nat types ---------------------------------------------------- B8G8R8A8 16384 16384 y NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 P010 P016 A8I8 I8A8 R8G8B8A8 16384 16384 y NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 P010 P016 A8I8 I8A8 R10G10B10A2 16384 16384 y NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 P010 P016 A8I8 I8A8 B10G10R10A2 16384 16384 y NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 P010 P016 A8I8 I8A8 Bitmap surface: name width height ------------------------------ B8G8R8A8 16384 16384 R8G8B8A8 16384 16384 R10G10B10A2 16384 16384 B10G10R10A2 16384 16384 A8 16384 16384 Video mixer: feature name sup ------------------------------------ DEINTERLACE_TEMPORAL y DEINTERLACE_TEMPORAL_SPATIAL - INVERSE_TELECINE - NOISE_REDUCTION y SHARPNESS y LUMA_KEY y HIGH QUALITY SCALING - L1 y HIGH QUALITY SCALING - L2 - HIGH QUALITY SCALING - L3 - HIGH QUALITY SCALING - L4 - HIGH QUALITY SCALING - L5 - HIGH QUALITY SCALING - L6 - HIGH QUALITY SCALING - L7 - HIGH QUALITY SCALING - L8 - HIGH QUALITY SCALING - L9 - parameter name sup min max ----------------------------------------------------- VIDEO_SURFACE_WIDTH y 48 4096 VIDEO_SURFACE_HEIGHT y 48 4096 CHROMA_TYPE y LAYERS y 0 4 attribute name sup min max ----------------------------------------------------- BACKGROUND_COLOR y CSC_MATRIX y NOISE_REDUCTION_LEVEL y 0.00 1.00 SHARPNESS_LEVEL y -1.00 1.00 LUMA_KEY_MIN_LUMA y LUMA_KEY_MAX_LUMA y If I read that correctly, AV1 is not supported. Does that mean it's not 'yet' supported or do I have the wrong GPU for that or should I forget vaapi then and focus on getting AMF to work?
Driver needs to be updated to 23.1.x or newer. Using older packages can be frustrating, but building from the source repo might be simpler. The AV1 PR is available at the provided link, offering a good starting point if you need to proceed that way. Alternatively, consider waiting until the release reaches main.