GPUOpen-LibrariesAndSDKs / AMF

The Advanced Media Framework (AMF) SDK provides developers with optimal access to AMD devices for multimedia processing
Other
616 stars 151 forks source link

[Bug]: AMF SimpleEncoder H.264 encoding fails on AMD Ryzen 5 8500G with Radeon 740M Graphics #513

Open JamesAAA opened 2 weeks ago

JamesAAA commented 2 weeks ago

Describe the bug When use AMF SimpleEncoder for H.264 encoding, the encoding doesn't work with error message "AMF_ERROR 1 : AMF_FAIL: encoder->Init() failed". Using FFMPEG encoding with command "ffmpeg.exe -s 1920x1080 -pix_fmt yuv420p -i test.yuv -c:v h264_amf output.mp4" has the same fail. However, the GPU encoding of AMF SimpleEncoder works well on AMD Ryzen 7 7700X.

To Reproduce Steps to reproduce the behavior:

  1. Compile SimpleEncoder project of AMF SDK to generate SimpleEncoder.exe.
  2. Run SimpleEncoder.exe on AMD Ryzen 5 8500G.
  3. Encoding fails with message "AMF_ERROR 1 : AMF_FAIL: encoder->Init() failed"

Setup (please complete the following information):

Debug Log (please upload or paste):

Use DX11:

2024-11-06 15:03:22.950      8DC [AMFEncoderCoreBaseImpl] Warning: Failed to QueryThroughput()!
2024-11-06 15:03:22.951      8DC +1
2024-11-06 15:03:22.951      8DC [EncodeQueueWinImpl]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncodeQueueWinImpl.cpp(455):EncodeQueueServiceWin::QueueTypeFallback() - Cannot find supported queue type.
2024-11-06 15:03:22.951      8DC [EncodeQueueWinImpl]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncodeQueueWinImpl.cpp(409):AMF_ERROR 1 : AMF_FAIL: EncodeQueueServiceWin::CreateEncodeQueue(): Queue type is unsupported.
2024-11-06 15:03:22.952      8DC [AMFEncoderCoreH264]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncoderCoreH264Impl.cpp(824):AMF_ERROR 1 : AMF_FAIL: Failed to CreateQueue()!
2024-11-06 15:03:22.953      8DC [AMFEncoderCoreH264]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncoderCoreH264Impl.cpp(1041):AMF_ERROR 1 : AMF_FAIL: InitInternal(): Failed to create Encoder!
2024-11-06 15:03:22.953      8DC [AMFEncoderCoreH264]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncoderCoreH264Impl.cpp(403):AMF_ERROR 1 : AMF_FAIL: _Init() - Failed
2024-11-06 15:03:22.953      8DC [SimpleEncoder]   Error: D:\AMD\AMF-master\AMF-master\amf\public\samples\CPPSamples\SimpleEncoder\SimpleEncoder.cpp(206):AMF_ERROR 1 : AMF_FAIL: encoder->Init() failed
AMFVideoEncoderVCE_AVC encode failed

Use Vulkan:

2024-11-06 15:05:47.055     2334 [EncodeQueuePalImpl]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncodeQueuePalImpl.cpp(1009):PAL failed with result = -0x00000009: Pal::IDevice::QueryVideoBandwidth() failed
2024-11-06 15:05:47.055     2334 [AMFEncoderCoreBaseImpl] Warning: Failed to QueryThroughput()!
2024-11-06 15:05:47.056     2334 [EncodeQueuePalImpl]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncodeQueuePalImpl.cpp(1009):PAL failed with result = -0x00000009: Pal::IDevice::QueryVideoBandwidth() failed
2024-11-06 15:05:47.056     2334 [AMFEncoderCoreBaseImpl] Warning: Failed to QueryThroughput()!
2024-11-06 15:05:47.057     2334 [EncodeQueuePalImpl]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncodeQueuePalImpl.cpp(982):EncodeQueueServicePalImpl::QueueTypeFallback() - Cannot find supported queue type.
2024-11-06 15:05:47.057     2334 [EncodeQueuePalImpl]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncodeQueuePalImpl.cpp(944):AMF_ERROR 1 : AMF_FAIL: EncodeQueueServicePalImpl::CreateEncodeQueue(): Queue type is unsupported.
2024-11-06 15:05:47.057     2334 [AMFEncoderCoreH264]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncoderCoreH264Impl.cpp(824):AMF_ERROR 1 : AMF_FAIL: Failed to CreateQueue()!
2024-11-06 15:05:47.058     2334 [AMFEncoderCoreH264]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncoderCoreH264Impl.cpp(1041):AMF_ERROR 1 : AMF_FAIL: InitInternal(): Failed to create Encoder!
2024-11-06 15:05:47.058     2334 [AMFEncoderCoreH264]   Error: c:\constructicon\builds\gfx\six\24.20\drivers\amf\stable\runtime\src\components\EncoderCore\EncoderCoreH264Impl.cpp(403):AMF_ERROR 1 : AMF_FAIL: _Init() - Failed
2024-11-06 15:05:47.059     2334 [SimpleEncoder]   Error: D:\AMD\AMF-master\AMF-master\amf\public\samples\CPPSamples\SimpleEncoder\SimpleEncoder.cpp(206):AMF_ERROR 1 : AMF_FAIL: encoder->Init() failed
AMFVideoEncoderVCE_AVC encode failed

Use ffmpeg:

ffmpeg.exe -s 1920x1080 -pix_fmt yuv420p -i test.yuv -c:v h264_amf output.mp4

[h264_amf @ 000001f108556840] encoder->Init() 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
Conversion failed!

Expected behavior The GPU encoding can work on AMD Ryzen 5 8500G.

Screenshots N/A

Additional context N/A

MikhailAMD commented 2 weeks ago

We tried the same Ryzen and it worked for us. Could you please try few things:

JamesAAA commented 2 weeks ago

Thank you for your reply. I tried to run CapabilityManager and DxDiag. Please help to check the output.

CapabilityManager: CapabilityManager.txt DxDiag: DxDiag.txt

Regarding item 2 and 4 that you mentioned, I am waiting for the response from client. I will let you know once I get the result.