Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS error on mozilla "exceeded 16 live WebGL contexts for this principal, losing the least recently used one" #889

Open
ThibaultLacharme opened this issue Mar 31, 2020 · 9 comments

Comments

@ThibaultLacharme
Copy link

Hello,

I got this issue when restarting my kernel several times and getting new cell outputs. For now I have 3 cells outputs where I display molecules from SDF files and when I restart my algorithm a certain amount of times I have all those webGL contexts cumulating, leading to this error (so after restarting the algorithm 6 times).

Screenshot from 2020-03-31 11-55-48

Is there a way to reuse the previous webGL context or killing it when relaunching a cell ?

Perhaps my syntax was incorrect. It's very simple for now, I I just create a NGLWidget with show_structure_file and display it afterwards.

Are there any options/functions to avoid creating a new WebGL context and this packing up of previously created contexts ?

PS: don't pay attention to the 2 previously closed issues from me, simply forgot that we can't draw new lines in the description (which directly submits the issue instead, very handy)

@hainm
Copy link
Collaborator

hainm commented Mar 31, 2020

Please close your previous issue(s) if they are duplicated. Thanks.

@ThibaultLacharme
Copy link
Author

I already closed them, you can delete them if you want as they were made by mistake.

@hainm
Copy link
Collaborator

hainm commented Mar 31, 2020

May be try this

  • Restart/Shutdow the kernel
  • Refresh your browser (will clean JS stuff).
  • Run your stuff

@ThibaultLacharme
Copy link
Author

Restarting the kernel doesn't seem to kill the webGL context, I usually restart the kernel and run all cells.

I actually want to build a GUI which would only run the required cells again depending on what parameters the user modifies, I don't know if refreshing the browser would be possible/viable each time the user wants to get a new result or give new inputs.

Isn't there a way to kill the previous webGL context without refreshing the browser ?

@ThibaultLacharme
Copy link
Author

Or to reuse the previous webGL context instead if it's possible

@hainm
Copy link
Collaborator

hainm commented Mar 31, 2020

Isn't there a way to kill the previous webGL context without refreshing the browser ?

cc @arose

@hainm
Copy link
Collaborator

hainm commented Mar 31, 2020

killing it when relaunching a cell ?

@ThibaultLacharme Can you try view.close method? (My random guess)

Close method.

Closes the underlying comm.
When the comm is closed, all of the widget views are automatically
removed from the front-end.

@ThibaultLacharme
Copy link
Author

ThibaultLacharme commented Apr 1, 2020

Ok so I tried giving different variable names to each view in order to be able to close them afterwards by simply runnning the last cell.

Screenshot from 2020-04-01 15-31-59

By restarting the kernel and running all cells around 5-6 times (and uncommenting the last cell before restarting every time of course) I unfortunately get the same issue, the close() method doesn't seem to kill the webGL context.

@ThibaultLacharme
Copy link
Author

Hello @arose , I don't know if you had time to have a look at it since I raised this issue.

It seems like it would be manageable to erase the webGL context or reuse it but I don't know how it's implemented in NGLview on the webGL side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants