Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vedo and torch.multiprocessing #1149

Open
kirilllzaitsev opened this issue Jun 30, 2024 · 1 comment
Open

Vedo and torch.multiprocessing #1149

kirilllzaitsev opened this issue Jun 30, 2024 · 1 comment

Comments

@kirilllzaitsev
Copy link

kirilllzaitsev commented Jun 30, 2024

Hi, using DDP in torch leads to the following error when calling plotter.show:

Traceback (most recent call last):
  File "/home/user/train.py", line 627, in <module>
    mp.spawn(
  File "/home/user/venv/lib/python3.10/site-packages/torch/multiprocessing/spawn.py", line 239, in spawn
    return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
  File "/home/user/venv/lib/python3.10/site-packages/torch/multiprocessing/spawn.py", line 197, in start_processes
    while not context.join():
  File "/home/user/venv/lib/python3.10/site-packages/torch/multiprocessing/spawn.py", line 140, in join
    raise ProcessExitedException(
torch.multiprocessing.spawn.ProcessExitedException: process 0 terminated with signal SIGSEGV
/usr/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 2 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

Here is a sample code:

plotter = vedo.Plotter(
        N=1,
        offscreen=False,
    )
pointcloud = vedo.Points(pts.detach().cpu().numpy())
plotter.show(
            pointcloud,
            legends[idx]
)

My vedo version is vedo==2023.4.6.

The plotter is visible only on the main process and the data in use has been cloned/detached to prevent any shared access. I'm wondering if that's a known problem between vedo and torch.multiprocessing?

@marcomusy
Copy link
Owner

To be honest I have no experience with torch.multiprocessing, I can only suggest to upgrade vedo to the latest version, but i' m not sure that that can cure the problem.
If i'm not mistaken the upstream VTK needs to start the interctive window in the main thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants