Skip to content

[Bug]: AMF encoding does not work on Linux past driver version 21.30 #334

@hannesmann

Description

@hannesmann

Describe the bug
Using any version of Radeon Software for Linux newer than 21.30 causes AMF to fail when attempting to encode video on an RX 6700 XT. This issue also occurred on an RX 590.

I usually use the unofficial AUR package for AMF to stream with OBS, but I can also reproduce the issue on Ubuntu 20.04 LTS which is a supported distro for AMF.

To Reproduce
Steps to reproduce the behavior:

  1. Install any version of Radeon Software past 21.30.
  2. Use the h264_amf encoder in FFmpeg or run the SimpleEncoder sample included in this repository.

Setup:

  • OS: Arch Linux (also tested on Ubuntu 20.04 LTS)
  • Driver Version: >= 21.40
  • GPU: RX 6700 XT
  • Which component has the issue: Encoder

Tests were done with AMD's proprietary Vulkan driver and not RADV. Using RADV causes a segfault on startup.

Debug Log:
When running ffmpeg -loglevel verbose -i input.mp4 -c:v h264_amf -log_to_dbg true output.mp4

[h264_amf @ 0x562bcbe259c0] AMF initialisation succeeded via Vulkan.
0122-06-06 23:09:34 BE10E040 [AMFEncoderCoreH264]   Error: ../../../../../runtime/src/components/EncoderCore/EncoderCoreH264Impl.cpp(187):Assertion failed:Failed to create service!
0122-06-06 23:09:34 BE10E040 [AMFEncoderCoreH264]   Error: ../../../../../runtime/src/components/EncoderCore/EncoderCoreH264Impl.cpp(319):AMF_ERROR 1 : AMF_FAIL: Failed to create encode service!
0122-06-06 23:09:34 BE10E040 [AMFEncoderCoreH264] Warning: CreateServices failed.
[h264_amf @ 0x562bcbd6b740] CreateComponent(AMFVideoEncoderVCE_AVC) failed with error 1
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

When running SimpleEncoder input.mp4

0122-06-06 23:02:48 E743F740 [AMFEncoderCoreH264]   Error: ../../../../../runtime/src/components/EncoderCore/EncoderCoreH264Impl.cpp(187):Assertion failed:Failed to create service!
0122-06-06 23:02:48 E743F740 [AMFEncoderCoreH264]   Error: ../../../../../runtime/src/components/EncoderCore/EncoderCoreH264Impl.cpp(187):Assertion failed:Failed to create service!
0122-06-06 23:02:48 E743F740 [AMFEncoderCoreH264]   Error: ../../../../../runtime/src/components/EncoderCore/EncoderCoreH264Impl.cpp(319):AMF_ERROR 1 : AMF_FAIL: Failed to create encode service!
0122-06-06 23:02:48 E743F740 [AMFEncoderCoreH264]   Error: ../../../../../runtime/src/components/EncoderCore/EncoderCoreH264Impl.cpp(319):AMF_ERROR 1 : AMF_FAIL: Failed to create encode service!
0122-06-06 23:02:48 E743F740 [AMFEncoderCoreH264] Warning: CreateServices failed.
0122-06-06 23:02:48 E743F740 [AMFEncoderCoreH264] Warning: CreateServices failed.
0122-06-06 23:02:48 E743F740 [SimpleEncoder]   Error: ../../../../public/samples/CPPSamples/SimpleEncoder/SimpleEncoder.cpp(177):AMF_ERROR 1 : AMF_FAIL: CreateComponent(AMFVideoEncoderVCE_AVC) failed
0122-06-06 23:02:48 E743F740 [SimpleEncoder]   Error: ../../../../public/samples/CPPSamples/SimpleEncoder/SimpleEncoder.cpp(177):AMF_ERROR 1 : AMF_FAIL: CreateComponent(AMFVideoEncoderVCE_AVC) failed
SimpleEncoder: ../../../../public/samples/CPPSamples/SimpleEncoder/SimpleEncoder.cpp:177: int main(int, char**): Assertion `0' failed.

Expected behavior
AMF should be able to encode the video successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions