High CPU usage after CEF upgrade

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

High CPU usage after CEF upgrade

Postby rado » Fri Nov 20, 2020 2:37 pm

After I've upgraded CEF from 79.0.10 to 86.0.17 (or 86.0.19 or 86.0.21) (Windows) some users experience unfunctional browser and high CPU usage (renderer process fully exhausts one CPU core and no page loads).
I cannot reproduce it on my machine (Windows 10) but I can reproduce it on testing virtual machine (Windows 10).
When I try cefclient, it works.
It seems like there is some problem with GPU. In profiler it seems lot of time in renderer process is spent in viz::Gpu::EstablishGpuChannelSync().
Last lines in Debug log (it does not increase after this):

[1120/174007.380:INFO:cpu_info.cc(53)] Available number of cores: 2
[1120/174007.396:VERBOSE1:gpu_init.cc(340)] gl::init::InitializeStaticGLBindingsOneOff failed
[1120/174007.429:ERROR:paint_controller.cc(634)] PaintController::FinishCycle() completed
[1120/174007.462:ERROR:viz_main_impl.cc(229)] Exiting GPU process due to errors during initialization
[1120/174007.545:VERBOSE1:script_context.cc(257)] Created context:
extension id: (none)
frame: 23961EF0
URL:
context_type: WEB_PAGE
effective extension id: (none)
effective context type: WEB_PAGE
[1120/174007.545:VERBOSE1:script_context.cc(257)] Created context:
extension id: (none)
frame: 00000000
URL:
context_type: UNSPECIFIED
effective extension id: (none)
effective context type: UNSPECIFIED
[1120/174007.545:VERBOSE1:dispatcher.cc(373)] Num tracked contexts: 1
[1120/174007.596:VERBOSE1:gpu_init.cc(340)] gl::init::InitializeStaticGLBindingsOneOff failed
[1120/174007.627:ERROR:viz_main_impl.cc(229)] Exiting GPU process due to errors during initialization
[1120/174007.627:ERROR:browser_gpu_channel_host_factory.cc(167)] Failed to launch GPU process.
[1120/174010.633:VERBOSE1:configured_proxy_resolution_service.cc(1138)] Failed configuring with PAC script, falling-back to manual proxy servers.
[1120/174010.633:VERBOSE1:configured_proxy_resolution_service.cc(1138)] Failed configuring with PAC script, falling-back to manual proxy servers.


When I use "--in-process-gpu" and I navigate to some site, sometimes it works and when I restart browser at the same site it fails, it is roughly 50:50. When it fails the log is getting huge and looks like this:

[1120/202427.396:ERROR:dxva_video_decode_accelerator_win.cc(1334)] DXVAVDA fatal error: Could not load mf.dll: The specified module could not be found. (0x7E)
[1120/202427.396:ERROR:gpu_channel_manager.cc(749)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[1120/202427.396:ERROR:shared_image_stub.cc(470)] SharedImageStub: unable to create context
[1120/202427.396:ERROR:gpu_channel.cc(449)] GpuChannel: Failed to create SharedImageStub
[1120/202427.583:ERROR:gpu_channel_manager.cc(749)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[1120/202427.583:ERROR:shared_image_stub.cc(470)] SharedImageStub: unable to create context
[1120/202427.583:ERROR:gpu_channel.cc(449)] GpuChannel: Failed to create SharedImageStub
[1120/202427.583:ERROR:gpu_channel_manager.cc(749)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[1120/202427.583:ERROR:shared_image_stub.cc(470)] SharedImageStub: unable to create context
[1120/202427.583:ERROR:gpu_channel.cc(449)] GpuChannel: Failed to create SharedImageStub
[1120/202427.912:ERROR:gpu_channel_manager.cc(749)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[1120/202427.912:ERROR:shared_image_stub.cc(470)] SharedImageStub: unable to create context
[1120/202427.912:ERROR:gpu_channel.cc(449)] GpuChannel: Failed to create SharedImageStub



When I use "--disable-gpu", it seems to be working. I think I can live with disabled GPU, but I'm not sure whether there will be big performance loss or something else stops working because of disabled GPU (in future versions).
The only line in log is this (log with WARNING level only):
[1120/203251.802:ERROR:viz_main_impl.cc(229)] Exiting GPU process due to errors during initialization

which is strange that GPU process is exiting although it is not supposed to start (and I cannot see it in task manager).

Do you have idea what could be wrong? Thank you.
rado
Expert
 
Posts: 145
Joined: Wed Oct 05, 2011 3:32 am

Re: High CPU usage after CEF upgrade

Postby hyzerfool » Fri Nov 19, 2021 3:14 pm

We've hit the same situation. I attached a debugger and saw it was in EstablishGpuChannelSync, searched for it, and ended up here...

I'm waiting for a response from testers, but for me it's consistent that if I add disable-gpu then I don't get the renderer process at 100% CPU and if I remove the flag I do.

Thanks for the suggestion. In the past year have you come to a conclusion that disabling the GPU has a noticeable impact on performance?
hyzerfool
Techie
 
Posts: 23
Joined: Wed May 13, 2015 2:37 pm

Re: High CPU usage after CEF upgrade

Postby hyzerfool » Fri Nov 19, 2021 3:28 pm

Screenshot 2021-11-19 152520.png
Screenshot 2021-11-19 152520.png (41.72 KiB) Viewed 4301 times


Whether what's worth anything to anyone, I have no idea. But that's what Process Hacker shows for threads in the render exe that's churning the processor.
hyzerfool
Techie
 
Posts: 23
Joined: Wed May 13, 2015 2:37 pm

Re: High CPU usage after CEF upgrade

Postby amaitland » Fri Nov 19, 2021 3:44 pm

Make sure your app.manifest has the relevant compatibility entries.

https://github.com/cefsharp/CefSharp.Mi ... nifest#L55
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: High CPU usage after CEF upgrade

Postby amaitland » Mon Nov 22, 2021 10:19 pm

I'd also suggest loading chrome://gpu in the browser to check the GPU status
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 37 guests