PyMeshLab icon indicating copy to clipboard operation
PyMeshLab copied to clipboard

Texture Map Defragmentation brings to a core dump

Open pierfrancescomartinello opened this issue 1 year ago • 8 comments

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

pierfrancescomartinello avatar Mar 15 '24 15:03 pierfrancescomartinello

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?

alemuntoni avatar Mar 18 '24 14:03 alemuntoni

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

pierfrancescomartinello avatar Mar 18 '24 15:03 pierfrancescomartinello

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.

Simo0800 avatar Mar 18 '24 15:03 Simo0800

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

ansj11 avatar Jun 12 '24 04:06 ansj11

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

pierfrancescomartinello avatar Jun 12 '24 09:06 pierfrancescomartinello

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!

ansj11 avatar Jun 18 '24 09:06 ansj11

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

pierfrancescomartinello avatar Jun 18 '24 10:06 pierfrancescomartinello

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.

ansj11 avatar Jun 18 '24 10:06 ansj11

This issue has been automatically marked as stale because it has not had recent activity. The resources of the VCLab team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the last release of PyMeshLab, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

stale[bot] avatar Apr 26 '25 02:04 stale[bot]