cnr-isti-vclab / PyMeshLab

The open source mesh processing python library
GNU General Public License v3.0
784 stars 64 forks source link

Texture Map Defragmentation brings to a core dump #361

Open pierfrancescomartinello opened 7 months ago

pierfrancescomartinello commented 7 months ago

Hello. I'm having issues working with the Texture Map Defragmentation, as when called, it aborts the program yielding the following error Aborted (core dumped) .

The python script I'm executing is the following:

import pymeshlab

ms = pymeshlab.MeshSet()
ms.load_new_mesh("<name>.obj")

ms.apply_texmap_defragmentation(matchingthreshold=5, boundarytolerance=0.02, distortiontolerance=3, globaldistortiontolerance=0.5, offsetfactor=50)

I'm working on a laptop running Linux and with Python 3.10.12. I've tried different versions of the software, including the last stable and the last nightly versions. If more informations are needed feel free to ask and I will do my best to provide it.


EDIT 18/03/2024 After further inspection of the documentation, I've also tried running the command pytest --pyargs pymeshlab and that showed the following error (the initial part of the output has been trimmed since I don't think it's relevant):

...
tests/test_select_faces_with_edge_longer_than.py [ 92%]                                                                                                                
tests/test_texture_map_defragmentation.py Fatal Python error: Aborted

Current thread 0x000071595317e000 (most recent call first):
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pymeshlab/__init__.py", line 41 in filter_function
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pymeshlab/tests/test_texture_map_defragmentation.py", line 17 in test_texture_map_defragmentation
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/python.py", line 195 in pytest_pyfunc_call
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/python.py", line 1789 in runtest
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/runner.py", line 167 in pytest_runtest_call
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/runner.py", line 260 in <lambda>
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/runner.py", line 339 in from_call
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/runner.py", line 259 in call_runtest_hook
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/runner.py", line 220 in call_and_report
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/runner.py", line 131 in runtestprotocol
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/runner.py", line 112 in pytest_runtest_protocol
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/main.py", line 349 in pytest_runtestloop
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/main.py", line 324 in _main
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/main.py", line 270 in wrap_session
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/main.py", line 317 in pytest_cmdline_main
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 167 in main
  File "/home/pierfrancesco/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 190 in console_main
  File "/home/pierfrancesco/.local/bin/pytest", line 8 in <module>

Extension modules: lazy_object_proxy.cext, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, 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 (total: 14)
Aborted (core dumped)

Best Regards Pierfrancesco

alemuntoni commented 7 months ago

The texture map defragmentation filter runs on GPU and requires an opengl context to be executed, therefore the problem could be caused by the system setup. Could you please check if the machine that you are using allows to run opengl?

pierfrancescomartinello commented 7 months ago

OpenGL in my machine is set up and working. Through more digging, I've also found that while using MeshLab and trying to use "Texture Map Defragmentation" the app crashes

Simo0800 commented 7 months ago

OpenGL in my machine is set up and working. Through more digging, I've also found that while using MeshLab and trying to use "Texture Map Defragmentation" the app crashes

I have the same problem with MeshLab. I use a MacBook Air with a M1 processor.

ansj11 commented 4 months ago

OpenGL in my machine is set up and working. Through more digging, I've also found that while using MeshLab and trying to use "Texture Map Defragmentation" the app crashes

do you have solved the problem? I have the same problem in my MacBook Pro with M2 processor

pierfrancescomartinello commented 4 months ago

Unfortunately, we haven't find a solution nor a workaround. We are resulting in using no texture for our meshes for now.

ansj11 commented 4 months ago

Unfortunately, we haven't find a solution nor a workaround. We are resulting in using no texture for our meshes for now.

I used the texture-defrag(!https://github.com/maggio-a/texture-defrag) in linux and it works!

pierfrancescomartinello commented 4 months ago

Unfortunately, we haven't find a solution nor a workaround. We are resulting in using no texture for our meshes for now.

I used the texture-defrag(!https://github.com/maggio-a/texture-defrag) in linux and it works!

Would you please describe the architecture of the machine you're using, so that we can also reproduce your outcome?

PM

ansj11 commented 4 months ago

Unfortunately, we haven't find a solution nor a workaround. We are resulting in using no texture for our meshes for now.

I used the texture-defrag(!https://github.com/maggio-a/texture-defrag) in linux and it works!

Would you please describe the architecture of the machine you're using, so that we can also reproduce your outcome?

PM

my linux is Linux version 4.15.0-197-generic (buildd@lcy02-amd64-110) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #208-Ubuntu SMP Tue Nov 1 17:23:37 UTC 2022 and this repo must run with display window. My texture is in an atlas format, so the results didn't solve my problem. I need to generate large chunks of texture.