GPUOpen-LibrariesAndSDKs / AMF

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

[Bug]: Crash on AWS when calling `InitDX12` on a amf::AMFContext2Ptr context #406

Open DenisTensorWorks opened 1 year ago

DenisTensorWorks commented 1 year ago

Describe the bug Crash on Windows Server 2022 on AWS with AMD Radeon Pro V520 MxGPU when calling "InitDX12" on a amf::AMFContext2Ptr context. This is observed in Unreal Engine as well as AMD AMF sample code. The simplest way to reproduce is to run the AMD AMF Sample project.

To Reproduce Steps to reproduce the behavior:

  1. Clone the https://github.com/GPUOpen-LibrariesAndSDKs/AMF sample;
  2. Open AMF/amf/public/samples/CPPSamples_vs2019.sln in Visual Studio 2019;
  3. The project will check D3D11, so need to modify one line to run D3D12;
  4. In CapabilityManager.cpp, change line 590 from std::wstring capability = L"DX11"; to std::wstring capability = L"DX12";
  5. Change solution platform to x64 (useful for remote debugging);
  6. Right click on CapabilityManager and select build;
  7. Copy CapabilityManager.exe (this can be found in "AMF\amf\bin\vs2019x64Debug") to a AWS instance that matches the specs above;
  8. Start Powershell and run the CapabilityManager.exe. Note it will print a few lines, "DX12: List of adapters"... and "DX12 : Chosen Device 0: Device ID: 7362 [AMD Radeon Pro V520 MxGPU]" But till then terminate. It should print the encoding and decoding capabilities;
  9. If a debugger is attached to the process, it can be observed that the application crashes at line 678: "deviceInit = (pContext2->InitDX12(deviceDX12.GetDevice()) == AMF_OK);"

Setup: AWS instance type: g4ad.xlarge OS: Microsoft Windows Server 2022 Datacenter OS version: 10.0.20348 Build 20348 GPU : AMD Radeon Pro V520 MxGPU Driver: 22.10.01.12-220930a-384126e-WHQLCert_ Driver source: From the ec2-amd-windows-drivers AWS bucket Driver Date: 09/30/2022 Driver version: 30.0.21001.12042

Note: if the project is run with D3D11 set, then "InitDX11" will not crash and the device capabilities will be printed.

Screenshot: image

rhutsAMD commented 10 months ago

The driver crash has been prevented and the fix will be publicly available in the upcoming G4ad Windows driver release for AWS.

DenisTensorWorks commented 10 months ago

Fantastic, thank you @rhutsAMD 🎉

abivolmv commented 8 months ago

I checked and the current driver on the AWS S3 bucket is still the same as in the original post. Is there any information anywhere on when the driver will be released ?

MikhailAMD commented 8 months ago

AWS drivers are not part of regular AMD driver update sequence. Please ask at AWS when they decide to update the driver.

DenisTensorWorks commented 2 weeks ago

Hi @rhutsAMD, would you be able to please check whether the fix was rolled out in the 31.0.21002.2017 version, as it appears to still not be working on that version. Many thanks for your help!