Skip to content

feat: Remote rendering 5.2c - Wire ParaView mode in VISOR - #226

Open
LKasianAnsys wants to merge 4 commits into
feat/5.2b-paraview-multiblock-supportfrom
feat/5.2c-wire-paraview-mode-in-visor
Open

LKasianAnsys wants to merge 4 commits into
feat/5.2b-paraview-multiblock-supportfrom
feat/5.2c-wire-paraview-mode-in-visor

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Addresses #34

Summary

Wires up PARAVIEW mode in VISOR, connecting to an existing pvserver session in a subprocess.

ParaView's Python modules (e.g. paraview.simple) need to run inside ParaView's own interpreter, pvpython, not in VISOR's normal Python environment (.venv). So each PARAVIEW session runs in a separate pvpython process:

  • VisorParaviewHandle is what Visor(rendering_mode="PARAVIEW") returns, and what the API caches. It starts the child process and passes each Visor call to it.
    • Child process: session_main.py builds VisorVTKParaview inside the child process and runs the calls it receives.
    • Process management: session_process.py starts and stops the child process.
    • Connection: session_channel.py is the connection between the two processes.
  • The child process ends in the following cases:
    • on close() or /stop
    • when the Python interpreter exits
    • when the parent process dies, because the connection closes
  • The child process's output goes to <log_dir>/visor_paraview_session_<port>.log. Error messages point to that file.

Considerations:

  • No per-call timeout. If the child process crashes or exits, the call fails straight away with ParaviewSessionError. If the child process hangs, the call hangs too. Calls to one session are also handled one at a time.
  • Not supported in PARAVIEW mode (both raise UnsupportedInModeError):
    • in-memory datasets: file paths only, because pvserver opens files itself
    • update_variables
  • Blocking start and Ctrl+C: the child process runs in its own process group, so Ctrl+C reaches only the parent. The parent then shuts the child process down cleanly. If the child process exits on its own during a blocking start, it raises ParaviewSessionError.
  • Changes that affect every mode:
    • VisorCache.delete_instance now calls close() on the instance it removes. close() does nothing for CLIENT and SERVER.
    • Visor(...) and VisorVTK accept a pvserver kwarg. Passing an address in any mode other than PARAVIEW raises ValueError.
  • Requirements: paraview_pvpython and paraview_venv must be set in .visor. If they are not set, a ParaviewNotConfiguredError is raised.

Diagrams

Inheritance: Visor has two subclasses: VisorVTK and VisorParaviewHandle. VisorVTK has three subclasses: VisorVtkLocal, VisorVtkServer, and VisorVtkParaview.

Instantiation (dispatch + processes): The Visor class's __new__() method is a factory that returns a class based on the provided rendering_engine and rendering_mode arguments. Until now, it has returned a VisorVtkLocal for CLIENT mode, and VisorVtkServer for SERVER mode. In this PR we introduce PARAVIEW mode, which cannot return a VisorVtkParaview instance directly: VisorVtkParaview needs ParaView dependencies to run, which currently clash with Visor's dependencies (VTK version, Python verison).

Instead, for PARAVIEW rendering mode, Visor's factory returns a VisorParaviewHandle, a Visor subclass that lives in the main process within the main .venv. That handle creates the VisorVtkParaview instance within a child process using ParaView's pvpython, which uses ParaView's VTK and the .pvenv virtualenv that has the minimal required dependencies. The VisorParaviewHandle communicates with the VisorVtkParaview instance that runs in the child process, which itself communicates with the pvserver session, which is in its own separate process.

Screenshot 2026-11-18 093242 Screenshot 2026-11-18 101101

Manual check

Below are two manual checks, to test launching VISOR in PARAVIEW mode in two ways: 1. through visor-cli and 2. through the Python Visor class with rendering_mode="PARAVIEW".

Prerequisites

These prerequisites are needed for both manual checks.

  1. Install ParaView 6.2
  2. Follow the instructions in this doc to set up a .pvenv that ParaView's environment will use.
  3. Run pvserver on port 11111 as follows
    "C:\Program Files\ParaView 6.2.0\bin\pvserver.exe" --server-port=11111 --force-offscreen-rendering
    

Manual check via visor-cli

Check that PARAVIEW mode is now wired through the CLI

# Start the VISOR service
visor-cli server start

# in another terminal, create a Visor instance in PARAVIEW mode.
visor-cli server init --port 8083 --rendering-mode=PARAVIEW

# Start VISOR with a dataset
visor-cli instance start tests/files/many_blocks/many_blocks.vtm

# Run other APIs eg add_dataset, remove_dataset

Manual check via Python

Check that PARAVIEW mode is dispatched through the Visor class with Visor(rendering_mode="PARAVIEW").

# Create a Visor instance in PARAVIEW mode.
viewer = Visor(rendering_mode="PARAVIEW")

# Start VISOR with a dataset
viewer.start(input="tests/files/many_blocks/many_blocks.vtm")

# Run other public methods on the Visor class eg add_dataset, remove_dataset

@github-actions github-actions Bot added documentation Improvements or additions to documentation test Work associated with testing added enhancement New feature or request labels Nov 16, 2026
@LKasianAnsys LKasianAnsys changed the title Feat: Remote rendering 5.2c - Wire ParaView mode in VISOR feat: Remote rendering 5.2c - Wire ParaView mode in VISOR Nov 16, 2026
@LKasianAnsys
LKasianAnsys changed the base branch from main to feat/5.2b-paraview-multiblock-support November 16, 2026 20:52
@github-actions github-actions Bot removed the documentation Improvements or additions to documentation label Nov 16, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/5.2c-wire-paraview-mode-in-visor branch from 6690ee0 to 4302aef Compare November 16, 2026 21:07
@LKasianAnsys
LKasianAnsys added this pull request to stack #224 November 16, 2026 21:13
@LKasianAnsys LKasianAnsys self-assigned this Nov 16, 2026
@LKasianAnsys
LKasianAnsys force-pushed the feat/5.2c-wire-paraview-mode-in-visor branch from 4302aef to 2438d01 Compare November 17, 2026 14:17
@LKasianAnsys
LKasianAnsys removed this pull request from stack #224 November 17, 2026 16:25
@LKasianAnsys
LKasianAnsys added this pull request to stack #233 November 17, 2026 16:26
@LKasianAnsys
LKasianAnsys force-pushed the feat/5.2c-wire-paraview-mode-in-visor branch from 2438d01 to 9134bcc Compare November 17, 2026 17:41
@LKasianAnsys
LKasianAnsys force-pushed the feat/5.2c-wire-paraview-mode-in-visor branch from 9134bcc to 54099b5 Compare November 17, 2026 20:06
@LKasianAnsys
LKasianAnsys force-pushed the feat/5.2c-wire-paraview-mode-in-visor branch from 54099b5 to 34e4391 Compare November 17, 2026 20:25
@LKasianAnsys
LKasianAnsys marked this pull request as ready for review November 18, 2026 17:25
@LKasianAnsys
LKasianAnsys force-pushed the feat/5.2c-wire-paraview-mode-in-visor branch from 34e4391 to c5a4021 Compare November 18, 2026 19:02

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added enhancement New feature or request test Work associated with testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants