RuntimeError: the browser supports WebGL, but initialization failed

Hello,
We are having issue initializing Cesium.viewer.
Environment details are below:

-window 7 Enterprise 32 bit OS
-IE11 32 bit
-Intel graphics card 4000 and driver version#9.17.10.2843 with total memory 1205MB
var viewer = new Cesium.Viewer("geoFrameDiv",{
baseLayerPicker : false,
geocoder : false,
homeButton: false,
sceneModePicker : false,
selectionIndicator : true,
navigationHelpButton : false,
animation : false,
infoBox : true,
timeline : false,
fullscreenButton : false,
useDefaultRenderLoop : true,
targetFrameRate : parseInt(<%= geoMapFrameRate%>),
});

We are getting a RuntimeError: The browser supports WebGL, but we see a initialization failed error and I have tried out with cesium hello world example as well but same error.

However, exactly same configuration works fine with 64 bit browser (& OS).

After some search in forums, I found following property that helped others to overcome runtimeerror for viewer initialization scenario but there is not much details about the environment they used.

contextOptions : {webgl:{failIfMajorPerformanceCaveat:false} },

Cesium viewer was able to initialize successfully when I changed the viewer code to the following:

var viewer = new Cesium.Viewer("geoFrameDiv",{
baseLayerPicker : false,
geocoder : false,
homeButton: false,
sceneModePicker : false,
selectionIndicator : true,
navigationHelpButton : false,
animation : false,
infoBox : true,
contextOptions : {webgl:{failIfMajorPerformanceCaveat:false} },
timeline : false,
fullscreenButton : false,
useDefaultRenderLoop : true,
targetFrameRate : parseInt(<%= geoMapFrameRate%>),
});

I have following questions on failIfMajorPerformanceCaveat property set false:

Why are we setting "failIfMajorPerformanceCaveat " to false to initialize "cesium viewer"? How is it helping in initializing?
How to find out what is actually causing to fail in initialization? so that I can add failIfMajorPerformanceCaveat with false value conditionally to avoid initialization errors per user browser or OS?
By setting failIfMajorPerformanceCaveat property to false, what is the impact of cesium functionally and performance?

Thanks
srini

Web browsers will fall back on software rendering for WebGL content in cases where the video card is not capable of 3D, or more often, when the drivers are so buggy that they have to be blacklisted for stability or security reasons. (very common on Intel)

failIfMajorPerformanceCaveat makes it so that the browser will not fall back to software rendering, rather it will fail.

The problem with software rendering is that it is extremely slow compared to real hardware acceleration. Because Cesium does large parts of the rendering directly on the video card, a system using software rendering will not be able to render any scene effectively (in my experience, less than 1 frame per second) and so the globe is not even close to being usable.

Simple toy apps like the spinning globe on get.webgl.org will work with software rendering, but not something as complex as Cesium, so we default to failIfMajorPerformanceCaveat : true, and the developer can then catch the error and fall back to a non-accelerated 2D map, or display a message indicating that the system is not powerful enough.

If your application fails normally, and “runs” with failIfMajorPerformanceCaveat : false, the problem is the video card, or video drivers. You can try a different web browser. Internet Explorer is often more aggressive about blacklisting drivers than Chrome, for example.

thank you for the detail explanation and valuable time Scott.

->Is there away to catch runtimeerror ? this will helps to display customized message to users and also we can have fallback initialization with failIfMajorPerformanceCaveat : false

thanks
srini

You can catch the RuntimeError using a normal JavaScript try/catch.

thanks Scott.