Open Bug 1856785 Opened 3 years ago Updated 2 years ago

WebRender IPC Time Out on AMD Integrated GPU in Windows 10

Categories

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

Firefox 120
x86_64
Windows 10
defect

Tracking

()

120 Branch
Iteration:
120.1 - Sep 25 - Oct 6
Tracking Status
firefox120 --- fixed

People

(Reporter: kaoruyumika, Assigned: alwu)

Details

Attachments

(8 files, 1 external file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/120.0

Steps to reproduce:

just open the browser

Actual results:

WebRender switch to Software mode because GPU-Process having IPC Time out on version 120 nightly even tho on 119 its still working (last month 25th build)

Expected results:

WebRender working normally, i managed to "fix it" by changin this in about:config :
layers.gpu-process.ipc_reply_timeout_ms
layers.gpu-process.stable.min-uptime-ms
layers.gpu-process.startup_timeout_ms
by adding extra 0 on them, but the startup is so slow

Iteration: --- → 120.1 - Sep 25 - Oct 6
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64

The Bugbug bot thinks this bug should belong to the 'Core::Graphics' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics
Product: Firefox → Core

Could you take a profile of the slowness using the profiler https://profiler.firefox.com/ using the graphics preset?

And could you upload a copy of your about:support?

Flags: needinfo?(kaoruyumika)

Adding to triage list for us to take a look at when a profile is posted.

Blocks: gfx-triage
Severity: -- → S2
Flags: needinfo?(kaoruyumika)

uploaded two startup profilling and two copied about:support, is that all i need to provide?

I'm not exactly sure what's going on, but it does look like that profile clearly demonstrates the problem, thanks!

The stack trace from the GPU process seems to spend a huge amount of time in the callstack below. Markus / Sotaro, any ideas on what might cause this, or who would be a good person to investigate further?

ZwWaitForSingleObject [ntdll.dll]
WaitForSingleObjectEx [KERNELBASE.dll]
mozilla::mscom::EnsureMTA::SyncDispatchToPersistentThread(nsIRunnable*) [ipc/mscom/EnsureMTA.cpp]
mozilla::mscom::EnsureMTA::SyncDispatch(nsCOMPtr<nsIRunnable>&&, mozilla::mscom::EnsureMTA::Option) [ipc/mscom/EnsureMTA.cpp]
mozilla::mscom::EnsureMTA::EnsureMTA(mozilla::WMFDecoderModule::Init::<lambda_28>&&, mozilla::mscom::EnsureMTA::Option) [ipc/mscom/EnsureMTA.h]
mozilla::WMFDecoderModule::Init(mozilla::WMFDecoderModule::Config) [dom/media/platforms/wmf/WMFDecoderModule.cpp]
mozilla::gfx::ReportHardwareMediaCodecSupportIfNeeded() [gfx/ipc/GPUParent.cpp]
mozilla::gfx::GPUParent::RecvUpdateVar::<lambda_9>::operator()() const [gfx/ipc/GPUParent.cpp]
mozilla::ScopeExit<`lambda at /builds/worker/checkouts/gecko/gfx/ipc/GPUParent.cpp:543:7'>::~ScopeExit() [mfbt/ScopeExit.h]
mozilla::gfx::GPUParent::RecvUpdateVar(mozilla::gfx::GfxVarUpdate const&) [gfx/ipc/GPUParent.cpp]
mozilla::gfx::PGPUParent::OnMessageReceived(IPC::Message const&) [ipc/ipdl/PGPUParent.cpp]
PGPU::Msg_UpdateVar
mozilla::ipc::MessageChannel::DispatchAsyncMessage(mozilla::ipc::ActorLifecycleProxy*, IPC::Message const&) [ipc/glue/MessageChannel.cpp]
mozilla::ipc::MessageChannel::DispatchMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::UniquePtr<IPC::Message,mozilla::DefaultDelete<IPC::Message> >) [ipc/glue/MessageChannel.cpp]
mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::ipc::MessageChannel::MessageTask&) [ipc/glue/MessageChannel.cpp]
mozilla::ipc::MessageChannel::MessageTask::Run() [ipc/glue/MessageChannel.cpp]
mozilla::RunnableTask::Run() [xpcom/threads/TaskController.cpp]
mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex &> const&) [xpcom/threads/TaskController.cpp]
Task PGPU::Msg_UpdateVar
mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex &> const&) [xpcom/threads/TaskController.cpp]
mozilla::TaskController::ProcessPendingMTTask(bool) [xpcom/threads/TaskController.cpp]
mozilla::TaskController::TaskController::<lambda_6>::operator()() const [xpcom/threads/TaskController.cpp]
mozilla::detail::RunnableFunction<`lambda at /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:221:7'>::Run() [xpcom/threads/nsThreadUtils.h]
nsThread::ProcessNextEvent(bool, bool*) [xpcom/threads/nsThread.cpp]
NS_ProcessNextEvent(nsIThread*, bool) [xpcom/threads/nsThreadUtils.cpp]
mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) [ipc/glue/MessagePump.cpp]
MessageLoop::RunInternal() [ipc/chromium/src/base/message_loop.cc]
MessageLoop::RunHandler() [ipc/chromium/src/base/message_loop.cc]
MessageLoop::Run() [ipc/chromium/src/base/message_loop.cc]
nsBaseAppShell::Run() [widget/nsBaseAppShell.cpp]
nsAppShell::Run() [widget/windows/nsAppShell.cpp]
XRE_RunAppShell() [toolkit/xre/nsEmbedFunctions.cpp]
mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) [ipc/glue/MessagePump.cpp]
MessageLoop::RunInternal() [ipc/chromium/src/base/message_loop.cc]
MessageLoop::RunHandler() [ipc/chromium/src/base/message_loop.cc]
MessageLoop::Run() [ipc/chromium/src/base/message_loop.cc]
XRE_InitChildProcess(int, char**, XREChildData const*) [toolkit/xre/nsEmbedFunctions.cpp]
mozilla::BootstrapImpl::XRE_InitChildProcess(int, char**, XREChildData const*) [toolkit/xre/Bootstrap.cpp]
XRE_InitChildProcess
content_process_main(mozilla::Bootstrap*, int, char**) [ipc/contentproc/plugin-container.cpp]
NS_internal_main(int, char**, char**) [browser/app/nsBrowserApp.cpp]
wmain(int, wchar_t**) [toolkit/xre/nsWindowsWMain.cpp]
invoke_main() [/builds/worker/workspace/obj-build/browser/app/D:/a/_work/1/s/src/vctools/crt/vcstartup/src/startup/exe_common.inl]
__scrt_common_main_seh() [/builds/worker/workspace/obj-build/browser/app/D:/a/_work/1/s/src/vctools/crt/vcstartup/src/startup/exe_common.inl]
BaseThreadInitThunk [KERNEL32.DLL]
RtlUserThreadStart [ntdll.dll]
(root)
Flags: needinfo?(sotaro.ikeda.g)
Flags: needinfo?(mstange.moz)

Could you capture another startup profile with an adjusted thread filter so that we can see what's happening on the COM MTA thread that's launched here? To do this, please set the MOZ_PROFILER_STARTUP_FILTERS environment variable to GeckoMain,Compositor,Renderer,DOM Worker,COM MTA . Thanks!

Flags: needinfo?(mstange.moz) → needinfo?(kaoruyumika)

There was a change around WMFDecoderModule in 120 by Bug 1853448. I wonder if the change might be related to the problem.

:alwu, can you comment to the problem?

Flags: needinfo?(alwu)

Sure, I will take a look on this tomorrow.

Assignee: nobody → alwu
Flags: needinfo?(alwu)
Flags: needinfo?(kaoruyumika)

(In reply to Markus Stange [:mstange] from comment #10)

Could you capture another startup profile with an adjusted thread filter so that we can see what's happening on the COM MTA thread that's launched here? To do this, please set the MOZ_PROFILER_STARTUP_FILTERS environment variable to GeckoMain,Compositor,Renderer,DOM Worker,COM MTA . Thanks!

here another profile using said env variables

As we will need to re-initialize the wmf decoder module, which takes
longer time sometime resulting IPC timeout. Therefore, make it async in
order to not interfere IPC response.

(In reply to kaoruyumika from comment #14)

here another profile using said env variables

Thanks, unfortunately the GPU process isn't included in that profile. It may have timed out. Sorry to bother you again, but could you get another profile and set devtools.performance.recording.child.timeout_s to 60 on about:config before you capture the profile?

Flags: needinfo?(kaoruyumika)
No longer blocks: gfx-triage

Team feels this is not a Graphics issue. Trying IPC for some evaluation.

Component: Graphics → IPC
Flags: needinfo?(sotaro.ikeda.g)

It seems like media bug.

Component: IPC → Audio/Video: Playback
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/51be95305456 make reporting telemetry async. r=sotaro
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
Attached file profile with build —
Flags: needinfo?(kaoruyumika)

profiles when the webrender is working properly

(In reply to Markus Stange [:mstange] from comment #17)

(In reply to kaoruyumika from comment #14)

here another profile using said env variables

Thanks, unfortunately the GPU process isn't included in that profile. It may have timed out. Sorry to bother you again, but could you get another profile and set devtools.performance.recording.child.timeout_s to 60 on about:config before you capture the profile?

uploaded two more profiles (one when its not working / software mode and the other when its working), with build 20231006152733 the issues seems to be worsen that even with the increased ipc timelimit workaround sometimes the webrender would still run as "Software".

Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---

The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Add Ni to check it again.

Flags: needinfo?(alwu)

Would you mind help me try whether this issue still exists on today's Nightly? If so, could you help me capture another profile again? Thanks!

Flags: needinfo?(alwu) → needinfo?(kaoruyumika)

(In reply to Alastor Wu [:alwu] from comment #28)

Could you also help me verify if this two builds [1] work for you? Thanks!

[1] Download target.zip
https://firefox-ci-tc.services.mozilla.com/tasks/cKDwU_NiQh6pRPdGsV93Ow#artifacts
https://firefox-ci-tc.services.mozilla.com/tasks/RPID5ZMtQueYMOKBP_A7VA#artifacts

hi, thank you for this.. my apologize for this to be late reply but buildid 20231010191407 / https://firefox-ci-tc.services.mozilla.com/tasks/RPID5ZMtQueYMOKBP_A7VA#artifacts seems to have fixed the issue.
i double checked it with build 20231010190410 or the more recent 121.0a1 (2023-11-04), the bug still occured on this two while 119.0a1orbuildid 20231010191407 will just work fine.

Flags: needinfo?(kaoruyumika)

however while 20231010190410 solve the startup issue and properly use WebRender with GPU, the hw video decoding seems to be completely broken as it only show SOFTWARE mode on about:support, the performance is also slower compared to 119.0a1 which is properly working.
for now, ill just let this machine run on 119.0a1.

ah i am sorry, not 20231010190410 but 20231010191407 (i copied wrong buildid)

Severity: S2 → S3

okay, i found out the cause.. apparently the browser freeze on startup due Windows HEVC Extension (https://apps.microsoft.com/detail/9NMZLZ57R3T7), the fix is either to uninstall this or reinstalling it and test if that work, this seems to be Microsoft/Windows issue than Firefox.
is there anything that can be done in the browser?, like if the HEVC media extension isnt responding (seems to be the case) can it just skip it and treat it as if the HEVC decoding is failing?

for context the PC thats has its firefox browser browser are perfectly capable on playing HEVC video with hw acceleration decoding, its just that the Microsoft HEVC is kinda dodgy (had to reinstall couple times to get it working), i also found that couples PC are also affected and they're all running recent Windows 10 with HEVC Extension installed on them.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: