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
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:
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:
I'm being directed to https://get.webgl.org/
that displays:
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?)
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.
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.
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 ...
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With