Closed Bug 1461268 Opened 6 years ago Closed 6 years ago

Disable AMD hybrid VP9 decoder

Categories

(Core :: Audio/Video: Playback, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- fixed
firefox60 --- wontfix
firefox61 --- fixed
firefox62 --- fixed

People

(Reporter: jya, Assigned: jya)

References

Details

Attachments

(2 files)

The AMD vp9 decoder performs poorly.

On my local system, a Vega 64 is unable to decode 60fps video without having to drop around 10% of the video frames.

AMD new hardware devices will have a native VP9 decoder, and one that's available via the official VP9 microsoft MFT.

Let's disable the AMD VP9 MFT for now...
I doubt this would be part of a chemspill/point release.  Can we do so soon and uplift to beta?  We may want to consider it for ESR60 before it ships.
Priority: -- → P2
Flags: needinfo?(jyavenard)
I think we may need some smarts behind disabling it. Some people with AMD APU mentioned that it makes Firefox works much better than Chrome on YouTube.

it seems that the gain are mostly null for people with discrete GPU.

Paul, any suggestions here?

How could we detect if it's an APU or not?
Flags: needinfo?(jyavenard)
Flags: needinfo?(paul.blinzer)
Recent AMD driver releases should have removed the Hybrid VP9 support already. Which driver version are you running?

The benefits for some of the older APU are somewhat smaller nowadays and there are workarounds on these older devices to get similar power/perf benefits. Therefore we don't plan to maintain that Hybrid VP9 decode support going forward. 

The current Ryzen based APUs have native VP9 HW decode support through the standard DXVA enabled Microsoft VP9 MFT now.
That support is working and should stay active with on AMD GPUs if HW acceleration support is indicated.
Blocks: 1461166
Assignee: nobody → jyavenard
Is this[0] the only hardware decode path we have for VP9 on Windows at the moment? Or is there the generic Microsoft MFT approach mentioned above that will be fallen back upon?

If it is the only path do we need any follow up to rectify concerns in comment 2?
Flags: needinfo?(jyavenard)
There's 2 VP9 hardware decoding paths with the WMFVideoDecoder

1- Microsoft official VP9 MFT
2- AMD private VP9 MFT
For historical (and performance) reasons, AMD had disabled access to the Microsoft VP9 MFT on hardware using the hybrid decoder. Hybrid because there's no dedicated VP9 decoding asic (unlike intel and nvidia). Instead they use a licensed OpenCL decoder (if my understanding is correct).
Later on, they also limited the AMD VP9 MFT to stream 720p and above.

The WMFVideoDecoder first check the presence of the AMD VP9 decoder: https://searchfox.org/mozilla-central/source/dom/media/platforms/wmf/WMFVideoMFTManager.cpp#669 and if this succeeds, it uses it.

If not, it attempts to load the Microsoft VP9 MFT (which will always succeed on Windows 10). The WMFVideoDecoder then checks if that VP9 MFT is link to a dxva (hardware) decoder and will fail if not.
The reason for this was to prefer the ffvp9 software decoder over the microsoft one (which uses the less performant libvpx)

As such, disabling the AMD VP9 decoder will only affect AMD cards which allow the hybrid decoder.

New AMD gfx cards and APU, that has a full hardware decoder now loads via the official AMD VP9 MFT and won't be affected by these change.

My finding with recent AMD drivers is that it performs worse than the software decoder, and cause a massive power usage (on my system, I go from 170W at the power point to 350W when the AMD decoder is in use)

See bug 1417241.

Chrome never enabled the AMD VP9 hybrid decoder by default for those same reasons.
Flags: needinfo?(jyavenard)
Appreciate the explanation, think that clears up the questions I had.
according to bug 1461268 comment 3, AMD has even removed the hybrid decoder from their drivers.
Flags: needinfo?(paul.blinzer)
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fa8a67c2f91b
P1. Disable AMD VP9 decoder. r=bryce
https://hg.mozilla.org/integration/autoland/rev/9a8839ee6c9c
P2. Bump benchmark version ID. r=bryce
https://hg.mozilla.org/mozilla-central/rev/fa8a67c2f91b
https://hg.mozilla.org/mozilla-central/rev/9a8839ee6c9c
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Comment on attachment 8980279 [details]
Bug 1461268 - P1. Disable AMD VP9 decoder.

Approval Request Comment
[Feature/Bug causing the regression]: regression found in newer AMD drivers
[User impact if declined]: Terrible playback experience, mostly impact YouTube
[Is this code covered by automated tests?]: no
[Has the fix been verified in Nightly?]: manually verified
[Needs manual test from QE? If yes, steps to reproduce]: Need testing on an AMD 4xx and later (5xx and vega included). Install the media devtools extension, go visit YouTube ensure that the video decoder is using either ffvp9 or the Microsoft VP9 MFT: there's a text saying so)
[List of other uplifts needed for the feature/fix]: both patch to uplift. The 2nd patch ensure we re-run the VP9 benchmark to better assess if VP9 will play smoothly on the machine. If not people we revert back to h264 which is almost always hardware accelerated.
[Is the change risky?]: no
[Why is the change risky/not risky?]: we disable a feature that no-one else had supported before, reverting to default code
[String changes made/needed]: none
Attachment #8980279 - Flags: approval-mozilla-esr60?
Attachment #8980279 - Flags: approval-mozilla-beta?
Comment on attachment 8980279 [details]
Bug 1461268 - P1. Disable AMD VP9 decoder.

Approved for 61.0b9.
Attachment #8980279 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment on attachment 8980279 [details]
Bug 1461268 - P1. Disable AMD VP9 decoder.

fix a video playback perf issue, approved for 60.1esr
Attachment #8980279 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Is this still necessary?
I experience slightly choppy playback decoding 4K30fps on CPU (even with High Performance power plan) and relatively high CPU usage, but after setting media.wmf.amd.vp9.enabled to true playback is perfect with 0 dropped frames and marginal CPU usage, and GPU power usage stays at 60W on average and goes back down to idle amounts after playback has ended.
Card is Vega 64, driver version is 18.10.21.01.
AMD themselves is no longer supporting it, and recent drivers upgrade have completely borked it. We removed it completely. Also the power consumption with a Vega 64 was totally insane. Over 200W extra
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: