microsoft / microsoft/TRELLIS.2

Segmentation Fault in Extracting Volume Attr from GLB

Open
#30 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
11.3k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

Hi. I am trying to used the provided ovoxel module to extract ovoxels give .glb mesh. I noticed that there is a chance that a segmentation fault could be triggered when calling into the c function at https://github.com/microsoft/TRELLIS.2/blob/1762f493fe7731a3b7cc6b79ad5da7b015b516c1/o-voxel/o_voxel/convert/volumetic_attr.py#L255C6-L255C57

  • The problem happens from time to time, and two of the objects has sha256 of 4110952ed6ea45a491a6f939102d973f and 6a8640bdf6a8478
    18b2efc062c217187. A manual check with 3D viewer and blender shows the object being valid.

  • The seg fault also happens with only one worker.

  • The program is executed in a WSL2 environment with 5090 GPU.

Could you please kindly look into the reason of this seg fault problem, or provide any ideas of workaround to do checking and skip the objects? It will be very much appreciated!

Below is the program output with a fault handler.


Voxel count: 3054957 /mnt/e/Dataset/trellisFull/ObjaverseXL_sketchfab/raw/hf-objaverse-v1/glbs/000-138/4110952ed6ea45a491a6f939102d973f.glb
Voxelize settings:
Voxel size: tensor([0.0010, 0.0010, 0.0010])
Grid size: tensor([1024, 1024, 1024], dtype=torch.int32)
AABB: tensor([[-0.5000, -0.5000, -0.5000],
[ 0.5000, 0.5000, 0.5000]])

Loading Scene: 0%| | 0/5 [00:00<?, ?it/s]
Loading Scene: 100%|██████████| 5/5 [00:00<00:00, 76.98it/s]
Mipmaps construction took 0.193285 seconds.
Fatal Python error: Segmentation fault

Current thread 0x0000716f2b7fe640 (most recent call first):
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/site-packages/o_voxel/convert/volumetic_attr.py", line 255 in textured_mesh_to_volumetric_attr
File "/home/yxliu22/research/multidiffusion/related_works/trellis2/dataset_toolkits/encode_tr2_latent.py", line 180 in mesh_to_ovoxel
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116 in decorate_context
File "/home/yxliu22/research/multidiffusion/related_works/trellis2/dataset_toolkits/encode_tr2_latent.py", line 110 in _encode
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116 in decorate_context
File "/home/yxliu22/research/multidiffusion/related_works/trellis2/dataset_toolkits/datasets/ObjaverseXL.py", line 84 in worker
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/concurrent/futures/thread.py", line 58 in run
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/concurrent/futures/thread.py", line 83 in _worker
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/threading.py", line 953 in run
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x0000716f2bfff640 (most recent call first):
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/threading.py", line 324 in wait
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/threading.py", line 607 in wait
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/site-packages/tqdm/_monitor.py", line 60 in run
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007173161fa740 (most recent call first):
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/threading.py", line 1116 in _wait_for_tstate_lock
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/threading.py", line 1096 in join
File "/home/yxliu22/softwares/anaconda3/envs/trellis2/lib/python3.10/concurrent/futures/thread.py", line 235 in shutdown
File "/home/yxliu22/research/multidiffusion/related_works/trellis2/dataset_toolkits/datasets/ObjaverseXL.py", line 105 in foreach_instance
File "/home/yxliu22/research/multidiffusion/related_works/trellis2/dataset_toolkits/encode_tr2_latent.py", line 326 in

Extension modules: numpy._core._multiarray_umath, numpy.linalg._umath_linalg, torch._C, torch._C._dynamo.autograd_compiler, torch._C._dynamo.eval_frame, torch._C._dynamo.guards, torch._C._dynamo.utils, torch._C._fft, torch._C._linalg, torch._C._nested, torch._C._nn, torch._C._sparse, torch._C._special, pyarrow.lib, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.nattype, pandas._libs.tslibs.timezones, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.strptime, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_dispatch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.lib, pyarrow._compute, pandas._libs.ops, pandas._libs.hashing, pandas._libs.arrays, pandas._libs.tslib, pandas._libs.sparse, pandas._libs.internals, pandas._libs.indexing, pandas._libs.index, pandas._libs.writers, pandas._libs.join, pandas._libs.window.aggregations, pandas._libs.window.indexers, pandas._libs.reshape, pandas._libs.groupby, pandas._libs.json, pandas._libs.parsers, pandas._libs.testing, scipy._lib._ccallback_c, charset_normalizer.md, scipy.sparse._sparsetools, _csparsetools, scipy.sparse._csparsetools, scipy.linalg._fblas, scipy.linalg._flapack, scipy.linalg.cython_lapack, scipy.linalg._cythonized_array_utils, scipy.linalg._solve_toeplitz, scipy.linalg._decomp_lu_cython, scipy.linalg._matfuncs_sqrtm_triu, scipy.linalg._matfuncs_expm, scipy.linalg._linalg_pythran, scipy.linalg.cython_blas, scipy.linalg._decomp_update, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpack, scipy.sparse.linalg._propack._spropack, scipy.sparse.linalg._propack._dpropack, scipy.sparse.linalg._propack._cpropack, scipy.sparse.linalg._propack._zpropack, scipy.sparse.csgraph._tools, scipy.sparse.csgraph._shortest_path, scipy.sparse.csgraph._traversal, scipy.sparse.csgraph._min_spanning_tree, scipy.sparse.csgraph._flow, scipy.sparse.csgraph._matching, scipy.sparse.csgraph._reordering, scipy.spatial._ckdtree, scipy._lib.messagestream, scipy.spatial._qhull, scipy.spatial._voronoi, scipy.spatial._distance_wrap, scipy.spatial._hausdorff, scipy.special._ufuncs_cxx, scipy.special._ufuncs, scipy.special._specfun, scipy.special._comb, scipy.special._ellip_harm_2, scipy.spatial.transform._rotation, PIL._imaging, scipy.optimize._group_columns, scipy.optimize._trlib._trlib, scipy.optimize._lbfgsb, _moduleTNC, scipy.optimize._moduleTNC, scipy.optimize._cobyla, scipy.optimize._slsqp, scipy.optimize._minpack, scipy.optimize._lsq.givens_elimination, scipy.optimize._zeros, scipy.optimize._cython_nnls, scipy._lib._uarray._uarray, scipy.linalg._decomp_interpolative, scipy.optimize._bglu_dense, scipy.optimize._lsap, scipy.optimize._direct, PIL._imagingft, scipy.ndimage._nd_image, scipy.ndimage._rank_filter_1d, _ni_label, scipy.ndimage._ni_label, zstandard.backend_c, _brotli, requests.packages.charset_normalizer.md, requests.packages.chardet.md, yaml._yaml, PIL._imagingmath, cuda_utils, __triton_launcher (total: 135)
./prepare_dataset.sh: line 90: 1856 Segmentation fault (core dumped) python dataset_toolkits/encode_tr2_latent.py ${DATASET_NAME} --output_dir ${OUTPUT_DIR} --resolution 64 --max_workers 1

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at o_voxel/convert/volumetic_attr.py line 255, then trace the call from dataset_toolkits/encode_tr2_latent.py and prepare_dataset.sh line 90. Reproduce with the two reported GLB hashes under one worker in the WSL2 setup, and determine whether the extraction can complete safely or skip the affected objects without a segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.