AMF icon indicating copy to clipboard operation
AMF copied to clipboard

Creating encoder component crashes when called after InitVulkan

Open maxest opened this issue 5 years ago • 7 comments

In the encoder sample I changed memoryTypeIn to amf::AMF_MEMORY_VULKAN.

During encoder creation I get a crash with "Exception thrown at 0x00007FF8A2955497 (amdvlk64.dll) in SimpleEncoder.exe: 0xC0000005: Access violation reading location 0x00000228422DC734."

When I put the creation code BEFORE InitVulkan, it returns successfully (but I don't know if it works properly, have not checked that yet).

I thought that maybe the problem was that InitVulkan in the sample is called with NULL but in my app I actually provide legit Vulkan context (which must be working cause decoding works) and it fails in similar fashion: "Exception thrown at 0x00007FF8D2ED0C7A (amfrt64.dll) in MY_APP_NAME.exe: 0xC0000005: Access violation reading location 0x0000000000000000."

maxest avatar Nov 09 '20 16:11 maxest

  • What is "Creation code"? What kind of modifications did you do in the sample, except changing memory type?
  • Which driver version do you have? Did you have the latest?
  • What do you see in debug output?
  • In you application when you create Vulkan context do you get private extensions by calling GetVulkanDeviceExtensions?

MikhailAMD avatar Nov 09 '20 17:11 MikhailAMD

  1. Change of memory type is the only change I have made. By "creation code" I mean: res = g_AMFFactory.GetFactory()->CreateComponent(context1, pCodec, &encoder);

  2. Version: 27.20.12029.1000 Date: 9/9/2020 This is the latest I could get on my Alienware laptop.

  3. Nothing. It crashes before any logging occurs.

  4. Yes. I get 5 extensions.

maxest avatar Nov 09 '20 18:11 maxest

Vulkan encoder component must be created after InitVulkan() call. I cannot repro the problem so far, but I don't have your HW combination. I assume you didn't enable Vulkan debug layers? Is it possible for you to clean up machine from AMD drivers using cleanup utility and reinstall them? (https://www.amd.com/en/support/kb/faq/gpu-601) Could you please create and share crash dump?

MikhailAMD avatar Nov 09 '20 18:11 MikhailAMD

The problem occurs on simple encoder as well so I assume that since it creates a decoder successfully, it should also be able to create an encoder. In our actual app I did make sure debug layers are not turned on, as it prevented me from correctly creating decoder with Vulkan.

I can try cleaning the machine.

The dump is 28 MBs zipped so I couldn't attach it here. I uploaded it here https://srv-store2.gofile.io/download/UU2j0S/SimpleEncoder.zip

maxest avatar Nov 09 '20 19:11 maxest

I have just had one person from the company who has a desktop AMD run the modified encoder. And he does not experience the crash that I do. So there must be something off with my environment.

As I mentioned in the other thread (https://github.com/GPUOpen-LibrariesAndSDKs/AMF/issues/233) I am running a laptop with native NVIDIA gpu but with AMD gpu connected via alienware graphics amplifier. I have already found problems with that setting running some Vulkan samples so it might be kind of a similar issue.

I hope you can get something out of that dump.

maxest avatar Nov 09 '20 21:11 maxest

Yes, I see in the dump the reason for the crash. When fixed it will probably report absence of encoder. And I need to ask questions what is expected in this configuration. Anyway, thanks for the dump, I've opened an internal ticket.

MikhailAMD avatar Nov 09 '20 21:11 MikhailAMD

Could you please retest with the latest public driver?

MikhailAMD avatar Dec 20 '20 23:12 MikhailAMD