Giter VIP home page Giter VIP logo

Comments (18)

jourdain avatar jourdain commented on September 25, 2024 1

It should not be a requirement, but technically, there is no point in showing the window on the server. When using an offscreen flavor like egl/osmesa, this is implicit and therefore automatic. On a graphic/desktop environment, that is another story, and it should be up to the user/dev to decide if they want to call such a function. In your case, it seems that the window manager mess things up somewhere in the process so forcing an offscreen window is required.

I think the best way forward would be to document that, but I'm not sure how to best describe and capture the reader attention. Any suggestion or PR on doc update is welcome...

Thanks for tracking that down.

from trame.

jourdain avatar jourdain commented on September 25, 2024

Thanks for the detailed issue. But I've just tested the code on a fresh venv and it is working fine on my mac.
I do see the memory grow and shrink as expected.

Can you provide the versions of your various packages (pip list)?

My setup was

Package             Version
------------------- -----------
aiohttp             3.9.3
aiosignal           1.3.1
async-timeout       4.0.3
attrs               23.2.0
contourpy           1.2.0
cycler              0.12.1
fonttools           4.49.0
frozenlist          1.4.1
idna                3.6
importlib_resources 6.1.3
kiwisolver          1.4.5
matplotlib          3.8.3
more-itertools      10.2.0
multidict           6.0.5
numpy               1.26.4
packaging           24.0
pillow              10.2.0
pip                 24.0
pyparsing           3.1.2
python-dateutil     2.9.0.post0
setuptools          65.4.1
six                 1.16.0
trame               3.5.2
trame-client        2.16.2
trame-server        2.17.2
trame-vtk           2.8.5
trame-vuetify       2.4.2
vtk                 9.3.0
wslink              1.12.4
yarl                1.9.4
zipp                3.17.0

from trame.

phcerdan avatar phcerdan commented on September 25, 2024

Maybe something cuda or linux specific?

python 3.11

Package         Version
--------------- -----------
aiohttp         3.9.3
aiosignal       1.3.1
attrs           23.2.0
build           1.1.1
click           8.1.7
contourpy       1.2.0
cycler          0.12.1
distro          1.9.0
fonttools       4.49.0
frozenlist      1.4.1
idna            3.6
kiwisolver      1.4.5
matplotlib      3.8.3
more-itertools  10.2.0
multidict       6.0.5
numpy           1.26.4
packaging       23.2
pillow          10.2.0
pip             24.0
pip-tools       7.4.1
pyparsing       3.1.2
pyproject_hooks 1.0.0
python-dateutil 2.9.0.post0
scikit-build    0.17.6
setuptools      65.5.0
six             1.16.0
trame           3.5.2
trame-client    2.16.2
trame-server    2.17.2
trame-vtk       2.8.5
trame-vuetify   2.4.2
vtk             9.3.0
wheel           0.42.0
wslink          1.12.4
yarl            1.9.4

from trame.

phcerdan avatar phcerdan commented on September 25, 2024

Any suggestion to try to debug it would be welcome. I have no idea where to start going deeper. Maybe something wslink related?

from trame.

jourdain avatar jourdain commented on September 25, 2024

When you download ParaView, does it render and work as expected?
What do you get in the about dialog?

Screenshot 2024-03-11 at 11 14 50

from trame.

jourdain avatar jourdain commented on September 25, 2024

Also can you also try with Python 3.9 or 3.10?

from trame.

phcerdan avatar phcerdan commented on September 25, 2024

Also can you also try with Python 3.9 or 3.10?

These are with python 3.11, but I tried with python3.9, and same behavior.

I tried with both (via conda)

from trame.

phcerdan avatar phcerdan commented on September 25, 2024

Found it...

If I use gnome, instead of i3, as window manager, it works...

i3 doesn't show the name of the windows. How is the transfer of the render window to the webpage done?

from trame.

jourdain avatar jourdain commented on September 25, 2024

VTK grabs the pixels of its render window before sending them. And I was suspecting that step was failing and sending garbage over the wire...

from trame.

phcerdan avatar phcerdan commented on September 25, 2024

Should I open an issue in VTK proper then?
I would like to keep using i3 as windows manager.

from trame.

jourdain avatar jourdain commented on September 25, 2024

Yes, please, especially since it seems to be related to that window manager. Unless you want to try to use vtk-egl, which may solve that window manager issue.

Just make sure you remove any vtk previously installed in your venv. (pip install --extra-index-url https://wheels.vtk.org vtk-egl)

from trame.

phcerdan avatar phcerdan commented on September 25, 2024

vtk-egl works indeed.

Could you aid me with the title for the VTK issue? What vtk class manages the "transfer"? I am not sure how to describe the problem in VTK terms.

from trame.

jourdain avatar jourdain commented on September 25, 2024

So the main issue is the window creation. Does the problem show up with ParaView as well?

Ideally, you want to find an example that highlights such an issue. One simple VTK Python example (assuming it fails) might be enough.

from trame.

phcerdan avatar phcerdan commented on September 25, 2024

I have no problem creating vtk windows. The problem seems when transferring the content of the render window into the webpage.
With vtkRemoteView nothing is displayed in the webpage, but the window is created and displays fine in its own window.

from trame.

jourdain avatar jourdain commented on September 25, 2024

Can you try that python example and see if it fails producing the image on disk?
https://examples.vtk.org/site/Python/Utilities/Screenshot/

from trame.

phcerdan avatar phcerdan commented on September 25, 2024

Can you try that python example and see if it fails producing the image on disk?

Tried, and it works fine. Render window is displayed and written to file.
image

from trame.

jourdain avatar jourdain commented on September 25, 2024

Sorry to keep asking you to try things out, but I'm wondering if you call renderWindow.SetOffScreenRendering(1), that fix the trame remote view issue.

from trame.

phcerdan avatar phcerdan commented on September 25, 2024

That fixes it as well.

Was that a requirement for using VtkRemoteView?

from trame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.