question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What happens when WebGL context is lost?

See original GitHub issue
  • pixi.js version: _e.g.5.2.1

  • Browser & Version: Firefox 74.0

  • OS & Version: OpenSuSE 43.1

    This is a question again: when I see “Error: WebGL context was lost.”, does this mean that pixi falls back to canvas drawing? I see this when I try to load my code in Firefox and the result is very slow and laggy - the animation stutters. When opening the same script in chromium, I don’t see the error message and the animation is very smooth.

    Perhaps chrome is just a lot faster? What’s a good way to debug this?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
eric-burelcommented, May 6, 2021

Ha, Stalebot, we meet again. This issue still happens for us, Firefox is losing context without much debug info nor directions on how to fix this issue. Happy to contribute to this, we have a strong interest in fixing this bug

1reaction
lululock71commented, Apr 14, 2020

Hi, similar issues under Firefox 75 (also Firefox dev 76 beta 4). I also have this, after refreshing the page a couple of times : Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. isWebGLSupported.js:31:32 WebGL context was lost. isWebGLSupported.js:31:32

I also have serious performance issues. For example, the demo shown on PixiJS official website (https://www.pixijs.com/) is very slow and choppy and I have a lot of CPU usage as well. On Chromium, it runs smoothly and does not show any sign of lost context in console. Other js WebGL libraries, are slow as well, it’s a browser related issue.

When testing 3D WebGL examples, both browsers show slowdowns…

I’ve read that Firefox and Chromium works best with Wayland. Their implementation of WebGL 2 for X11 is still a work in progress, while Chromium has the best support today (but still far from being perfect, especially in 3D). Apparently, WebGL 1 is better supported for X11 but as far as I’ve tested, it’s the same for me. I personally use X11 (xorg), and I think that’s why I have such poor performance.

The Firefox development team is currently working on it, but they started a month ago, so we will need to wait a bit before starting to see an improvement. https://bugzilla.mozilla.org/show_bug.cgi?id=1010527 https://bugzilla.mozilla.org/show_bug.cgi?id=1580166

That’s also explains why Windows users don’t experience this issue, as Firefox uses DXGL to render on this platform.

MacOS users probably have performance issues as well.

EDIT : The issue has been solved. The current Firefox Nightly build (77.0a1) shows more than 50 FPS on the Pixi.JS website (performance log) and the 3D WebGL aquarium runs at 60 FPS with 1000 fishes (https://webglsamples.org/aquarium/aquarium.html). But, the contexts are still lost and shows the same lost context issues after refreshing the page a couple of times, indicating that this time, it’s pixi.js’ fault. (see the top of my comment)

  • pixi.js : 5.1.6 (also 4.0.0 used on the official website)
  • Tested browsers : Firefox 75, Firefox Developer Edition 76 beta 4, Chromium 81.0.4044.92
  • Distro : Arch Linux 5.4.31-1 LTS
  • Hardware : Ryzen 5 2400G (Vega disabled), 16GB RAM, RX 480 8GB
  • amdgpu : 19.1.0-1
  • mesa : 20.0.4-1
  • xorg : 1.20.8-1
Read more comments on GitHub >

github_iconTop Results From Across the Web

WebGLRenderingContext.isContextLost() - Web APIs | MDN
The WebGLRenderingContext.isContextLost() method returns a boolean value indicating whether or not the WebGL context has been lost and must ...
Read more >
HandlingContextLost - WebGL Public Wiki
You can lose the context AT ANY TIME ! In otherwords, you can lose the context part way through initialization. You can also...
Read more >
WebGL scene does't render because of lost context
Either you have a huge memory leak in your application or your machine does not have enough power to run your texturized model...
Read more >
WebGL context lost and Memory Issue Critical Bug - SciChart
WebGL context lost and Memory Issue Critical Bug · The WebGL Context Loss error occurs when the Browser denies a WebGL context ·...
Read more >
Webgl context lost - Help & Support - PlayCanvas Forum
What I think is happening: your GPU / graphics driver crashes when rendering that cube for some reason. That takes down whole Webgl...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found