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

in subprocess can't use cuda #7082

Open
3 tasks done
nuclear-missile opened this issue Nov 30, 2024 · 0 comments
Open
3 tasks done

in subprocess can't use cuda #7082

nuclear-missile opened this issue Nov 30, 2024 · 0 comments
Labels
bug Not a build issue, this is likely a bug.

Comments

@nuclear-missile
Copy link

Checklist

Describe the issue

when I import open3d, subprocess can't use cuda
while without import open3d, it runs

Steps to reproduce the bug

import torch
from torch.multiprocessing import Process
import open3d # without this, cuda both available in main process and subprocess

class MyProcess(Process):
    def __init__(self):
        super(MyProcess, self).__init__()

    def run(self):
        print('subprocess:', torch.cuda.is_available())


if __name__ == '__main__':
    p = MyProcess()
    p.start()
    print('mainprocess:', torch.cuda.is_available())

Error message

mainprocess: True
/root/miniconda3/envs/dp3/lib/python3.8/site-packages/torch/cuda/init.py:128: UserWarning: CUDA initialization: CUDA driver initialization failed, you might not have a CUDA gpu. (Triggered internally at /opt/conda/conda-bld/pytorch_1724789115405/work/c10/cuda/CUDAFunctions.cpp:108.)
return torch._C._cuda_getDeviceCount() > 0
subprocess: False

Expected behavior

mainprocess: True
subprocess: True

Open3D, Python and System information

- Operating system: Ubuntu 20.04
- Python version: Python 3.8.20
- Open3D version: output from python: 0.18.0
- System architecture: x86
- Is this a remote workstation?: yes
- How did you install Open3D?: both tried on conda & build from source
- Compiler version (if built from source): gcc 9.4.0

Additional information

pytorch: 2.4.1
NVIDIA-SMI 550.107.02
Driver Version: 550.107.02
CUDA Version: 12.4

@nuclear-missile nuclear-missile added the bug Not a build issue, this is likely a bug. label Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not a build issue, this is likely a bug.
Projects
None yet
Development

No branches or pull requests

1 participant