ashawkey / torch-ngp

A pytorch CUDA extension implementation of instant-ngp (sdf and nerf), with a GUI.
MIT License
2.11k stars 275 forks source link

issues when build extensions #167

Closed city19992 closed 1 year ago

city19992 commented 1 year ago

Hi @ashawkey, nice job! I really want to try your repository, while I met some errors when building extensions.

I met error when running bash scripts/install_ext.sh. Here is the output:

csh@tjhrtx-SYS-4029GP-TRT2:/data/csh/nerf-codes/torch-ngp$ bash scripts/install_ext.sh

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./raymarching
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: raymarching
  Building wheel for raymarching (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.3'
      running bdist_wheel
      running build
      running build_ext
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/data/csh/nerf-codes/torch-ngp/raymarching/setup.py", line 44, in <module>
          setup(
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
          self.build_extensions()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 436, in build_extensions
          self._check_cuda_version(compiler_name, compiler_version)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 813, in _check_cuda_version
          torch_cuda_version = packaging.version.parse(torch.version.cuda)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 49, in parse
          return Version(version)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 264, in __init__
          match = self._regex.search(version)
      TypeError: expected string or bytes-like object
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for raymarching
  Running setup.py clean for raymarching
Failed to build raymarching
ERROR: Could not build wheels for raymarching, which is required to install pyproject.toml-based projects
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./gridencoder
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: gridencoder
  Building wheel for gridencoder (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.3'
      running bdist_wheel
      running build
      running build_ext
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/data/csh/nerf-codes/torch-ngp/gridencoder/setup.py", line 32, in <module>
          setup(
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
          self.build_extensions()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 436, in build_extensions
          self._check_cuda_version(compiler_name, compiler_version)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 813, in _check_cuda_version
          torch_cuda_version = packaging.version.parse(torch.version.cuda)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 49, in parse
          return Version(version)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 264, in __init__
          match = self._regex.search(version)
      TypeError: expected string or bytes-like object
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for gridencoder
  Running setup.py clean for gridencoder
Failed to build gridencoder
ERROR: Could not build wheels for gridencoder, which is required to install pyproject.toml-based projects
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./shencoder
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: shencoder
  Building wheel for shencoder (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.3'
      running bdist_wheel
      running build
      running build_ext
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/data/csh/nerf-codes/torch-ngp/shencoder/setup.py", line 32, in <module>
          setup(
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
          self.build_extensions()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 436, in build_extensions
          self._check_cuda_version(compiler_name, compiler_version)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 813, in _check_cuda_version
          torch_cuda_version = packaging.version.parse(torch.version.cuda)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 49, in parse
          return Version(version)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 264, in __init__
          match = self._regex.search(version)
      TypeError: expected string or bytes-like object
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for shencoder
  Running setup.py clean for shencoder
Failed to build shencoder
ERROR: Could not build wheels for shencoder, which is required to install pyproject.toml-based projects
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./freqencoder
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: freqencoder
  Building wheel for freqencoder (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.3'
      running bdist_wheel
      running build
      running build_ext
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/data/csh/nerf-codes/torch-ngp/freqencoder/setup.py", line 33, in <module>
          setup(
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
          self.build_extensions()
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 436, in build_extensions
          self._check_cuda_version(compiler_name, compiler_version)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 813, in _check_cuda_version
          torch_cuda_version = packaging.version.parse(torch.version.cuda)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 49, in parse
          return Version(version)
        File "/data/csh/anaconda3/envs/torch-ngp/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 264, in __init__
          match = self._regex.search(version)
      TypeError: expected string or bytes-like object
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for freqencoder
  Running setup.py clean for freqencoder
Failed to build freqencoder
ERROR: Could not build wheels for freqencoder, which is required to install pyproject.toml-based projects

The detail of the device are shown as follows:

(torch-ngp) csh@tjhrtx-SYS-4029GP-TRT2:/data/csh/nerf-codes/torch-ngp$ python -c "import torch; print(torch.__version__)"
1.12.1
(torch-ngp) csh@tjhrtx-SYS-4029GP-TRT2:/data/csh/nerf-codes/torch-ngp$ nvcc -V 
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Mar_21_19:15:46_PDT_2021
Cuda compilation tools, release 11.3, V11.3.58
Build cuda_11.3.r11.3/compiler.29745058_0
(torch-ngp) csh@tjhrtx-SYS-4029GP-TRT2:/data/csh/nerf-codes/torch-ngp$ lsb_release -a  
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:        18.04
Codename:       bionic
city19992 commented 1 year ago

I solved the problem by reinstalling Pytorch with pip, which should be linked to Cuda.

jamesyoung0623 commented 1 year ago

I have the same problem. What's your torch and CUDA version?

city19992 commented 1 year ago

The version of cuda is 11.3, and the version of pytorch is 1.12.1

I recommend you search for a suitable version of cuda and pytorch on https://pytorch.org/get-started/previous-versions/ and install it by pip. Then you need to check whether the cuda can be used in pytorch.

reply to Chin-Chia (James) Yang @.***> :

I have the same problem. What's your torch and CUDA version?

— Reply to this email directly, view it on GitHub https://github.com/ashawkey/torch-ngp/issues/167#issuecomment-1579995682, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMYQWHBU3O5FDXKAEMC2WTDXKAPCBANCNFSM6AAAAAAX7G5GUE . You are receiving this because you modified the open/close state.Message ID: @.***>

xdobetter commented 1 year ago

I have same promblem, Have you solved the problem? My enviroment is windows10,cuda 11.3 I try pytorch 1.12.1 and 1.11.0,but still the same problem.

I have the same problem. What's your torch and CUDA version?

XiaoYuanJun-zy commented 1 year ago

Sorry,i didn't solve this problem

---- Replied Message ---- | From | @.> | | Date | 11/19/2023 21:00 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [ashawkey/torch-ngp] issues when build extensions (Issue #167) |

I have same promblem, Have you solved the problem? My enviroment is windows10,cuda 11.3 I try pytorch 1.12.1 and 1.11.0,but still the same problem.

I have the same problem. What's your torch and CUDA version?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>