New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 760834 link

Starred by 10 users

Issue metadata

Status: Verified
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

WebGLAquarium with 4000 fish causes pages to become unresponsive

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36
Platform: 9740.0.0 (Official Build) dev-channel squawks test

Example URL:
https://webglsamples.org/aquarium/aquarium.html

Steps to reproduce the problem:
1. Go to https://webglsamples.org/aquarium/aquarium.html
2. Set fish count to 4000
3. Open new window, then move/resize new window so that the WebGLAquarium window can be seen.
4. In the new window, open two crosh tabs (CTRL+ALT+T).

What is the expected behavior?
Crosh tabs should load the ChromeOS developer shell prompt.

What went wrong?
The second crosh tab does not load and a "Pages Unresponsive" message eventually appears.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? N/A 

Did this work before? Yes Browser: 61.0.3153.0; Platform: 9739.0.0 (Official Build) dev-channel squawks test

Does this work in other browsers? N/A

Chrome version: 61.0.3155.0  Channel: dev
OS Version: 9740.0.0
Flash Version: 26.0.0.137

At the point where the second crosh tab doesn't load, tabs other than the WebGLAquarium tab seem to be unresponsive. Lowering the fish count to around 250 or lower seems to be enough to allow other tabs to operate normally again.

This behavior persists into R62, yet this particular R61 image seems to be the first point of failure.
 
20170830_185233.jpg
3.2 MB View Download
Some additional information:
Upgrading/downgrading the kernel version didn't seem to have any effect.

I've also seen this issue appear on Chell and Reef (using R62 images).
Components: OS>Kernel>Graphics
> Lowering the fish count to around 250 or lower seems to be enough to allow other tabs to operate normally again.

What I found especially interesting when Casey showed this to me: lowering the number of WebGL fishes *while other tabs are stuck* unlocks them free again; it allows them to finish opening.

There also seems to be some "sour spot" / number of fishes somewhere in the middle that merely slows down the opening of other tabs (several seconds) without completely blocking them.

Comment 4 by yang...@intel.com, Sep 1 2017

If you start with smaller fish number, can you repro this? If no, this looks to me like a performance issue. Can you trace the CPU usage and FPS when increasing the fish number?
Aquarium is quite a CPU intensive case, and I have some investigations at  crbug.com/755897 . 

Comment 5 by yang...@intel.com, Sep 1 2017

And this is also a regression according to your description. So with a good image, if you increase the fish number, can you also repro this? At  crbug.com/755897 , I have an enhanced version with 10000 fishes at most. 
The CPU usage (using top) and FPS are almost exactly the same for both images. The exceptions being that the 'good' image has increased CPU usage values at 2000 fish (increased from ~100% to ~105%) and 4000 fish (increased from ~105% to ~112%).

Starting with a smaller fish number (using default 50 fish), I could not reproduce this issue.

With the 'good' image, and following the reproduction steps, I observed that the newly-opened tabs were alive and well.


Cc: marc...@chromium.org
@6: if this is a regression, can you bisect it?
@7: I've isolated the issue between two official ChromeOS images (9739.0.0 and 9740.0.0), but further analysis would require checking the browser versions (61.0.3153.0 through 61.0.3155.0), which our team does not have the cycles to do.

Comment 9 by vsu...@chromium.org, Sep 11 2017

Cc: hsiangc@chromium.org
@marcheu: Is this issue same as  bug 757641 ?
@10: I don't think so
Cc: geoffl...@chromium.org
+Geoff who had some perf improvements for webGL apps land in that chrome version I believe and may have more insight into next steps to debug.

https://chromium-review.googlesource.com/c/chromium/src/+/559104



Components: Internals>GPU
I'm not familiar with the ChromeOS enough to debug this.  This page is known for sending lots of GPU commands from the renderer process to the GPU process (proportional to the number of fish) so it's likely starving the other tabs of CPU time.
Cc: vsu...@chromium.org
Labels: -Type-Compat M-63 Type-Bug
Status: Untriaged (was: Unconfirmed)
issue reproduce on eve with:
Chrome version: 63.0.3230.0  Channel: dev
OS Version: 10009.0.0
Flash Version: 27.0.0.159

feedback:
Report ID: 75791689811
Owner: sunn...@chromium.org
Status: Assigned (was: Untriaged)
sunnyps@, sounds like the GPU is being starved by a webgl context. Is this something that could be addressed by future scheduler work?
> future scheduler work?

Before looking at the future, does anyone understand how and why this recent regression happened precisely in Chrome version: 61.0.3155.0 ?
Probably https://chromium.googlesource.com/chromium/src/+/63fbdcc12a7ef762e0652c972986fe74835ba00e ? We coudl test a local checkout before/after this change and see
The GPU scheduler is in that list: https://chromium.googlesource.com/chromium/src/+/63fbdcc12a7ef762e0652c972986fe74835ba00e

I landed a fix recently for a similar issue that was affecting mac. Can you try to reproduce on Canary/Dev 63.0.3238.0? The fix is https://chromium.googlesource.com/chromium/src/+/c98596763f36fd5fcc0c984be67b59f3775b35ac


Status: WontFix (was: Assigned)
Yeah ToT works.
Looking at the very short commit, looks like --disable-gpu-scheduler would be enough to root-cause the regression on affected images, correct?

The correct flag is --disable-features=GpuScheduler
Reproduced on ChromeOS with 63.0.3236.0, tested again and confirmed gone with dev channel update 63.0.3239.7

https://chromium.googlesource.com/chromium/src/+log/63.0.3237.0..63.0.3238.0?n=10000

As mentioned in (duplicate?)  issue 770146 , Ctrl-Shift-I is/was an equivalent and more convenient way to reproduce than Ctrl-Alt-T

As far as I understand the latest discussions and status in  issue 770146 , this won't be fixed in R61 and likely not in R62.

> The correct flag is --disable-features=GpuScheduler

Is there a chrome://flags to test without the cost of switching to developer mode?

There is no chrome://flags switch for this.
Verified on 4 Soraka EVT2 boards. Issue is not observed on 3 boards. Able to open webgl aquarium with 5k and 10k fishes on 10 windows. 

But in 1 board able to open 7 or 8 windows, after which page responsiveness error is observed.

Comment 26 Deleted

OS: Google Chrome 65.0.3287.0 (Platform 10201.0.0-17.12.10)
Able to open WebGL aquarium with 5000 fishes on 10 multiple windows but fps is ~1. Sporadically "page unresponsiveness" issue observed but it is going away automatically after a few seconds and WebGL continues to run fine. FPS drops to 1 or 2 at the time of observing the error


Components: -Internals>GPU -OS>Kernel>Graphics Internals>GPU>Scheduling
Labels: -Pri-2 Pri-1
Status: Started (was: WontFix)
This does happen after all. See internal bug b/67387932.


> This does happen after all.

Comment #20 closed this as "Fixed on ToT; wontfix on older branches". Are you saying that https://bugs.chromium.org/p/chromium/issues/detail?id=770146#c19 wasn't enough to fix the ToT?

Project Member

Comment 30 by bugdroid1@chromium.org, Jan 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/af5912a742121571beccf0af931fe1023fcf46ba

commit af5912a742121571beccf0af931fe1023fcf46ba
Author: Sunny Sachanandani <sunnyps@chromium.org>
Date: Mon Jan 22 23:49:52 2018

gpu: Set high priority for media context.

WebGL context can starve media context because the client waits for
frames to be decoded before submitting a mailbox to the browser. The
scheduler doesn't see a dependency between browser and media contexts so
it doesn't elevate media context priority like it does for WebGL.

Disable the check for trusted channel when creating a high priority
stream because with this change untrusted channels (renderers) can
create high priority streams (media).

R=piman
BUG= 760834 

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I5b001e76ee922b68314190ea4c7b3cc48d013652
Reviewed-on: https://chromium-review.googlesource.com/877414
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531065}
[modify] https://crrev.com/af5912a742121571beccf0af931fe1023fcf46ba/content/common/gpu_stream_constants.h
[modify] https://crrev.com/af5912a742121571beccf0af931fe1023fcf46ba/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/af5912a742121571beccf0af931fe1023fcf46ba/gpu/ipc/service/gpu_channel.cc
[modify] https://crrev.com/af5912a742121571beccf0af931fe1023fcf46ba/gpu/ipc/service/gpu_channel_unittest.cc

Status: Fixed (was: Started)
#29 a variation of this bug occurs with hw decoded video playing in one tab (or media player app) and webgl on another. May not happen to the same extent on all boards.
Labels: -M-63 M-65
Can we get this fix merged back into M65?
Labels: ReleaseBlock-Stable
Labels: Merge-Request-65
Status: Started (was: Fixed)
Ok, requesting merge to M65.
Project Member

Comment 36 by sheriffbot@chromium.org, Jan 26 2018

Labels: -Merge-Request-65 Hotlist-Merge-Approved Merge-Approved-65
Your change meets the bar and is auto-approved for M65. Please go ahead and merge the CL to branch 3325 manually. Please contact milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), bhthompson@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 37 by bugdroid1@chromium.org, Jan 26 2018

Labels: -merge-approved-65 merge-merged-3325
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/db9824fab1f5a6fcad6ce60d10ec02978cc49ff4

commit db9824fab1f5a6fcad6ce60d10ec02978cc49ff4
Author: Sunny Sachanandani <sunnyps@chromium.org>
Date: Fri Jan 26 01:35:44 2018

[merge to m65] gpu: Set high priority for media context.

WebGL context can starve media context because the client waits for
frames to be decoded before submitting a mailbox to the browser. The
scheduler doesn't see a dependency between browser and media contexts so
it doesn't elevate media context priority like it does for WebGL.

Disable the check for trusted channel when creating a high priority
stream because with this change untrusted channels (renderers) can
create high priority streams (media).

R=​piman
BUG= 760834 

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I5b001e76ee922b68314190ea4c7b3cc48d013652
Reviewed-on: https://chromium-review.googlesource.com/877414
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#531065}(cherry picked from commit af5912a742121571beccf0af931fe1023fcf46ba)
Reviewed-on: https://chromium-review.googlesource.com/888018
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/branch-heads/3325@{#105}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
[modify] https://crrev.com/db9824fab1f5a6fcad6ce60d10ec02978cc49ff4/content/common/gpu_stream_constants.h
[modify] https://crrev.com/db9824fab1f5a6fcad6ce60d10ec02978cc49ff4/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/db9824fab1f5a6fcad6ce60d10ec02978cc49ff4/gpu/ipc/service/gpu_channel.cc
[modify] https://crrev.com/db9824fab1f5a6fcad6ce60d10ec02978cc49ff4/gpu/ipc/service/gpu_channel_unittest.cc

Status: Fixed (was: Started)
Status: Verified (was: Fixed)
verified on M-65 build 10323.30.0, 65.0.3325.65 on squawks

Sign in to add a comment