WebGL context lost errors at random times

Hello Folks,

I am continuously getting WebGL Errors on my work PC which are crashing the Viewer.

At first I started getting the error “WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost” and am now getting numerous other WebGL related errors. The errors show at random times after initialization (1min-20min) and opening multiple viewers increases the rate of crashing. GPU usually spikes at the time of error.

I am developing a tool to display satellite orbits from TLE data. It runs fine on my laptop which has way worse hardware than my PC.

PC: Intel UHD Graphics 630, i7-10700 2,90Ghz, 32GB RAM
Laptop: Intel HD Graphics 530, i5-6300HQ 2,30Ghz, 16GB RAM

I have updated the graphic cards drivers. The problem consists throughout multiple browsers (Edge, Chrome, FF). My OS is Windows 10. Cesium Version is ‘1.107.1’.

Is there a way to handle these errors and prevent the viewer from crashing?

I have been able to log the following errors (which all trigger the ‘webglcontextlost’ event):

Error constructing CesiumWidget.
Visit http://get.webgl.org to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:

RuntimeError: The browser supports WebGL, but initialization failed.
Error
    at new t (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:471:23527)
    at new k (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:525:6160)
    at new Me (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:550:5058)
    at new x (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:558:22517)
    at new te (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:561:12303)
    at initializeCesiumViewer (https://localhost:5001/scripts/cesium/app.js:9:14)
    at https://localhost:5001/_framework/blazor.server.js:1:3506
    at new Promise (<anonymous>)
    at Ft.beginInvokeJSFromDotNet (https://localhost:5001/_framework/blazor.server.js:1:3480)
    at Ft._invokeClientMethod (https://localhost:5001/_framework/blazor.server.js:1:75072)
    at Ft._processIncomingData (https://localhost:5001/_framework/blazor.server.js:1:72696)
    at Ft.connection.onreceive (https://localhost:5001/_framework/blazor.server.js:1:67009)
    at i.onmessage (https://localhost:5001/_framework/blazor.server.js:1:51322)

WebGL warning: <Present>: Swap chain surface creation failed.
WebGL context was lost.
Failed to create WebGL context: WebGL creation failed: 
* tryANGLE (FEATURE_FAILURE_EGL_NO_CONFIG)
* Exhausted GL driver options. (FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS) 

An error occurred while rendering.  Rendering has stopped.
RangeError: invalid array length
Xst@https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:10270:9168
h4.prototype.createPotentiallyVisibleSet@https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:10270:11474
Hy@https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:11738:28303
Xi.prototype.updateAndExecuteCommands@https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:11738:25562
gft@https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:11738:37230
tC@https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:11738:37429
Xi.prototype.render@https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:11738:38418
nC.prototype.render@https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:12036:1631
n@https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:12034:3878
Cesium.js:12034:10299

TypeError: WebGL2RenderingContext.shaderSource: Argument 1 is not an object.
$Se@http://localhost:5500/libs/Cesium/Cesium.js:894:65262
gQ@http://localhost:5500/libs/Cesium/Cesium.js:897:1412
H3@http://localhost:5500/libs/Cesium/Cesium.js:897:1361
zm.prototype._bind@http://localhost:5500/libs/Cesium/Cesium.js:897:2212
NQe@http://localhost:5500/libs/Cesium/Cesium.js:8352:41422
Au.prototype.draw@http://localhost:5500/libs/Cesium/Cesium.js:8352:42192
kv.prototype.execute@http://localhost:5500/libs/Cesium/Cesium.js:894:36194
mz.prototype.execute@http://localhost:5500/libs/Cesium/Cesium.js:8352:918
Cee.prototype.execute@http://localhost:5500/libs/Cesium/Cesium.js:5550:79034
Pye@http://localhost:5500/libs/Cesium/Cesium.js:11738:24044
Hy@http://localhost:5500/libs/Cesium/Cesium.js:11738:28354
Xi.prototype.updateAndExecuteCommands@http://localhost:5500/libs/Cesium/Cesium.js:11738:25562
gft@http://localhost:5500/libs/Cesium/Cesium.js:11738:37230
tC@http://localhost:5500/libs/Cesium/Cesium.js:11738:37429
Xi.prototype.render@http://localhost:5500/libs/Cesium/Cesium.js:11738:38418
nC.prototype.render@http://localhost:5500/libs/Cesium/Cesium.js:12036:1631
n@http://localhost:5500/libs/Cesium/Cesium.js:12034:3878
FrameRequestCallback*n@http://localhost:5500/libs/Cesium/Cesium.js:12034:3887
DeveloperError: drawingBufferWidth must be greater than zero.

Error
    at new DeveloperError (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:10418:13)
    at PerspectiveOffCenterFrustum.getPixelDimensions (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:71983:13)
    at PerspectiveFrustum.getPixelDimensions (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:72222:35)
    at Camera.getPixelSize (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:76091:36)
    at updateBoundingVolume (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:150139:38)
    at BillboardCollection.update (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:150324:5)
    at LabelCollection.update (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:153203:25)
    at EntityCluster.update (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:172777:29)
    at PrimitiveCollection.update (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:81251:21)
    at PrimitiveCollection.update (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:81251:21)
    at PrimitiveCollection.update (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:81251:21)
    at updateAndRenderPrimitives (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:96136:23)
    at executeCommandsInViewport (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:95988:5)
    at Scene.updateAndExecuteCommands (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:95806:7)
    at render (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:96444:11)
    at tryAndCatchError (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:96458:7)
    at Scene.render (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:96510:7)
    at CesiumWidget.render (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:97909:19)
    at render2 (https://localhost:5001/scripts/cesium/libs/Cesium/Cesium.js:97333:20)

Any help is much appreciated.

PS: This is my first post, so please let me know if I can/should provide any more information.

1 Like

Hello, I have also encountered this problem at work. Have you solved it yet?