Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JupyterLab: WebGL is not supported by your browser

When I'm trying to make 3D plots in JupyterLab using plotly, I sometimes get the error message:

WebGL is not supported by your browser - visit https://get.webgl.org for more info

What is going on here? Similar questions have been asked for

  • PyCharm
  • Android

but none seem to be asked specifically for JupyterLab, so I'm hoping some of you have an idea why this error occurs.


The details:

I'm running different tests on the following script that produces the plot below:

Code:

import plotly.graph_objects as go
import numpy as np

# Helix equation
t = np.linspace(0, 20, 100)
x, y, z = np.cos(t), np.sin(t), t

fig = go.Figure(data=[go.Scatter3d(
    x=x,
    y=y,
    z=z,
    mode='markers',
    marker=dict(
        size=12,
        color=z,                # set color to an array/list of desired values
        colorscale='Viridis',   # choose a colorscale
        opacity=0.8
    )
)])

# tight layout
fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))
fig.show()

Plot:

enter image description here

Seemingly depending on what I'm trying to do here, the above mentioned error occurs from time to time. And that's what bothers me the most; there just does not seem to be a clear pattern here. Sometimes the plot is displayed briefly, and then the error message pops up. And other times it just completely breaks. And when it first breaks, restarting the kernel does not help. Neither does launching JupyterLab again. The only thing that helps is to restart the computer.

When I click the error message in JupyterLab:

enter image description here

I'm being directed to https://get.webgl.org/ that displays:

enter image description here

And that's not exaclty very helpful? Any ideas anyone?

System info:

Plotly 4.2.0
JupyterLab Version 0.34.9
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)]
Chrome 77 on Windows 7, 64 bit ( not that that should matter?)
like image 544
vestland Avatar asked Oct 29 '19 21:10

vestland


People also ask

How to fix WebGL not working on Windows 10?

If your browser does not support WebGL, you need to check if you have enabled hardware acceleration. Step 1: Open the three-dot menu and click Settings. Step 2: In the left pane, click Advanced > System. Step 3: Click the switch button next to the Use hardware acceleration when available to enable it.

Does my browser version support WebGL?

For example, WebGL is not supported on Opera Mini regardless of what version you’re using. A quick way to check if your browser version supports WebGL is to check this table ( here ). You can easily see which browser versions are equipped to handle WebGL.

Why can’t I play WebGL games on Chrome?

Some Google Chrome users complain that they cannot use some WebGL-based sites due to the error message “WebGL is not supported”. This problem is not limited to Google Chrome and may appear in other web browsers. If you come across this problem, chances are that you are using an older browser version that doesn’t support WebGL technology ...

Does WebGL use GPU or CPU?

Although WebGL is fully integrated with most web standards, it’s still depended on GPU support and might not be available on older devices. The main usage of WebGL is the implementation of GPU-accelerated usage of physics, effects and image processing as part of the web page canvas.


1 Answers

I was experiencing the same issue using jupyter notebook through Firefox, with up-to-date graphics drivers. On Firefox I was able to solve this by changing the webgl.disabled setting from True to False.

Type "about:config" in the address bar. Click proceed with caution, then type "webgl.disabled" and make sure the setting is saved as False.

like image 81
btobers Avatar answered Oct 10 '22 02:10

btobers