NVlabs/tiny-cuda-nn

Installation Error: subprocess-exited-with-error

NickHaecker opened this issue · 3 comments

When i try to install the repo with pip, i get this error:

`(im4d) im4d@im4d-virtual-machine:~/im4d$ pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
Collecting git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
Cloning https://github.com/NVlabs/tiny-cuda-nn/ to /tmp/pip-req-build-m5dxyoqz
Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn/ /tmp/pip-req-build-m5dxyoqz
Resolved https://github.com/NVlabs/tiny-cuda-nn/ to commit 2121041
Running command git submodule update --init --recursive -q
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
/tmp/pip-req-build-m5dxyoqz/bindings/torch/setup.py:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import parse_version
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/tmp/pip-req-build-m5dxyoqz/bindings/torch/setup.py", line 51, in
raise EnvironmentError("Unknown compute capability. Specify the target compute capabilities in the TCNN_CUDA_ARCHITECTURES environment variable or install PyTorch with the CUDA backend to detect it automatically.")
OSError: Unknown compute capability. Specify the target compute capabilities in the TCNN_CUDA_ARCHITECTURES environment variable or install PyTorch with the CUDA backend to detect it automatically.
Building PyTorch extension for tiny-cuda-nn version 1.7
[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.
`

answer is in the logs :

raise EnvironmentError("Unknown compute capability. Specify the target compute capabilities in the TCNN_CUDA_ARCHITECTURES environment variable or install PyTorch with the CUDA backend to detect it automatically.")

you need to set the variable TCNN_CUDA_ARCHITECTURES in your terminal (or bashrc file) as follows :

export TCNN_CUDA_ARCHITECTURES=70,72,75,80,86 (or define a single number is from the command uname -a to find the architecture )

this doen't worked as it gives
(nerfstudio) C:\Users\Hp>pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
Collecting git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
Cloning https://github.com/NVlabs/tiny-cuda-nn/ to c:\users\hp\appdata\local\temp\pip-req-build-w51cr_uu
Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn/ 'C:\Users\Hp\AppData\Local\Temp\pip-req-build-w51cr_uu'
Resolved https://github.com/NVlabs/tiny-cuda-nn/ to commit b3473c8
Running command git submodule update --init --recursive -q
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [11 lines of output]
C:\Users\Hp\AppData\Local\Temp\pip-req-build-w51cr_uu\bindings/torch\setup.py:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import parse_version
No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8'
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\Hp\AppData\Local\Temp\pip-req-build-w51cr_uu\bindings/torch\setup.py", line 72, in
raise RuntimeError("Could not locate a supported Microsoft Visual C++ installation")
RuntimeError: Could not locate a supported Microsoft Visual C++ installation
Building PyTorch extension for tiny-cuda-nn version 1.7
Obtained compute capabilities [70, 72, 75, 80, 86] from environment variable TCNN_CUDA_ARCHITECTURES
[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.

this doen't worked as it gives (nerfstudio) C:\Users\Hp>pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch Collecting git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch Cloning https://github.com/NVlabs/tiny-cuda-nn/ to c:\users\hp\appdata\local\temp\pip-req-build-w51cr_uu Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn/ 'C:\Users\Hp\AppData\Local\Temp\pip-req-build-w51cr_uu' Resolved https://github.com/NVlabs/tiny-cuda-nn/ to commit b3473c8 Running command git submodule update --init --recursive -q Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [11 lines of output] C:\Users\Hp\AppData\Local\Temp\pip-req-build-w51cr_uu\bindings/torch\setup.py:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html from pkg_resources import parse_version No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8' Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\Hp\AppData\Local\Temp\pip-req-build-w51cr_uu\bindings/torch\setup.py", line 72, in raise RuntimeError("Could not locate a supported Microsoft Visual C++ installation") RuntimeError: Could not locate a supported Microsoft Visual C++ installation Building PyTorch extension for tiny-cuda-nn version 1.7 Obtained compute capabilities [70, 72, 75, 80, 86] from environment variable TCNN_CUDA_ARCHITECTURES [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.

As you can see the logs ,

raise RuntimeError("Could not locate a supported Microsoft Visual C++ installation")
RuntimeError: Could not locate a supported Microsoft Visual C++ installation

the error is caused due to the fact that build is not able to detect the c++ version installed in windows . and that it resolves the error as asked by the author of this issue . so kindly check the installation of the cpp