daniilidis-group / neural_renderer

A PyTorch port of the Neural 3D Mesh Renderer
Other
1.12k stars 248 forks source link

Support for macOS Apple chip #140

Open dabasjayant opened 1 year ago

dabasjayant commented 1 year ago

System: MacOS 12.5, Apple M2 Python ver.: Python 3.9.6 (default installation)

Unable to install for macOS due to lack of CUDA support. Can we add the option to choose if the user wants to enable the GPU or not?

$ pip3 install neural_renderer_pytorch
Defaulting to user installation because normal site-packages is not writeable
Collecting neural_renderer_pytorch
  Using cached neural_renderer_pytorch-1.1.3.tar.gz (19 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/yp/rj8hsnnn67d2j8bk8wkycv1jtv2523/T/pip-install-txvkp6qq/neural-renderer-pytorch_8ad7d5bf6a9349cd869edf1fb320505a/setup.py", line 15, in <module>
          CUDAExtension('neural_renderer.cuda.load_textures', [
        File "/Users/jayant.dabas/Library/Python/3.9/lib/python/site-packages/torch/utils/cpp_extension.py", line 1047, in CUDAExtension
          library_dirs += library_paths(cuda=True)
        File "/Users/jayant.dabas/Library/Python/3.9/lib/python/site-packages/torch/utils/cpp_extension.py", line 1179, in library_paths
          if (not os.path.exists(_join_cuda_home(lib_dir)) and
        File "/Users/jayant.dabas/Library/Python/3.9/lib/python/site-packages/torch/utils/cpp_extension.py", line 2230, in _join_cuda_home
          raise EnvironmentError('CUDA_HOME environment variable is not set. '
      OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.
koushikam commented 1 year ago

Were you able to resole this issue?