# Webgl context lost

**URL:** <https://forum.playcanvas.com/t/webgl-context-lost/25688>\
**Category:** Help & Support\
**Tags:** graphics\
**Created:** [May 13, 2022, 8:34am UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688 "2022-05-13T08:34:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 8:34am UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/1 "2022-05-13T08:34:55Z")

</div>

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.

 ![Screenshot 2022-05-13 at 09.14.45](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/4/f/4fc4e4df117239e73956e1ab8fddcffbf70b8ab3.png)

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 )

 ![Screenshot 2022-05-13 at 09.30.55](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/1/8/1877252843300532566deac84dd85feac99f5bed.png)

[https://playcanvas.com/project/927260/overview/webglcontextlost](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.25.52](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/0/3/03fe8ba7effce4609ae8e3f199af47c2313a7291.jpeg)

 ![Screenshot 2022-05-13 at 09.25.35](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/c/0/c0f703066f4610930651468c559716a7d5bca442.jpeg)

![Screenshot 2022-05-13 at 09.28.43](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/f/8/f8a2d73d3ea0e8af53e0ac8911bf0aa6301cdc6f.png)

---

<div class="post-metadata">

**Author:** ![mvaligursky](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mvaligursky/32/11681_2.png) [@mvaligursky](https://forum.playcanvas.com/u/mvaligursky)\
**Post date:** [May 13, 2022, 9:27am UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/2 "2022-05-13T09:27:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 9:49am UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/3 "2022-05-13T09:49:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [May 13, 2022, 10:00am UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/4 "2022-05-13T10:00:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mvaligursky](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mvaligursky/32/11681_2.png) [@mvaligursky](https://forum.playcanvas.com/u/mvaligursky)\
**Post date:** [May 13, 2022, 10:13am UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/5 "2022-05-13T10:13:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 10:23am UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/6 "2022-05-13T10:23:35Z")

</div>

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

 ![Screenshot 2022-05-13 at 11.15.25](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/a/6/a61adad70385edeb9b07a854082de2830dac2ee9.png)

Also this project also shows the error.

[https://playcanvas.com/project/753116/overview/outline-post-process](https://playcanvas.com/project/753116/overview/outline-post-process)

---

<div class="post-metadata">

**Author:** ![mvaligursky](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mvaligursky/32/11681_2.png) [@mvaligursky](https://forum.playcanvas.com/u/mvaligursky)\
**Post date:** [May 13, 2022, 10:30am UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/7 "2022-05-13T10:30:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 12:17pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/8 "2022-05-13T12:17:52Z")

</div>

> [@mvaligursky](#):
>
> Can you reproduce it on any other devices / macs? I suspect not.

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

iMac:

 ![s1](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/9/5/95e52df04f870b4c19c68d522592350df84d9cae.jpeg)  
 ![s2](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/d/c/dc26ac9bab43cbf53c237e864b6b7c547842af06.jpeg)  
 ![s3](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/2/5/2501f53f665d7bd52fec5516932c0b6f529fb909.jpeg)

MacBookPro:

 ![m1](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/e/f/efea5c1fce94cbc92d95442b345969a1bd510e14.jpeg)  
 ![m2](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/2/b/2b2b1135c3967170b0916e06fe798562215e861e.jpeg)  
 ![m3](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/8/b/8b7c832dfba4d8c491eb26984686132941d2c4e3.png)

 ![m4](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/b/6/b6d0787052a0991046771bef0236ae993258f47a.png)

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [May 13, 2022, 12:28pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/9 "2022-05-13T12:28:34Z")

</div>

I can’t repro it here on my Macbook Pro either. Same spec as Martin but different OS  
 ![image](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/7/7/77504207611e412789a3d0676a099eaf7ecce608.png)

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [May 13, 2022, 12:29pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/10 "2022-05-13T12:29:01Z")

</div>

> [@Kulodo133](#):
>
> I can reproduce on both another iMac, and another MacBookPro.

Does it happen in Firefox or Safari as well?

---

<div class="post-metadata">

**Author:** ![mvaligursky](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mvaligursky/32/11681_2.png) [@mvaligursky](https://forum.playcanvas.com/u/mvaligursky)\
**Post date:** [May 13, 2022, 12:32pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/11 "2022-05-13T12:32:03Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 12:39pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/12 "2022-05-13T12:39:27Z")

</div>

> [@mvaligursky](#):
>
> Any Chrome plugins perhaps?

Only on one of the three failing Macs  
 ![Screenshot 2022-05-13 at 13.37.30](https://forum-files-playcanvas-com.s3.dualstack.eu-west-1.amazonaws.com/original/3X/7/3/734debd3fb463e84ba2e3a7f01af85c794d2babc.png)

---

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 12:41pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/13 "2022-05-13T12:41:16Z")

</div>

> [@yaustar](#):
>
> Does it happen in Firefox or Safari as well?

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

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [May 13, 2022, 12:41pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/14 "2022-05-13T12:41:51Z")

</div>

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 😕

---

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 12:53pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/15 "2022-05-13T12:53:28Z")

</div>

> [@yaustar](#):
>
> I couldn’t reproduce it on other people’s laptops either 😕

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?

---

<div class="post-metadata">

**Author:** ![yaustar](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/yaustar/32/2268_2.png) [@yaustar](https://forum.playcanvas.com/u/yaustar)\
**Post date:** [May 13, 2022, 1:00pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/16 "2022-05-13T13:00:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 1:37pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/17 "2022-05-13T13:37:02Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![mvaligursky](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/mvaligursky/32/11681_2.png) [@mvaligursky](https://forum.playcanvas.com/u/mvaligursky)\
**Post date:** [May 13, 2022, 1:38pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/18 "2022-05-13T13:38:52Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 1:42pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/19 "2022-05-13T13:42:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kulodo133](https://forum.playcanvas.com/letter_avatar_proxy/v4/letter/k/dc4da7/32.png) [@Kulodo133](https://forum.playcanvas.com/u/Kulodo133)\
**Post date:** [May 13, 2022, 4:56pm UTC](https://forum.playcanvas.com/t/webgl-context-lost/25688/20 "2022-05-13T16:56:12Z")

</div>

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?

[Next page](https://forum.playcanvas.com/t/webgl-context-lost/25688.md?page=2)
