cabooster/DeepCAD-RT

macOS M1

Closed this issue · 2 comments

Hello,
Thank you for this amazing denoising method.
I was wondering if have you tried to make this pipeline compatible with the built-in graphics processor of Apple Metal M1 chip.

Hi, zyazdani-92. We are very happy if this tool can help you.
In our lab, all devices for data processing are Windows and Ubuntu. We have never tried it on MacOS. But it's possible to install PyTorch on Apple M1 chip with GPU as shown in this blog: Installing PyTorch on Apple M1 chip with GPU Acceleration

Is there any chance to get this framework running without a CUDA GPU? I tried the training notebook on an Apple M2:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
Cell In[6], line 1
----> 1 tc.run()

File [/opt/miniconda/envs/env/lib/python3.9/site-packages/deepcad/train_collection.py:85](http://localhost:8888/opt/miniconda/envs/env/lib/python3.9/site-packages/deepcad/train_collection.py#line=84), in training_class.run(self)
     83 self.distribute_GPU()
     84 # start training and result visualization during training period (optional)
---> 85 self.train()

File [/opt/miniconda/envs/env/lib/python3.9/site-packages/deepcad/train_collection.py:287](http://localhost:8888/opt/miniconda/envs/env/lib/python3.9/site-packages/deepcad/train_collection.py#line=286), in training_class.train(self)
    284 trainloader = DataLoader(train_data, batch_size=self.batch_size, shuffle=True, num_workers=self.num_workers)
    285 for iteration, (input, target) in enumerate(trainloader):
    286     # The input volume and corresponding target volume from data loader to train the deep neural network
--> 287     input = input.cuda()
    288     target = target.cuda()
    289     real_A = input

File [/opt/miniconda/envs/env/lib/python3.9/site-packages/torch/cuda/__init__.py:293](http://localhost:8888/opt/miniconda/envs/env/lib/python3.9/site-packages/torch/cuda/__init__.py#line=292), in _lazy_init()
    288     raise RuntimeError(
    289         "Cannot re-initialize CUDA in forked subprocess. To use CUDA with "
    290         "multiprocessing, you must use the 'spawn' start method"
    291     )
    292 if not hasattr(torch._C, "_cuda_getDeviceCount"):
--> 293     raise AssertionError("Torch not compiled with CUDA enabled")
    294 if _cudart is None:
    295     raise AssertionError(
    296         "libcudart functions unavailable. It looks like you have a broken build?"
    297     )

AssertionError: Torch not compiled with CUDA enabled