Demo Cahn-Hilliard not working on fresh installation

Hi all,

I’ve just installed dolfinx from scratch, using the conda build. I did so following the instructions, i.e. I created a a conda environment, activated it and then run this command within it:

conda install -c conda-forge fenics-dolfinx mpich pyvista

The Poisson demo works just fine and produces an output. However, the second demo, Cahn-Hilliard, gives this error:

pyvista and pyvistaqt are required to visualise the solution
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: Run with -malloc_debug to check if memory corruption is causing the crash.
Abort(59) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0

Do you know what can be happening? Thanks!

Ok, I was able to solve it myself. I didn’t recompile PETSC as suggested, given that I had not built from source in the first place, so I thought the problem might be elsewhere.

The message was complaining about pyvistaqt. I tried to install it, but then the demo was giving the error No Qt bindings could be found.

I installed pyqt5 using pip (it wasn’t available from conda):

python -m pip install pyqt5

I noticed matplotlib wasn’t in the environment, so I installed it (curiously, the first demo run).

After that, the demo worked. Leaving it here in case it helps someone else.

1 Like