Installation trouble

Dear all,

I’ve had a great deal of enjoyment using the old version of Fenics, however now I’ve tried to upgrade only to encounter a flurry of issues - most of which I’ve resolved. There is one that I’m stuck on and perhaps someone here has a clue.

I’ve managed to install FENICSx however when I import it I experience the following error:

(fenicsx) admind8@solid33ubuntu:~$ python
Python 3.11.6 | packaged by conda-forge | (main, Oct 3 2023, 10:40:35) [GCC 12.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import dolfinx
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 4 Illegal instruction: Likely due to memory corruption
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see FAQ — PETSc 3.20.2 documentation and FAQ — PETSc 3.20.2 documentation
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
Abort(59) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0

I’m not the most technically gifted individual, so if someone could perhaps point me in the right direction, I would be forever grateful. I apologize if this is not the correct place for this sort of question, perhaps it would be more appropriate for a PETSc forum.

If I can provide any more information please don’t hesitate to ask.

Cheers!

You need to specify how exactly installed DOLFINx, and what system you are running on.

If I recall I installed through the conda environment using the instructions on the github page. I’m running Ubuntu 20.04.6 LTS. I attempted in other ways to install (building from source) but I had some difficulty.

As a follow up, I finally caved and installed Docker. For those of you who are struggling to install this software, I highly recommend it. It worked out of the box.

I however did not find a solution to my issue. I imagine it is some kind of compatibility/corruption error that would be removed via a reformatting of the PC.

If you can upgrade your ubuntu system to a more recent release, you’d also be able to use the fenicsx (dolfinx) packages from the PPA built natively for ubuntu.

I’m having this same issue as Francis. Installed on a clean VM installation of Linux Mint 21.2 Victoria on Proxmox hypervisor. Installed DOLFINx in a conda environment per instructions at GitHub - FEniCS/dolfinx: Next generation FEniCS problem solving environment. Is the OS environment causing the issues in my case? Will likely just go the Docker route as Francis did, but curious what’s going on here…

Post more details:

  • exactly how did you install DOLFINx, so that people can copy and paste to replicate your same version
  • which code triggers the error. Is it a simple import dolfinx or a demo?

Freshly installed anaconda3 using official instructions for Linux machines on a recently spun up VM: Installing on Linux — Anaconda documentation

Installed DOLFINx in conda env using instructions at GitHub - FEniCS/dolfinx: Next generation FEniCS problem solving environment, specifically:

conda create -n fenicsx-env
conda activate fenicsx-env
conda install -c conda-forge fenics-dolfinx mpich pyvista

conda list output seems to indicate the installation was successful:

(fenicsx-env) k@linuxmintprimary:~/Desktop/Test Environ/fenicstest$ conda list
# packages in environment at /home/k/anaconda3/envs/fenicsx-env:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
aiohttp                   3.9.1           py312h98912ed_0    conda-forge
aiosignal                 1.3.1              pyhd8ed1ab_0    conda-forge
alsa-lib                  1.2.10               hd590300_0    conda-forge
aom                       3.7.1                h59595ed_0    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
attrs                     23.2.0             pyh71513ae_0    conda-forge
binutils_impl_linux-64    2.40                 hf600244_0    conda-forge
binutils_linux-64         2.40                 hbdbef99_2    conda-forge
blosc                     1.21.5               h0f2a231_0    conda-forge
brotli                    1.1.0                hd590300_1    conda-forge
brotli-bin                1.1.0                hd590300_1    conda-forge
brotli-python             1.1.0           py312h30efb56_1    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
c-ares                    1.24.0               hd590300_0    conda-forge
c-blosc2                  2.12.0               hb4ffafa_0    conda-forge
ca-certificates           2023.11.17           hbcca054_0    conda-forge
cairo                     1.18.0               h3faef2a_0    conda-forge
certifi                   2023.11.17         pyhd8ed1ab_0    conda-forge
cffi                      1.16.0          py312hf06ca03_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.0           py312h8572e83_0    conda-forge
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
dav1d                     1.2.1                hd590300_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
double-conversion         3.3.0                h59595ed_0    conda-forge
eigen                     3.4.0                h00ab1b0_0    conda-forge
expat                     2.5.0                hcb278e6_1    conda-forge
fenics-basix              0.7.0           py312h5b9907d_1    conda-forge
fenics-basix-pybind11-abi 0.4.12               h5b9907d_1    conda-forge
fenics-dolfinx            0.7.2           py312had67bdd_103    conda-forge
fenics-ffcx               0.7.0              pyh4af843d_0    conda-forge
fenics-libbasix           0.7.0                hfdc072b_1    conda-forge
fenics-libdolfinx         0.7.2              h962240e_103    conda-forge
fenics-ufcx               0.7.0                h4af843d_0    conda-forge
fenics-ufl                2023.2.0           pyhd8ed1ab_0    conda-forge
ffmpeg                    6.1.0           gpl_ha330e6d_102    conda-forge
fftw                      3.3.10          mpi_mpich_h5537406_8    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 h77eed37_1    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.47.0          py312h98912ed_0    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
fribidi                   1.0.10               h36c2ea0_0    conda-forge
frozenlist                1.4.1           py312h98912ed_0    conda-forge
gcc_impl_linux-64         12.3.0               he2b93b0_3    conda-forge
gcc_linux-64              12.3.0               h76fc315_2    conda-forge
gettext                   0.21.1               h27087fc_0    conda-forge
gl2ps                     1.4.2                h0708190_0    conda-forge
glew                      2.1.0                h9c3ff4c_2    conda-forge
glib                      2.78.3               hfc55251_0    conda-forge
glib-tools                2.78.3               hfc55251_0    conda-forge
gmp                       6.3.0                h59595ed_0    conda-forge
gnutls                    3.7.9                hb077bed_0    conda-forge
graphite2                 1.3.13            h58526e2_1001    conda-forge
gst-plugins-base          1.22.8               h8e1006c_0    conda-forge
gstreamer                 1.22.8               h98fc4e7_0    conda-forge
gxx_impl_linux-64         12.3.0               he2b93b0_3    conda-forge
gxx_linux-64              12.3.0               h8a814eb_2    conda-forge
harfbuzz                  8.3.0                h3d44ed6_0    conda-forge
hdf4                      4.2.15               h2a13503_7    conda-forge
hdf5                      1.14.3          mpi_mpich_ha2c2bf8_0    conda-forge
hypre                     2.28.0          mpi_mpich_h716cb5e_0    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.6                pyhd8ed1ab_0    conda-forge
jsoncpp                   1.9.5                h4bd325d_1    conda-forge
kahip                     3.16                 he427f57_0    conda-forge
kahip-python              3.16            py312h79e6366_0    conda-forge
kernel-headers_linux-64   2.6.32              he073ed8_16    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.5           py312h8572e83_1    conda-forge
krb5                      1.21.2               h659d440_0    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
lcms2                     2.16                 hb7c19ff_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libadios2                 2.9.2           mpi_mpich_h69321e2_1    conda-forge
libaec                    1.1.2                h59595ed_1    conda-forge
libass                    0.17.1               h8fe9dca_1    conda-forge
libblas                   3.9.0           20_linux64_openblas    conda-forge
libboost                  1.82.0               h6fcfa73_6    conda-forge
libboost-devel            1.82.0               h00ab1b0_6    conda-forge
libboost-headers          1.82.0               ha770c72_6    conda-forge
libbrotlicommon           1.1.0                hd590300_1    conda-forge
libbrotlidec              1.1.0                hd590300_1    conda-forge
libbrotlienc              1.1.0                hd590300_1    conda-forge
libcap                    2.69                 h0f662aa_0    conda-forge
libcblas                  3.9.0           20_linux64_openblas    conda-forge
libclang                  15.0.7          default_hb11cfb5_4    conda-forge
libclang13                15.0.7          default_ha2b6cf4_4    conda-forge
libcups                   2.3.3                h4637d8d_4    conda-forge
libcurl                   8.5.0                hca28451_0    conda-forge
libdeflate                1.19                 hd590300_0    conda-forge
libdrm                    2.4.114              h166bdaf_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libflac                   1.4.3                h59595ed_0    conda-forge
libgcc-devel_linux-64     12.3.0             h8bca6fd_103    conda-forge
libgcc-ng                 13.2.0               h807b86a_3    conda-forge
libgcrypt                 1.10.3               hd590300_0    conda-forge
libgfortran-ng            13.2.0               h69a702a_3    conda-forge
libgfortran5              13.2.0               ha4646dd_3    conda-forge
libglib                   2.78.3               h783c2da_0    conda-forge
libglu                    9.0.0             hac7e632_1003    conda-forge
libgomp                   13.2.0               h807b86a_3    conda-forge
libgpg-error              1.47                 h71f35ed_0    conda-forge
libhwloc                  2.9.3           default_h554bfaf_1009    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libidn2                   2.3.4                h166bdaf_0    conda-forge
libjpeg-turbo             3.0.0                hd590300_1    conda-forge
liblapack                 3.9.0           20_linux64_openblas    conda-forge
libllvm15                 15.0.7               h5cf9203_3    conda-forge
libnetcdf                 4.9.2           nompi_h80fb2b6_112    conda-forge
libnghttp2                1.58.0               h47da74e_1    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.25          pthreads_h413a1c8_0    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpciaccess              0.17                 h166bdaf_0    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libpq                     16.1                 h33b98f1_7    conda-forge
libptscotch               7.0.4                h2376d02_1    conda-forge
libsanitizer              12.3.0               h0f45ef3_3    conda-forge
libscotch                 7.0.4                h91e35bf_1    conda-forge
libsndfile                1.2.2                hc60ed4a_1    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libsqlite                 3.44.2               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-devel_linux-64  12.3.0             h8bca6fd_103    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_3    conda-forge
libsystemd0               255                  h3516f8a_0    conda-forge
libtasn1                  4.19.0               h166bdaf_0    conda-forge
libtheora                 1.1.1             h7f98852_1005    conda-forge
libtiff                   4.6.0                ha9c0a0a_2    conda-forge
libunistring              0.9.10               h7f98852_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libva                     2.20.0               hd590300_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libvpx                    1.13.1               h59595ed_0    conda-forge
libwebp-base              1.3.2                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxkbcommon              1.6.0                h5d7e998_0    conda-forge
libxml2                   2.11.6               h232c23b_0    conda-forge
libzip                    1.10.1               h2629f0a_3    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
loguru                    0.7.2           py312h7900ff3_1    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
matplotlib-base           3.8.2           py312he5832f3_0    conda-forge
metis                     5.1.1                h59595ed_2    conda-forge
mpfr                      4.2.1                h9458935_0    conda-forge
mpg123                    1.32.3               h59595ed_0    conda-forge
mpi                       1.0                       mpich    conda-forge
mpi4py                    3.1.5           py312h5256a87_0    conda-forge
mpich                     4.1.2              h846660c_101    conda-forge
multidict                 6.0.4           py312h98912ed_1    conda-forge
mumps-include             5.2.1               ha770c72_14    conda-forge
mumps-mpi                 5.2.1               h5b51c9e_14    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mysql-common              8.0.33               hf1915f5_6    conda-forge
mysql-libs                8.0.33               hca2cd23_6    conda-forge
ncurses                   6.4                  h59595ed_2    conda-forge
nettle                    3.9.1                h7ab15ed_0    conda-forge
nlohmann_json             3.11.2               h27087fc_0    conda-forge
nspr                      4.35                 h27087fc_0    conda-forge
nss                       3.96                 h1d7d5a4_0    conda-forge
numpy                     1.26.3          py312heda63a1_0    conda-forge
openh264                  2.4.0                h59595ed_0    conda-forge
openjpeg                  2.5.0                h488ebb8_3    conda-forge
openssl                   3.2.0                hd590300_1    conda-forge
p11-kit                   0.24.1               hc5aa10d_0    conda-forge
packaging                 23.2               pyhd8ed1ab_0    conda-forge
parmetis                  4.0.3             h2a9763c_1005    conda-forge
pcre2                     10.42                hcad00b1_0    conda-forge
petsc                     3.20.3          real_h3d2a624_100    conda-forge
petsc4py                  3.20.3          real_h098918d_100    conda-forge
pillow                    10.2.0          py312hf3581a9_0    conda-forge
pip                       23.3.2             pyhd8ed1ab_0    conda-forge
pixman                    0.42.2               h59595ed_0    conda-forge
pkg-config                0.29.2            h36c2ea0_1008    conda-forge
platformdirs              4.1.0              pyhd8ed1ab_0    conda-forge
pooch                     1.8.0              pyhd8ed1ab_0    conda-forge
proj                      9.3.1                h1d62c97_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptscotch                  7.0.4                h23d43cc_1    conda-forge
pugixml                   1.14                 h59595ed_0    conda-forge
pulseaudio-client         16.1                 hb77b528_5    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyparsing                 3.1.1              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.12.1          hab00c5b_1_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.12                    4_cp312    conda-forge
pyvista                   0.43.1             pyhd8ed1ab_0    conda-forge
qt-main                   5.15.8              h82b777d_17    conda-forge
readline                  8.2                  h8228510_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
scalapack                 2.2.0                hd931219_1    conda-forge
scooby                    0.9.2              pyhd8ed1ab_0    conda-forge
scotch                    7.0.4                h23d43cc_1    conda-forge
setuptools                69.0.3             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
slepc                     3.20.1          real_hac23e11_100    conda-forge
slepc4py                  3.20.1          real_h421bb0b_100    conda-forge
snappy                    1.1.10               h9fff704_0    conda-forge
sqlite                    3.44.2               h2c6b66d_0    conda-forge
suitesparse               5.10.1               h3ec001c_2    conda-forge
superlu                   5.2.2                h00795ac_0    conda-forge
superlu_dist              8.2.1                h5902e8c_0    conda-forge
svt-av1                   1.7.0                h59595ed_0    conda-forge
sysroot_linux-64          2.12                he073ed8_16    conda-forge
tbb                       2021.11.0            h00ab1b0_0    conda-forge
tbb-devel                 2021.11.0            h00ab1b0_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tzdata                    2023d                h0c530f3_0    conda-forge
urllib3                   2.1.0              pyhd8ed1ab_0    conda-forge
utfcpp                    4.0.5                ha770c72_0    conda-forge
vtk                       9.2.6           qt_py312h1234567_220    conda-forge
vtk-base                  9.2.6           qt_py312h1234567_220    conda-forge
vtk-io-ffmpeg             9.2.6           qt_py312h1234567_220    conda-forge
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
wslink                    1.12.4             pyhd8ed1ab_0    conda-forge
x264                      1!164.3095           h166bdaf_2    conda-forge
x265                      3.5                  h924138e_3    conda-forge
xcb-util                  0.4.0                hd590300_1    conda-forge
xcb-util-image            0.4.0                h8ee46fc_1    conda-forge
xcb-util-keysyms          0.4.0                h8ee46fc_1    conda-forge
xcb-util-renderutil       0.3.9                hd590300_1    conda-forge
xcb-util-wm               0.4.1                h8ee46fc_1    conda-forge
xkeyboard-config          2.40                 hd590300_0    conda-forge
xorg-fixesproto           5.0               h7f98852_1002    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.1.1                hd590300_0    conda-forge
xorg-libsm                1.2.4                h7391055_0    conda-forge
xorg-libx11               1.8.7                h8ee46fc_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxfixes            5.0.3             h7f98852_1004    conda-forge
xorg-libxrender           0.9.11               hd590300_0    conda-forge
xorg-libxt                1.3.0                hd590300_1    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xf86vidmodeproto     2.3.1             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
yarl                      1.9.3           py312h98912ed_0    conda-forge
zeromq                    4.3.5                h59595ed_0    conda-forge
zfp                       0.5.5                h9c3ff4c_8    conda-forge
zlib                      1.2.13               hd590300_5    conda-forge
zlib-ng                   2.0.7                h0b41bf4_0    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge

First encountered the error attempting to run demo_navier-stokes.py in command line, but it appears that the issue is related to the dolfinx import:

>>> import dolfinx
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 4 Illegal instruction: Likely due to memory corruption
[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.
Abort(59) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0

I have just pulled a Linux Mint docker image on my Debian amd64 laptop with docker run -it --rm linuxmintd/mint21.2-amd64, and I cannot replicate the error. There may be something specific about your systems @zuehre and @Francis

Maybe @minrk has further ideas on what the issue could be.

1 Like

I can reproduce this in a docker container on an arm mac if I run with amd64 (docker run --platform linux/amd64 quay.io/condaforge/miniforge3), but it works fine if the container is native arm.

Can you tell us more about the VM? Is it perhaps, say, an x86 VM on an ARM mac or something like that? There have been issues where the processor emulation doesn’t support all the expected AVX instructions, resulting in these Illegal Instruction errors.

1 Like

I think this may have been the problem. Switching CPU type from ‘x86-64-v2-AES’ to ‘host’ in Proxmox seems to have resolved the issue. Thank you for the guidance!

I ended up doing a reformat of my workstation, updating to Ubuntu 22.04.3 LTS. I fresh installed conda and then did exactly as zuehre did (the recommended installation) and the problem persists.

My issue also happens when i type “import dolfinx”. I think the issue is therefore system dependent, I’m unsure as to what it could be. My machine runs an intel i7 970 CPU, so perhaps it’s a compatibility issue. As I’m not working on a VM, I’m unsure if i could follow the steps Zuehre used to fix the issue.

EDIT: However installing through the ubuntu PPA now works.

Hello everyone,

I have been encountering a similar error since the last update of DolfinX.

On my computer A, my structural calculation code crashes with the previously mentioned error 59 when I try to perform a non-linear calculation. However, the Hyperelasticity tutorial obtained at this address: Hyperelasticity — FEniCSx tutorial, which also calls the Petsc Newton solver, runs without difficulty.

My computer A runs on Ubuntu 22.04, and I performed the installation of DolfinX 0.7.3 with Conda.

On computer B, my calculation code crashes with the error below:

File "/home/bouteillerp/Bureau/Codes/CHARONX/CharonX/CharonX/Solve/Solve.py", line 200, in iterative_solve
    self.problem_solve()

  File "/home/bouteillerp/Bureau/Codes/CHARONX/CharonX/CharonX/Solve/Solve.py", line 143, in problem_solve
    self.solver.solve(self.pb.u)

  File "/usr/lib/petsc/lib/python3/dist-packages/dolfinx/nls/petsc.py", line 46, in solve
    n, converged = super().solve(u.vector)

RuntimeError: Failed to successfully call PETSc function 'KSPSolve'. PETSc error code is: 92, See https://petsc.org/release/overview/linear_solve_table/ for possible LU and Cholesky solvers

The Hyperelasticity tutorial obtained at this address: Hyperelasticity — FEniCSx tutorial crashes with the same error:

RuntimeError: Failed to successfully call PETSc function 'KSPSolve'. PETSc error code is: 92, See https://petsc.org/release/overview/linear_solve_table/ for possible LU and Cholesky solvers

My computer B runs on Ubuntu 22.04, and I performed the installation of DolfinX 0.7.3 using the PPA.

Do you have any idea what could be causing this issue?

Sincerely,
Paul

@BouteillerP the demo code runs without error on a fresh installation of Ubuntu 22.04 (jammy).

An error like that might occur due to a mismatch in library versions.
To investigate further, can you return the output from

cat /etc/os-release

dpkg -l *libopenmpi* *mpi4py* *numpy* *petsc* *slepc* *dolfin* *ffc* *ufl* *basix* | cat

ls -ld /usr/lib/petsc
ls -l /etc/alternatives/petsc

python3 --version

python3 -c "import mpi4py; print(mpi4py.__path__)"
python3 -c "import numpy; print(numpy.__path__)"
python3 -c "import petsc4py; print(petsc4py.__path__)"

python3 -c "import basix; print(basix.__path__)"
python3 -c "import ufl; print(ufl.__path__)"
python3 -c "import ffcx; print(ffcx.__path__)"
python3 -c "import dolfinx; print(dolfinx.__path__)"

The tested code was modified from the demo file to remove plotting, since plot features depend on the local VTK configuration:

from dolfinx import log, default_scalar_type
from dolfinx.fem.petsc import NonlinearProblem
from dolfinx.nls.petsc import NewtonSolver

from dolfinx import nls
import numpy as np
import ufl

from mpi4py import MPI
from dolfinx import fem, mesh
L = 20.0
domain = mesh.create_box(MPI.COMM_WORLD, [[0.0, 0.0, 0.0], [L, 1, 1]], [20, 5, 5], mesh.CellType.hexahedron)
V = fem.VectorFunctionSpace(domain, ("Lagrange", 2))
def left(x):
    return np.isclose(x[0], 0)


def right(x):
    return np.isclose(x[0], L)


fdim = domain.topology.dim - 1
left_facets = mesh.locate_entities_boundary(domain, fdim, left)
right_facets = mesh.locate_entities_boundary(domain, fdim, right)
# Concatenate and sort the arrays based on facet indices. Left facets marked with 1, right facets with two
marked_facets = np.hstack([left_facets, right_facets])
marked_values = np.hstack([np.full_like(left_facets, 1), np.full_like(right_facets, 2)])
sorted_facets = np.argsort(marked_facets)
facet_tag = mesh.meshtags(domain, fdim, marked_facets[sorted_facets], marked_values[sorted_facets])
u_bc = np.array((0,) * domain.geometry.dim, dtype=default_scalar_type)
left_dofs = fem.locate_dofs_topological(V, facet_tag.dim, facet_tag.find(1))
bcs = [fem.dirichletbc(u_bc, left_dofs, V)]
B = fem.Constant(domain, default_scalar_type((0, 0, 0)))
T = fem.Constant(domain, default_scalar_type((0, 0, 0)))
v = ufl.TestFunction(V)
u = fem.Function(V)
# Spatial dimension
d = len(u)

# Identity tensor
I = ufl.variable(ufl.Identity(d))

# Deformation gradient
F = ufl.variable(I + ufl.grad(u))

# Right Cauchy-Green tensor
C = ufl.variable(F.T * F)

# Invariants of deformation tensors
Ic = ufl.variable(ufl.tr(C))
J = ufl.variable(ufl.det(F))
# Elasticity parameters
E = default_scalar_type(1.0e4)
nu = default_scalar_type(0.3)
mu = fem.Constant(domain, E / (2 * (1 + nu)))
lmbda = fem.Constant(domain, E * nu / ((1 + nu) * (1 - 2 * nu)))
# Stored strain energy density (compressible neo-Hookean model)
psi = (mu / 2) * (Ic - 3) - mu * ufl.ln(J) + (lmbda / 2) * (ufl.ln(J))**2
# Stress
# Hyper-elasticity
P = ufl.diff(psi, F)
# P = 2.0 * mu * ufl.sym(ufl.grad(u)) + lmbda * ufl.tr(ufl.sym(ufl.grad(u))) * I
metadata = {"quadrature_degree": 4}
ds = ufl.Measure('ds', domain=domain, subdomain_data=facet_tag, metadata=metadata)
dx = ufl.Measure("dx", domain=domain, metadata=metadata)
# Define form F (we want to find u such that F(u) = 0)
F = ufl.inner(ufl.grad(v), P) * dx - ufl.inner(v, B) * dx - ufl.inner(v, T) * ds(2)
problem = NonlinearProblem(F, u, bcs)
solver = NewtonSolver(domain.comm, problem)

# Set Newton solver options
solver.atol = 1e-8
solver.rtol = 1e-8
solver.convergence_criterion = "incremental"

Vs = fem.FunctionSpace(domain, ("Lagrange", 2))
magnitude = fem.Function(Vs)
us = fem.Expression(ufl.sqrt(sum([u[i]**2 for i in range(len(u))])), Vs.element.interpolation_points())
magnitude.interpolate(us)
#warped["mag"] = magnitude.x.array
log.set_log_level(log.LogLevel.INFO)
tval0 = -1.5
for n in range(1, 10):
    T.value[2] = n * tval0
    num_its, converged = solver.solve(u)
    assert (converged)
    u.x.scatter_forward()
    print(f"Time step {n}, Number of iterations {num_its}, Load {T.value}")
    magnitude.interpolate(us)

Here is my setup:

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy


     Architecture Description
+++-===============================-================================================-============-==============================================================================
ii  basix-doc                       0.7.0-3~ppa1~jammy1                              all          Finite Element Basis Function Definition Runtime Library (docs)
un  dh-sequence-numpy3              <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  dolfin-bin                      2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~jammy1 all          Executable scripts for DOLFIN
ii  dolfin-doc                      2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~jammy1 all          Documentation and demo programs for DOLFIN
ii  dolfinx-doc                     1:0.7.3-3~ppa1~jammy1                            all          Documentation and demo programs for DOLFIN
ii  libbasix-dev:amd64              0.7.0-3~ppa1~jammy1                              amd64        Finite Element Basis Function Definition Runtime Library (development headers)
ii  libbasix0.7:amd64               0.7.0-3~ppa1~jammy1                              amd64        Finite Element Basis Function Definition Runtime Library (Python 3)
ii  libboost-numpy-dev              1.74.0.3ubuntu7                                  amd64        Boost.Python NumPy extensions development files (default version)
un  libboost-numpy1.65-dev          <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libboost-numpy1.67-dev          <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libboost-numpy1.70-dev          <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libboost-numpy1.71-dev          <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  libboost-numpy1.74-dev          1.74.0-14ubuntu3                                 amd64        Boost.Python NumPy extensions development files
ii  libboost-numpy1.74.0            1.74.0-14ubuntu3                                 amd64        Boost.Python NumPy extensions
un  libboost-numpy1.74.0-py310      <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  libdolfin-dev:amd64             2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~jammy1 amd64        Shared links and development files for DOLFIN
ii  libdolfin-dev-common            2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~jammy1 all          Common header files for DOLFIN
un  libdolfin0-dev                  <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libdolfin1.0-dev                <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libdolfin1.1-dev                <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libdolfin1.2-dev                <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libdolfin1.3-dev                <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libdolfin1.4-dev                <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  libdolfin2019.2:amd64           2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~jammy1 amd64        Shared libraries for DOLFIN
un  libdolfinx-complex-dev          <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  libdolfinx-dev:amd64            1:0.7.3-3~ppa1~jammy1                            amd64        Shared links and header files for DOLFIN
ii  libdolfinx-real-dev:amd64       1:0.7.3-3~ppa1~jammy1                            amd64        Shared links and header files for DOLFIN (real numbers)
ii  libdolfinx-real0.7:amd64        1:0.7.3-3~ppa1~jammy1                            amd64        Shared libraries for DOLFIN
ii  libkf5newstuffcore5:amd64       5.92.0-0ubuntu1.1                                amd64        Support for downloading application assets from the network.
ii  libopenmpi-dev:amd64            4.1.2-2ubuntu1                                   amd64        high performance message passing library -- header files
ii  libopenmpi3:amd64               4.1.2-2ubuntu1                                   amd64        high performance message passing library -- shared library
un  libpetsc-complex-3.6.2-dev      <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libpetsc-complex-3.6.3-dev      <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libpetsc-complex3.15-dbg        <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libpetsc-complex3.15-dev        <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libpetsc-real3.10               <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  libpetsc-real3.15:amd64         3.15.5+dfsg1-1build2                             amd64        Shared libraries for version 3.15 of PETSc
un  libpetsc-real3.15-dbg           <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  libpetsc-real3.15-dev:amd64     3.15.5+dfsg1-1build2                             amd64        Static libraries, shared links, header files for PETSc
un  libpetsc3.10-dev-common         <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libpetsc3.10-dev-examples       <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libpetsc3.15                    <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  libpetsc3.15-dev-common         3.15.5+dfsg1-1build2                             all          Common header and support dev files for PETSc
ii  libpetsc3.15-dev-examples       3.15.5+dfsg1-1build2                             all          Static libraries, shared links, header files for PETSc
un  libpetsc3.15.5-dev              <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libpetsc3.6                     <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libpetsc3.6.2-dev               <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libpetsc3.6.3-dev               <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libslepc-real3.10               <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  libslepc-real3.15               3.15.2+dfsg1-2                                   amd64        Scalable Library for Eigenvalue Problem Computations
ii  libslepc-real3.15-dev           3.15.2+dfsg1-2                                   amd64        Scalable Library for Eigenvalue Problem Computations
un  libslepc2.3.2                   <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libslepc2.3.2-dev               <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libslepc3.15-dev-examples       <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libslepc3.15.2-dev              <aucune>                                         <aucune>     (aucune description n'est disponible)
un  libslepc3.6                     <aucune>                                         <aucune>     (aucune description n'est disponible)
un  petsc-dev                       <aucune>                                         <aucune>     (aucune description n'est disponible)
un  petsc3.15-doc                   <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python-ffc                      <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python-numpy                    <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python-numpy-doc                <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python-petsc                    <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python-petsc4py                 <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  python-petsc4py-doc             3.15.1-2build1                                   all          Python bindings for PETSc libraries: documentation and examples
un  python-petsc4py-docs            <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python-slepc4py-doc             <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python-ufl                      <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  python-ufl-doc                  2023.2.0-3~ppa1~jammy1                           all          documentation and demos for UFL
ii  python-ufl-legacy-doc           1:2022.3.0-2~ppa1~jammy1                         all          documentation and demos for legacy UFL
ii  python3-basix                   0.7.0-3~ppa1~jammy1                              amd64        Finite Element Basis Function Definition Runtime Library (Python 3)
ii  python3-dolfin                  2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~jammy1 amd64        Base Python interface for DOLFIN (Python 3)
ii  python3-dolfin-real             2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~jammy1 amd64        Python interface for DOLFIN
un  python3-dolfin64-real           <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  python3-dolfinx:amd64           1:0.7.3-3~ppa1~jammy1                            amd64        Python interface for DOLFIN (Python 3)
un  python3-dolfinx-complex         <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-dolfinx-mpc             <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  python3-dolfinx-real            1:0.7.3-3~ppa1~jammy1                            amd64        Python interface for DOLFIN (Python 3)
ii  python3-ffc                     2019.2.0~legacy20230509.35df986-2~ppa1~jammy1    all          compiler for finite element variational forms (Python 3)
ii  python3-ffcx                    1:0.7.0-3~ppa1~jammy1                            all          next-gen compiler for finite element variational forms (Python 3)
ii  python3-mpi4py                  3.1.3-1build2                                    amd64        bindings of the Message Passing Interface (MPI) standard
ii  python3-numpy                   1:1.21.5-1ubuntu22.04.1                          amd64        Fast array facility to the Python 3 language
un  python3-numpy-abi9              <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-numpy-api14             <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-numpy-dev               <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  python3-numpydoc                1.2-1                                            all          Sphinx extension to support docstrings in Numpy format -- Python3
ii  python3-petsc4py                3.15.1-2build1                                   all          Python 3 bindings for PETSc libraries
un  python3-petsc4py-64-complex     <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-petsc4py-64-complex3.15 <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-petsc4py-64-real        <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-petsc4py-64-real3.15    <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-petsc4py-complex        <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-petsc4py-complex3.15    <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  python3-petsc4py-real           3.15.1-2build1                                   all          Python 3 bindings for PETSc libraries (real numbers)
ii  python3-petsc4py-real3.15       3.15.1-2build1                                   amd64        Python 3 bindings for PETSc 3.15 libraries (real numbers)
ii  python3-slepc4py                3.15.1-2build1                                   all          Python 3 bindings for SLEPc libraries
un  python3-slepc4py-64-complex     <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-slepc4py-64-complex3.15 <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-slepc4py-64-real        <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-slepc4py-64-real3.15    <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-slepc4py-complex        <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3-slepc4py-complex3.15    <aucune>                                         <aucune>     (aucune description n'est disponible)
ii  python3-slepc4py-real           3.15.1-2build1                                   all          Python 3 bindings for SLEPc libraries (real numbers)
ii  python3-slepc4py-real3.15       3.15.1-2build1                                   amd64        Python 3 bindings for SLEPc 3.15 libraries (real numbers)
ii  python3-ufl                     2023.2.0-3~ppa1~jammy1                           all          unified language for form-compilers (Python 3)
ii  python3-ufl-legacy              1:2022.3.0-2~ppa1~jammy1                         all          legacy unified language for form-compilers (Python 3)
un  python3.10-numpy                <aucune>                                         <aucune>     (aucune description n'est disponible)
un  python3.10-slepc4py-real3.15    <aucune>                                         <aucune>     (aucune description n'est disponible)
un  slepc3.15-doc                   <aucune>                                         <aucune>     (aucune description n'est disponible)



lrwxrwxrwx 1 root root 23 mai   19  2022 /usr/lib/petsc -> /etc/alternatives/petsc


lrwxrwxrwx 1 root root 49 mai   19  2022 /etc/alternatives/petsc -> /usr/lib/petscdir/petsc3.15/x86_64-linux-gnu-real

Python 3.10.12

['/usr/lib/python3/dist-packages/mpi4py']

['/home/bouteillerp/.local/lib/python3.10/site-packages/numpy']

['/home/bouteillerp/.local/lib/python3.10/site-packages/petsc4py']

['/usr/lib/python3/dist-packages/basix']

['/usr/lib/python3/dist-packages/ufl']

['/usr/lib/python3/dist-packages/ffcx']

['/usr/lib/petsc/lib/python3/dist-packages/dolfinx']

the test file however throws the same error


  File "/home/bouteillerp/.local/lib/python3.10/site-packages/spyder_kernels/py3compat.py", line 356, in compat_exec
    exec(code, globals, locals)

  File "/home/bouteillerp/Bureau/Codes/CHARONX/CharonX/CharonX/Solve/sanstitre0.py", line 92, in <module>
    num_its, converged = solver.solve(u)

  File "/usr/lib/petsc/lib/python3/dist-packages/dolfinx/nls/petsc.py", line 46, in solve
    n, converged = super().solve(u.vector)

RuntimeError: Failed to successfully call PETSc function 'KSPSolve'. PETSc error code is: 92, See https://petsc.org/release/overview/linear_solve_table/ for possible LU and Cholesky solvers

Inspect your python path reports:

In particular your local installation of petsc4py will be messing it up.

import dolfinx failed on Mac-OS, M1 computer, 16G memory

python: Python 3.12.1 | packaged by conda-forge | (main, Dec 23 2023, 08:05:03) [Clang 16.0.6 ] on darwin

Error message:

import dolfinx
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 4 Illegal instruction: Likely due to memory corruption
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see FAQ — PETSc 3.20.4 documentation and FAQ — PETSc 3.20.4 documentation
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
Abort(59) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0

installation procedure followed website
conda create -n fenicsx-env
conda activate fenicsx-env
conda install -c conda-forge fenics-dolfinx mpich pyvista

Any suggestions? Many thanks!

Hello everybody!

I experience exactly the same error.
But in my case, the error does not appear when I import dolfinx, it is rather a crash when I run the hyperelasticity example from The FEniCSx tutorial — FEniCSx tutorial.

I had a first error using the function:
V = fem.VectorFunctionSpace(domain, (“Lagrange”, 2))

Which I finally replaced by:
element = ufl.VectorElement(“Lagrange”, domain.ufl_cell(), 2)
V = fem.FunctionSpace(domain, element)

It fixed the issue, but now the computation is crashing with the following error:

[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 4 Illegal instruction: Likely due to memory corruption
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see FAQ — PETSc 3.20.4 documentation and FAQ — PETSc 3.20.4 documentation
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
Abort(59) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0

I am running on a Windows11 PC, with a Ubuntu 22.04.3 LTS distribution installed through WSL and I am using VScode to run the code.

I installed FEniCSx using conda.
Here is the version of dolfinx I am using:

DOLFINx version: 0.7.3 based on GIT commit: b9f398d6fae07f0386b947a119eb2463665c823b of GitHub - FEniCS/dolfinx: Next generation FEniCS problem solving environment

Can anyone tell me how to fix this issue?
I could run the 2D navier-stokes cylinder flow properly without any issue.
But now I’m stuck :frowning:

I am now thinking about installing the old version of FEniCS, such a pitty…

Thanks for helping guys!