jupyter-widgets / pythreejs

A Jupyter - Three.js bridge
https://pythreejs.readthedocs.io
Other
934 stars 185 forks source link

No pythreejs rendered output #381

Closed LtAirman closed 1 year ago

LtAirman commented 1 year ago

There is no pythreejs rendered output .

I'm running Jupyter Notebook (6.4.8), Ipywidgets (7.6.5), pythreejs (2.3.0), and Ipython (7.32.0) under Anaconda Navigator (2.1.2).

I first reported this problem (without version numbers) on 2 July on the 366 issue page (and 378 push page) assuming it was somehow related to the Orbital Camera non-finite values UserWarning issue I see in my project files and have been following. https://github.com/jupyter-widgets/pythreejs/issues/366 On 3 July the rendered output returned and I added the problem cleared update to my comments (on 366 and 378).

The problem returned again this morning. I stopped Notebook and Anaconda and tried restarting them with no change - no rendered output. I suppose this needs to be a new issue.

LtAirman commented 1 year ago

I tried restarting Anaconda and Notebook again, along with updating chrome to Version 103.0.5060.66 (Official Build) (64-bit).

I don't know if that was a fix or not. The pythreejs rendered output is now working properly.

LtAirman commented 1 year ago

The intermittent problem is back.

A little more information. I've been working on my project at https://github.com/LtAirman/ChargeFieldTopics most every day for almost a year.

When I started work this morning I could see the rendered output. At some point it quit displaying the output. If it were just this one notebook file I would think I've made some serious coding error but this problem is also present when I run my two older notebook files. Aside from this problem they've always worked properly in the past.

LtAirman commented 1 year ago

Forgot to mention, restarting Anaconda and Notebook a couple of times hasn't helped.

LtAirman commented 1 year ago

8 July. This morning, after starting everything, I saw a good rendered output. I made selection changes and the rendering was still good. I went to another chrome tab, then came back to the notebook tab and the pythreejs rendering was gone.

Closed Notebook, Anaconda Navigator and chrome and restarted; no change - no renderings.

Shut down and restarted everything including my computer and the rendering was again working properly. I’ve made several different, most complex object selections without a problem. Opening, closing and minimizing tabs and using other apps and browsers like I normally do. After three four hours the pythreejs renderings are working properly.

If all I need to do is reboot my computer I suppose I can live with the problem. I’ll try logging my activities for a few days before posting again.

LtAirman commented 1 year ago

Update. The problem has not re-occurred since I reported it over two weeks ago.

vidartf commented 1 year ago

The next time this issue occurs, please check your browser's console for any output (and share it here). It might be that you are hitting some browser limit related to WebGL.

LtAirman commented 1 year ago

@ vidartf, thanks for the help.

I’ve run my notebook projects every day. This morning was the first time I lost the rendered output since receiving your instruction. My notebook file was up and running in chrome with a stationary image in a minimized window. I used another chrome window to visit a website I visit daily. I went back to open the notebook window and saw the threejs rendered output was gone.

Your WebGL limit guess appears to be correct. The console log includes the message: mBuilder.ipynb:1 WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost.

Three attached files.

  1. The console log file output during the loss of threejs rendered output. localhost-1661782215490.log
  2. A normal initial log output. localhost-1661785463375.log
  3. A normal operational log output. localhost-1661789658096.log

Some background. The code generates lots of messages. Launching the notebook file - then launching devtools, shows 21 console messages, including 5 errors and two warnings. localhost-1661785463375.log.

I usually clear that first console output, then begin at the notebook’s cell 10 in order to set up the ipywidgit controls in cells 8 and 9. The ‘run all cells above’ command results in 2 verbose messages. Making a selection then - Run all cells below – may result in 500+ messages, 500+ user messages, 1 info and 500+ verbose. Using the orbital camera about the atom results in thousands of messages. There are up to 39 rotation controls, turning on any of them will generate message streams. A normal operation log including a brief rotation is included. localhost-1661789658096.log

I restored the normal output by closing and relaunching Chrome, Anaconda and Jupyter notebook.

localhost-1661785463375.log localhost-1661789658096.log localhost-1661782215490.log

vidartf commented 1 year ago

I went back to open the notebook window and saw the threejs rendered output was gone.

Thanks for the context and the confirmation via logs. I think we can still improve our handling of context loss (https://www.khronos.org/webgl/wiki/HandlingContextLost), but in general, saving your notebook and refreshing the page should hopefully be enough.

LtAirman commented 1 year ago

Thank you Sir.