bjlittle / geovista

Cartographic rendering and mesh analytics powered by PyVista
https://geovista.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
162 stars 26 forks source link

Core dumped when using plotter.show() #375

Closed giubonino closed 1 year ago

giubonino commented 1 year ago

📰 Custom Issue

Hello everyone,

I am able to load all the examples and produce the plots, but any time I tried to show them or save them my kernel died. It happens running the script either on a jupyter notebook or with Python command. Do you have any suggestions?

Thank you

giubonino commented 1 year ago

I am trying to use geovista on my university's HPC system.

Thank you again

bjlittle commented 1 year ago

@giubonino Thanks for raising the issue :+1:

Could you give me a little more context to see if I can recreate or diagnose the issue...

How did you install geovista? Using conda or pip?

Are there any tracebacks or error messages that you can share with me? I'm guessing from the issue title it's just a hard core dump with no diagnostics, right?

There may be some incompatibility with the host platform / operating-system.

Let's take geovista out of the equation for now and make sure that pyvista is at least operational. Could you please try running the following and let me know if it works:

import pyvista as pv

pv.Cube().plot()
giubonino commented 1 year ago

@bjlittle thank you for your answer,

I installed geovista using mamba. I want to use it on a remote server, so that I followed these instructions (https://docs.pyvista.org/version/stable/getting-started/installation.html). I manage to install all the required packages, all of them using mamba. Now I am getting this error, same error if I run the code you suggested. Any idea? Screen Shot 2023-07-11 at 16 44 04

Thank you

bjlittle commented 1 year ago

Ahhh okay, thanks for that @giubonino.

Right, great, I think this is now making sense. This helps narrow the issue down, plus the fact that you mention above that you're attempting to use it on a remote server helps... so this might explain the issue that you're having.

See these PyVista - Running on Remote Servers instructions, perhaps they might help. Let me know.

Ping @tkoyama010 @banesullivan - Have you guys seen this kind of issue before on pyvista? If so, do you know the correct pyvista setup to recommend to @giubonino to unblock them?

giubonino commented 1 year ago

@bjlittle thanks,

I already followed the instructions that you suggested. This is the error that I get after them.

Thank you

bjlittle commented 1 year ago

@giubonino Okay, thanks.

I've pinged a couple of the pyvista core developers, who've got way more experience with this particular kind of issue. We're all at SciPy 2023 atm, so I'll see if I can pull on their expertise here to help you out :+1:

bjlittle commented 1 year ago

@giubonino I don't know your particular setup, but after a minor bit of digging around, these two articles seems highly relevant:

  1. https://github.com/CDAT/cdat/issues/1134
  2. https://unix.stackexchange.com/questions/12755/how-to-forward-x-over-ssh-to-run-graphics-applications-remotely

When you read through 1. the nub of the issue there (which appears similar to yours) is related to ssh X port forwarding (see this comment). Are you able to run glxgears? (demo app for GLX, if it's installed on your system)

giubonino commented 1 year ago

Good morning @bjlittle,

Well, if I run glxgears, using the setting suggested in here (e.g. export DISPLAY=:99.0 etc), I got this error: "Error: couldn't get an RGB, Double-buffered visual"

I upgraded Xquartz, installed mesa-libgl, but still. I don't really know.

giubonino commented 1 year ago

To be precise, those are the errors before and after export DISPLAY. Screen Shot 2023-07-12 at 10 25 52

tkoyama010 commented 1 year ago

@giubonino Good morning. Could you run the following code and paste the result here to let us check your environment?

# Get system info
try:
    import pyvista as pv
    print(pv.Report())
# pyvista>=0.40
except:
    from pyvista import report
    print(report.Report())
giubonino commented 1 year ago

Here we are @tkoyama010!

Thanks Screen Shot 2023-07-12 at 11 01 10

giubonino commented 1 year ago

I don't know if could be related but I have similar warming when plotting with matplotlib. Screen Shot 2023-07-12 at 11 18 30

But in this case I have the pop-up with the plot.

tkoyama010 commented 1 year ago

@giubonino It seems that Get report of capabilities for the render window in vtk raise an error. Could you run the following code and confirm that the image is displayed?

import pyvista

pyvista.set_jupyter_backend('static')
pyvista.global_theme.notebook = True
pyvista.start_xvfb()

pv.Cube().plot()
giubonino commented 1 year ago

@tkoyama010 nope,

Screen Shot 2023-07-12 at 11 22 53

tkoyama010 commented 1 year ago

@giubonino One solution is to build and install vtk for the environment. Is it possible to install an off-screen vtk by referring to this document? https://docs.pyvista.org/version/dev/extras/building_vtk.html#building-vtk

giubonino commented 1 year ago

@tkoyama010 thank you,

I have no the rights to do that, but I'll try to ask to the ITs. Meanwhile, is there a way to disable the visualisation mode and just save the figures as in matplotlib using "matplotlib.use('Agg')" ? I don't need to visualise them, I need just to save them.

Thank you

tkoyama010 commented 1 year ago

@giubonino In my mind, the vtk published on PyPI cannot handle the case without a GPU environment. If you want to handle it without a GPU, please consider building the OSMA package from the documentation mentioned earlier. https://docs.pyvista.org/version/dev/extras/building_vtk.html#building-osmesa

banesullivan commented 1 year ago

Since you're also having issues with matplotlib, I suspect you have incompatibilities or missing dependencies with your GL installation. This is tough to debug over github... your HPC system administrators may be the best people to help yu resolve this.

In my mind, the vtk published on PyPI cannot handle the case without a GPU environment

It can -- this is what having libosmesa and starting a virtual framebuffer handles (start_xvfb()). You could also try using a specific variant of VTK that has OSMesa bundled, which I describe here: https://discourse.vtk.org/t/status-update-vtk-python-wheels/11212.

Hope this helps!

tkoyama010 commented 1 year ago

That's cool. Thanks :)

bjlittle commented 1 year ago

@giubonino Is there any further support that we can offer you here?

It's kinda difficult to know how to advise you best next.

Please feel free to leave this issue open or close it.

Either way, it would be lovely to know whether you finally get yourself up and running 👍

bjlittle commented 1 year ago

@giubonino I'm going to close this issue.

If you want to re-open it for further discussion, then please don't hesitate to do that :+1:

Many thanks!

giubonino commented 1 year ago

Thank you @bjlittle

Update: I still have the problem, but it is more then likely linked to my HPC system.

bjlittle commented 4 months ago

@all-contributors please add @giubonino for userTesting

allcontributors[bot] commented 4 months ago

@bjlittle

I've put up a pull request to add @giubonino! :tada: