Visualisation in IPython with LavaVu

A python module for 4D visualisation with interactive IPython notebook integration

Owen Kaluza - Monash Immersive Visualisation Platform

Monash University e-Research Centre

What is IPython?

  • IPython: interactive shell combining documentation, annotation, implementation(code) and publication
  • Markdown formatted text, MathML formulae, images, video, HTML controls and components
  • Lends itself very well to use with remote resources, virtual machines and containers.
  • Used increasingly widely in research for simulations, data analysis, machine learning and general research data processing

    https://jupyter.org/ https://try.jupyter.org/

logo

A 3d(4d) Visualisation library : developed for advanced visualisation facilities and next-generation HPC resources

  • C++ backend with python interface wrapper provides a native OpenGL graphics layer to IPython
  • HTML5 GUI: usable from IPython or stand-alone via the built in web server
  • Geophysics: Underworld2 simulation code http://www.underworldcode.org/
  • CAVE2: via LavaVR, cluster rendering and CAVE2 VR mode, Volumes, 4d data, Surface Models
  • Output: still images, video animations, 3D interactive interfaces, 3D snapshots in WebGL.

Underworld: A parallel, particle-in-cell, finite element code for Geodynamics

Underworld is an open-source, particle-in-cell finite element code tuned for large-scale geodynamics simulations. The numerical algorithms allow the tracking of history information through the high-strain deformation associated with fluid flow.
The finite element mesh can be static or dynamic, but it is not constrained to move in lock-step with the evolving geometry of the fluid.
This hybrid approach is very well suited to complex fluids which is how the solid Earth behaves on a geological timescale.

Underworld2: python driven geophysics simulation http://www.underworldcode.org/

Underworld2 is a python-friendly rework of the Underworld code base which provides a programmable and flexible front end to all the functionality of the code running in a parallel HPC environment.

Underworld2 is integrated with the literate programming environment of the jupyter notebook system for tutorials and as a teaching tool for solid Earth geoscience.*

*https://github.com/underworldcode/underworld2

Underworld2 changes:

Problems addressed:

  1. Build and deployment: Docker
  2. Lack of flexibility and arcane XML model format: Python
  3. Difficult to learn and insufficient or out of date documentation: IPython
  4. No GUI features for visualisation: HTML5/CSS3/Javascript + IPython

LavaVu: a lightweight rendering library for scientific visualisation

https://github.com/okaluza/lavavu

  • C++ powered A C++ OpenGL rendering engine compiled to a binary library
  • Python Driven A Python interface wrapper module with underlying SWIG bindings and IPython supporting code
  • Web GUI - JavaScript,HTML,CSS interactive components, including WebGL output
  • JSON data for communication of state
  • Numpy input for fast loading of native data arrays

CAVE2: Challenges of Virtual Reality Visualisation

Big data visualisation on CAVE2 and clustered display systems:

  • Data processing: we have to pare down large datasets that can't be rendered at interactive framerates via interactively selecting, filtering, resampling, cropping data
  • Then we can usually easily load a data set, but what next?
  • Need the ability to control/explore data by modifying vis properties interactively

Why LavaVu?

What it does well:

  • Use with the vast library of tools available in python
  • Remote rendering and graphics on HPC systems while simulations are running using Mesa (software OpenGL)
  • Server side render, client side control - via built in HTTP server and IPython.
  • Correctly render transparency in large point swarms and surfaces
  • Combined vis elements: volume/surface/point/line

Why LavaVu?

What it does well (cont.):

  • Built for handling time-varying 4D data sets: simulation data
  • IPython notebooks: analyse / visualise / process with IPython, instant vis results as part of the analysis workflow.
  • CAVE2 and VR: pathway direct to CAVE2 with our VR module, LavaVR
  • Scriptable image and video output, save and restore state, record and checkpoint stages of vis workflow
  • Scriptable custom HTML5 GUI components

How to get it?

Github:
https://github.com/okaluza/lavavu

Instructions for building on Mac/Linux, including with IPython in the wiki:
https://github.com/okaluza/lavavu/wiki

Windows build: out of date due to lack of demand

Docker: (CPU and GPU versions to come) https://hub.docker.com/r/lavavu/latest/

Docker run on Linux with GPU access (open-source drivers only):

xhost +
docker run -v $HOME:/workspace/home -p 8888:8888 --volume=/tmp/.X11-unix:/tmp/.X11-unix --device=/dev/dri:/dev/dri --env="DISPLAY" lavavu/latest:v1.1

Conclusions

  • Convergence
  • One puzzle piece in e-Research workflows
  • Future work?

Thanks

  • MeRC
  • My colleagues at MIVP
  • The Underworld 2 team and researchers