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

Python crash when calling some plotter methods after displaying a graphics object #357

Open
2 tasks done
ansjsia opened this issue Nov 21, 2023 · 5 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@ansjsia
Copy link

ansjsia commented Nov 21, 2023

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

After calling display() on a graphics session object, attempting to modify it afterward by calling add_axes() on the plotter object causes Python to crash, showing an unhelpful error:

2023-11-21 17:14:26.192 (  72.554s) [                ]vtkWin32OpenGLRenderWin:267    ERR| vtkWin32OpenGLRenderWindow (000001BFFEEAA290): wglMakeCurrent failed in MakeCurrent(), error: 遠蹅ƿ
ERROR:root:wglMakeCurrent failed in MakeCurrent(), error: 遠蹅ƿ
2023-11-21 17:14:26.194 (  72.556s) [                ]vtkWin32OpenGLRenderWin:267    ERR| vtkWin32OpenGLRenderWindow (000001BFFEEAA290): wglMakeCurrent failed in MakeCurrent(), error: 蔠蹅ƿ
ERROR:root:wglMakeCurrent failed in MakeCurrent(), error: 蔠蹅ƿ

📝 Steps to reproduce

  1. Create a graphics session object, e.g. of a mesh.
  2. Call display() on the graphics session.
  3. Get the plotter object using pyvista_windows_manager.get_plotter().
  4. Call add_axes() on the plotter object.
  5. Python will crash.

It is unclear if add_axes() is the only plotter method that causes this issue. It affects the CHT and brake disk PyFluent examples.

This script and mesh based on the CHT example will reproduce the bug (on SharePoint due to the size of the mesh file): https://ansys-my.sharepoint.com/:u:/p/jess_sia-ext/ESA7FK_sfAhIgTyjLvlpVSUBsTgWTiXoAyxkKQFWyxdk3A?e=bVxCxq

This is the script only. You will have to provide the mesh yourself for this to work: CHT.zip

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

Fluent 24R1
Also occurs on Fluent 23R2

🐍 Which Python version are you using?

3.11

📦 Installed packages

aiohttp==3.8.6
aiosignal==1.3.1
ansys-api-fluent==0.3.18
ansys-api-platform-instancemanagement==1.0.0
ansys-api-systemcoupling==0.1.0
-e git+https://github.com/ansys/pyfluent.git@c812ed4ce4fd03c4c02af9d88a2d47912c2c38a5#egg=ansys_fluent_core
ansys-fluent-visualization==0.7.1
ansys-platform-instancemanagement==1.1.2
-e git+https://github.com/ansys/pysystem-coupling.git@a445b8a153839b0abbe518be9b87099dde9470e2#egg=ansys_systemcoupling_core
anyio==4.0.0
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
async-timeout==4.0.3
attrs==23.1.0
Babel==2.13.1
beautifulsoup4==4.12.2
bleach==6.1.0
certifi==2023.7.22
cffi==1.16.0
charset-normalizer==3.3.2
colorama==0.4.6
comm==0.1.4
contourpy==1.2.0
cycler==0.12.1
debugpy==1.8.0
decorator==5.1.1
defusedxml==0.7.1
docker==6.1.3
executing==2.0.1
fastjsonschema==2.18.1
fonttools==4.44.0
fqdn==1.5.1
frozenlist==1.4.0
googleapis-common-protos==1.61.0
grpcio==1.59.2
grpcio-health-checking==1.48.2
grpcio-status==1.48.2
idna==3.4
importlib-metadata==6.8.0
ipycanvas==0.13.1
ipyevents==2.0.2
ipykernel==6.26.0
ipympl==0.9.3
ipython==8.17.2
ipython-genutils==0.2.0
ipyvtklink==0.2.3
ipywidgets==7.8.1
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.2
json5==0.9.14
jsonpointer==2.4
jsonschema==4.19.2
jsonschema-specifications==2023.7.1
jupyter-events==0.9.0
jupyter-lsp==2.2.0
jupyter_client==8.5.0
jupyter_core==5.5.0
jupyter_server==2.10.0
jupyter_server_terminals==0.4.4
jupyterlab==4.0.8
jupyterlab-pygments==0.2.2
jupyterlab-widgets==1.1.7
jupyterlab_server==2.25.1
kiwisolver==1.4.5
lxml==4.9.3
MarkupSafe==2.1.3
matplotlib==3.8.1
matplotlib-inline==0.1.6
mistune==3.0.2
multidict==6.0.4
nbclient==0.9.0
nbconvert==7.11.0
nbformat==5.9.2
nest-asyncio==1.5.8
notebook==7.0.6
notebook_shim==0.2.3
numpy==1.26.1
overrides==7.4.0
packaging==23.2
pandas==2.1.2
pandocfilters==1.5.0
parso==0.8.3
Pillow==10.1.0
platformdirs==3.11.0
pooch==1.8.0
prometheus-client==0.18.0
prompt-toolkit==3.0.39
protobuf==3.20.3
psutil==5.9.6
pure-eval==0.2.2
pycparser==2.21
Pygments==2.16.1
pyparsing==3.1.1
PySide6==6.6.0
PySide6-Addons==6.6.0
PySide6-Essentials==6.6.0
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2023.3.post1
pyvista==0.42.3
pyvistaqt==0.11.0
pywin32==306
pywinpty==2.0.12
PyYAML==6.0.1
pyzmq==25.1.1
QtPy==2.4.1
referencing==0.30.2
requests==2.31.0
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.12.0
scooby==0.9.2
Send2Trash==1.8.2
shiboken6==6.6.0
six==1.16.0
sniffio==1.3.0
soupsieve==2.5
stack-data==0.6.3
terminado==0.18.0
tinycss2==1.2.1
tornado==6.3.3
traitlets==5.13.0
trame==3.3.0
trame-client==2.12.6
trame-server==2.12.1
types-python-dateutil==2.8.19.14
tzdata==2023.3
uri-template==1.3.0
urllib3==2.0.7
vtk==9.2.6
wcwidth==0.2.9
webcolors==1.13
webencodings==0.5.1
websocket-client==1.6.4
widgetsnbextension==3.6.6
wslink==1.12.4
yarl==1.9.2
zipp==3.17.0
@ansjsia ansjsia added the bug Something isn't working label Nov 21, 2023
@ajain-work
Copy link
Collaborator

@ansjsia PyFluent visualization plots in two modes:

  1. blocking
  2. non blocking

In current case it seems we are mixing both. I think to fix this issue we can also provide a custom plot object with which user will be able to draw custom plots, instead of directly using matplot APIs.

@ansjsia
Copy link
Author

ansjsia commented Dec 12, 2023

Thanks @ajain-work. The examples work if I remove all calls to plotter objects, at the cost of no longer being able to do things like showing the 3D axis triad on the view. Do you think this would be wise?

@ajain-work
Copy link
Collaborator

I think we can remove till we can draw custom plots. @seanpearsonuk can confirm.

@seanpearsonuk
Copy link
Collaborator

I think we can remove till we can draw custom plots. @seanpearsonuk can confirm.

@ajain-work @ansjsia

Yes, that's fine with me, thanks.

@ansjsia
Copy link
Author

ansjsia commented Dec 14, 2023

I think we can remove till we can draw custom plots. @seanpearsonuk can confirm.

@ajain-work @seanpearsonuk Done for the CHT and brake disk examples in the pyfluent-examples repository: ansys/pyfluent-examples#99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants