waityousea / xuniren

MIT License
551 stars 159 forks source link

MAC M1 无法安装 bash scripts/install_ext.sh #6

Open qraccess opened 1 year ago

qraccess commented 1 year ago

安装时出现如下错误

bash scripts/install_ext.sh
Processing ./freqencoder
  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 "/Volumes/KINGSTON/projects/xuniren/freqencoder/setup.py", line 36, in <module>
          CUDAExtension(
        File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1048, in CUDAExtension
          library_dirs += library_paths(cuda=True)
        File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1179, in library_paths
          if (not os.path.exists(_join_cuda_home(lib_dir)) and
        File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2223, 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.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip is available: 23.0.1 -> 23.1.2
[notice] To update, run: pip install --upgrade pip
Processing ./shencoder
  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 "/Volumes/KINGSTON/projects/xuniren/shencoder/setup.py", line 35, in <module>
          CUDAExtension(
        File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1048, in CUDAExtension
          library_dirs += library_paths(cuda=True)
        File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1179, in library_paths
          if (not os.path.exists(_join_cuda_home(lib_dir)) and
        File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2223, 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.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip is available: 23.0.1 -> 23.1.2
[notice] To update, run: pip install --upgrade pip
Processing ./gridencoder
  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 "/Volumes/KINGSTON/projects/xuniren/gridencoder/setup.py", line 35, in <module>
          CUDAExtension(
        File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1048, in CUDAExtension
          library_dirs += library_paths(cuda=True)
        File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1179, in library_paths
          if (not os.path.exists(_join_cuda_home(lib_dir)) and
        File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2223, 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.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

跳过这步之后,启动服务 python app.py, 也出现如下错误

python app.py
Traceback (most recent call last):
  File "/Volumes/KINGSTON/projects/xuniren/raymarching/raymarching.py", line 10, in <module>
    import _raymarching_face as _backend
ModuleNotFoundError: No module named '_raymarching_face'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Volumes/KINGSTON/projects/xuniren/app.py", line 10, in <module>
    from tools import audio_pre_process, video_pre_process, generate_video,audio_process
  File "/Volumes/KINGSTON/projects/xuniren/tools.py", line 20, in <module>
    from nerf.network import NeRFNetwork
  File "/Volumes/KINGSTON/projects/xuniren/nerf/network.py", line 7, in <module>
    from .renderer import NeRFRenderer
  File "/Volumes/KINGSTON/projects/xuniren/nerf/renderer.py", line 10, in <module>
    import raymarching
  File "/Volumes/KINGSTON/projects/xuniren/raymarching/__init__.py", line 1, in <module>
    from .raymarching import *
  File "/Volumes/KINGSTON/projects/xuniren/raymarching/raymarching.py", line 12, in <module>
    from .backend import _backend
  File "/Volumes/KINGSTON/projects/xuniren/raymarching/backend.py", line 31, in <module>
    _backend = load(name='_raymarching_face',
  File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1284, in load
    return _jit_compile(
  File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1509, in _jit_compile
    _write_ninja_file_and_build_library(
  File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1601, in _write_ninja_file_and_build_library
    extra_ldflags = _prepare_ldflags(
  File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1699, in _prepare_ldflags
    extra_ldflags.append(f'-L{_join_cuda_home("lib64")}')
  File "/Volumes/KINGSTON/projects/xuniren/venv/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2223, 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.
qraccess commented 1 year ago

必须在C U D A环境下才能启动吗?

waityousea commented 1 year ago

必须在C U D A环境下才能启动吗?

是的,必须在有cuda的环境中进行配置

waityousea commented 1 year ago

显然,你这个mac没有配置cuda

An88888 commented 2 months ago

请问m1 如何跑起来