Webgl context lost

I created a new Model View Start Kit project and added to it posteffect-bokeh.js (from the engine repo engine/scripts/post-effects ) and attached that to the camera.

If I zoom in and out using the orbit camera controls a few times then I quite reliably get a webgl context lost error.

If I reload the editor I see this at the bottom of the editor window. ( and also a warning to post the error on the forum )

https://playcanvas.com/project/927260/overview/webglcontextlost

I can’t make this happen with post-effect-edgedetect.js. ( bokeh uses depth buffer and edgedetect doesn’t ? )

Screenshot 2022-05-13 at 09.28.43

I tried to repro on my MacBook Pro 2019 and no luck.
macOS Monterey 12.3.1 as well.

Interesting. Is there any more info I can collect for you?

Can you try a classic, restart Chrome and restart computer to see if it still happens after that?

What I think is happening: your GPU / graphics driver crashes when rendering that cube for some reason. That takes down whole Webgl for the browser (all tabs), which causes lost context to be triggered.

There are some perhaps not very well handled cases where Editor still tries to use the picker during that time, which crashes.

But the real problem is that your browser no longer has functioning Webgl, and so not much can be done. Restart your Mac might help.

Hi guys

I can still repro the error after Chrome restart and Mac Reboot.

In case it is relevant when the error occurs the editor tab inspector shows

Also this project also shows the error.

https://playcanvas.com/project/753116/overview/outline-post-process

I can trigger the error by manually triggering the device lost. And this can be fixed to not print any errors. But the Webgl of the browser no longer seems to work in your case, and so the Editor will not render again.

For some reason your gpu / drivers are giving up / crashing.
At that point, most likely no webgl app would work in other tabs either.

But I dont have any advice on what can be happening there. On windows, the typical advice would be to make sure your drivers are up to date.

Can you reproduce it on any other devices / macs? I suspect not.

I can reproduce on both another iMac, and another MacBookPro.

iMac:



s3

MacBookPro:



m3

I can’t repro it here on my Macbook Pro either. Same spec as Martin but different OS
image

Does it happen in Firefox or Safari as well?

I tried a lot longer … and still cannot reproduce (the device lost in the launched application). I tried zooming, spinning, resizing window … memory use does not go up, so no leak that I can see.
Any Chrome plugins perhaps?

Only on one of the three failing Macs
Screenshot 2022-05-13 at 13.37.30

I’ll try later but I’m busy until 5pm

I did have an issue months ago where the Editor would keep losing WebGL context in Chrome and I couldn’t pinpoint the issue.

After a few a while (and Chrome and OS updates later) it just went away.

I couldn’t reproduce it on other people’s laptops either :confused:

My house must be cursed :-(.
I wonder what the difference can be between your macs and my macs?

  1. I am launching from the editor while logged into in my own account.
  2. You may have more powerful macs/gpus? I mentioned that I could not produce the error with the edgedetect post effect but can with bokeh. Could it be that bokeh puts more demand on resources, and therefore your macs are ok but mine aren’t?

I doubt 2. is the reason. Ours aren’t that much more powerful or the effect would be that problematic that an i5 with a dedicated GFX card would crash the context

If I select prefer WebGL 1.0 then I cannot reproduce the error.

I’ll try disabling Chrome plugins, and other browser later.

You could also try on the last version of Chrome Canary - perhaps there was some error in Chrome, and there’s a fix there already?
By the way, I’m on Chrome Version 101.0.4951.54 (Official Build) (x86_64)

I’m on Version 101.0.4951.64 (Official Build) (x86_64) so yes maybe an error was introduced in this chrome build.

Here’s some more info:

Disabled Chrome plugins but this does not solve the issue.

Chrome Canary Version 103.0.5060.0 (Official Build) canary (x86_64) does still show the error

FireFox 100.0 is OK and does not show the error

Safari 15.4 is OK and does not show the error. ( But the post effect is not rendering like Chrome and FireFox - in the console it says anti aliasing has been turned off due to issues in Apple web kit 15.4. I wonder if this effects the post effect ? )

Chome 101.0.4951.64 ( released May 10th ) shows the problem - on my 3 macs at least

Chome 101.0.4951.54 ( released May 2nd ) doesn’t show the problem on mvaligursky’s mac

Does anyone at playcanvas have Chome 101.0.4951.64 yet?