# What can cause webgl context lost?

**URL:** <https://forum.babylonjs.com/t/what-can-cause-webgl-context-lost/41034>\
**Category:** Questions\
**Created:** [May 22, 2023, 6:32pm UTC](https://forum.babylonjs.com/t/what-can-cause-webgl-context-lost/41034 "2023-05-22T18:32:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [May 22, 2023, 6:33pm UTC](https://forum.babylonjs.com/t/what-can-cause-webgl-context-lost/41034/1 "2023-05-22T18:33:00Z")

</div>

we are having random webgl context lost errors. usually when resizing a window or when some other process it potentially soaking up resources.

we’re trying to identify the root cause…is there a doc or list of things that might cause the webgl context lost errors? Does it usually happen if we are out of memory? also the engine tries to handle the context lost error but sometimes never restores the context.  
( we could set doNotHandleContextLost = true and the handle it ourselves)

---

<div class="post-metadata">

**Author:** ![docEdub](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/docedub/32/14525_2.png) [@docEdub](https://forum.babylonjs.com/u/docEdub)\
**Post date:** [May 22, 2023, 8:01pm UTC](https://forum.babylonjs.com/t/what-can-cause-webgl-context-lost/41034/2 "2023-05-22T20:01:41Z")

</div>

cc @sebavan

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 23, 2023, 6:05pm UTC](https://forum.babylonjs.com/t/what-can-cause-webgl-context-lost/41034/3 "2023-05-23T18:05:07Z")

</div>

The three most common causes are:

- out of video memory due to a leak
- driver change like switching screens on laptop
- driver crash link to the overall load of the gpu accross tabs

---

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [May 25, 2023, 4:25am UTC](https://forum.babylonjs.com/t/what-can-cause-webgl-context-lost/41034/4 "2023-05-25T04:25:08Z")

</div>

Thanks! We will run memory profiles via chrome devtools to see if there are potential leaks.

-Anupam

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [May 25, 2023, 11:50pm UTC](https://forum.babylonjs.com/t/what-can-cause-webgl-context-lost/41034/5 "2023-05-25T23:50:08Z")

</div>

Some other ones FWIW:

- Remote desktop
- New driver installation
