PySDF error in Modulus 22.03


I am trying a bare metal installation of Modulus 22.03. The operating system used is Ubuntu 20.04 LTS.

The Modulus and the PySDF library installations completed without error and “examples/ldc/” was successfully executed. However, the following error occurred when executing “examples/aneurysm/”.

junichi@GLM:~/Modulus/examples/v22.03/examples/aneurysm$ python3
Error importing pysdf. Make sure ‘’ is in LD_LIBRARY_PATH and pysdf is installed
Traceback (most recent call last):
File “”, line 25, in
from modulus.geometry.tessellation.tessellation import Tessellation
File “/home/junichi/.local/lib/python3.8/site-packages/modulus-22.3-py3.8.egg/modulus/geometry/tessellation/”, line 11, in
import pysdf.sdf as pysdf
ImportError: cannot open shared object file: No such file or directory

The above error was avoided by modifying line 11 in “Modulus/modulus/geometry/tessellation/” as follows.

  • Before modification

import pysdf.sdf as pysdf

  • After modification

import pysdf as pysdf

However, when “” was run again, the following error occurred

junichi@GLM:~/Modulus/examples/v22.03/examples/aneurysm$ python3
max_steps: 1500000
grad_agg_freq: 1
rec_results_freq: 10000
rec_validation_freq: ${training.rec_results_freq}
rec_inference_freq: ${training.rec_results_freq}
rec_monitor_freq: ${training.rec_results_freq}
rec_constraint_freq: 50000
save_network_freq: 1000
print_stats_freq: 100
summary_freq: 1000
amp: false
amp_dtype: float16
use_ntk: false
save_name: null
run_freq: 1000
profile: false
start_step: 0
end_step: 100
name: nvtx
network_dir: .
initialization_network_dir: ‘’
save_filetypes: vtk
summary_histograms: false
jit: false
device: ‘’
debug: false
run_mode: train
target: modulus.architecture.fully_connected.FullyConnectedArch
layer_size: 512
nr_layers: 6
skip_connections: false
adaptive_activations: false
weight_norm: true
target: modulus.aggregator.Sum
weights: null
compute_gradients: adam_compute_gradients
apply_gradients: adam_apply_gradients
target: torch.optim.Adam
lr: 0.001
- 0.9
- 0.999
eps: 1.0e-08
weight_decay: 0.0
amsgrad: false
target: custom
name: tf.ExponentialLR
decay_rate: 0.95
decay_steps: 15000
inlet: 1100
outlet: 650
no_slip: 5200
interior: 6000
integral_continuity: 310
custom: ???

Error executing job with overrides: [ ]
Traceback (most recent call last):
File “”, line 153, in run
interior = PointwiseInteriorConstraint(
File “/home/junichi/.local/lib/python3.8/site-packages/modulus-22.3-py3.8.egg/modulus/continuous/constraints/”, line 399, in __init__
invar = geometry.sample_interior(
File “/home/junichi/.local/lib/python3.8/site-packages/modulus-22.3-py3.8.egg/modulus/geometry/tessellation/”, line 375, in sample_interior
sdf_field, sdf_derivative = self.sdf(sampled_points)
File “/home/junichi/.local/lib/python3.8/site-packages/modulus-22.3-py3.8.egg/modulus/geometry/tessellation/”, line 64, in _sdf
sdf_field, sdf_derivative = pysdf.signed_distance_field(
AttributeError: module ‘pysdf’ has no attribute ‘signed_distance_field’

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

I would appreciate it if you could advise me how to resolve this error.

Best regards,
Junichi Fukui

I faced the same issue. I used the pysdf from the older version with the older steps. It works fine.

Thank you for your advice! I will try to run the tutorial with the older version of pysdf library.

Hello, unfortunately we decided to pull the pysdf support for the bare metal installation because it became too cumbersome to maintain. This is reflected in the installation instructions. If the tessellated geometry module is required then we suggest using the Docker image. We are pushing now to have pysdf released as a separate library but don’t have any release date for this. In the mean time we are looking into a slower fallback option when pysdf is not installed.