NVlabs / tiny-cuda-nn

Lightning fast C++/CUDA neural network framework
Other
3.78k stars 461 forks source link

tiny cuda install error #214

Open amorell1234 opened 2 years ago

amorell1234 commented 2 years ago

(nerfstudio) C:\Users\17069\Desktop\NS>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 c:\users\17069\appdata\local\temp\pip-req-build-lwxzpvk6 Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn/ 'C:\Users\17069\AppData\Local\Temp\pip-req-build-lwxzpvk6' Resolved https://github.com/NVlabs/tiny-cuda-nn/ to commit 8e6e242f36dd197134c9b9275a8e5108a8e3af78 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 ╰─> [6 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "C:\Users\17069\AppData\Local\Temp\pip-req-build-lwxzpvk6\bindings/torch\setup.py", line 3, in import torch ModuleNotFoundError: No module named 'torch' [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.

What is causing this?

mints7 commented 2 years ago

try to install pytorch

newforests commented 1 year ago

try to install pytorch

Could you tell me how to solve this problem?

grofattila commented 1 year ago

try to install pytorch

Could you tell me how to solve this problem?

pip install torch

jaggzh commented 1 year ago

I'm getting the same error. Torch is installed -- I'm in a venv and, when running python, "import torch" works fine. Note that the installation is run from nerfstudio installation instructions: pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch Which I also modified, for bash to not ignore the # comment, to: pip install 'git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch'

I've yet to solve it.

[Edit] Upon further consideration, that exec() leads me to believe the current environment might not be making it through to the exec'ed subprocess -- it's losing the venv and using the system-wide python/python modules. Not solved yet.

hashFactory commented 1 year ago

I just encountered the same issue. I used to be able to go like this:

export PYTHONPATH="/tmp/tri/pip/"
export PIP="--target '/tmp/tri/pip/' --cache-dir '/tmp/tri/cache/'"

python3 -m pip install $PIP --upgrade pip setuptools ninja torch==1.12.1+cu113 torchvision==0.13.1+cu113 functorch==0.2.1 torchmetrics -f https://download.pytorch.org/whl/torch_stable.html
python3 -m pip install $PIP --upgrade 'git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch'
...

But this broke for me today giving me the same No module named 'torch' error. Not sure what the problem is but I managed to get it working again using pyenv.

# install pyenv to alternative location
export PYENV_ROOT="/tmp/tri/pyenv"                                                                                                                                                  
curl https://pyenv.run | bash                                                                                                                                                       
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"                                                                                                                  
eval "$(pyenv init -)"

# setup new env
pyenv install 3.9.16
pyenv virtualenv 3.9.16 venv_nerf
pyenv activate venv_nerf

pip install --upgrade pip setuptools ninja torch==1.12.1+cu113 torchvision==0.13.1+cu113 functorch==0.2.1 torchmetrics -f https://download.pytorch.org/whl/torch_stable.html
pip install --upgrade 'git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch'
...
gautam-sh commented 1 year ago

I was also getting the same error. Even after setting up the correct Python path in the virtual env, it was not able to find Torch. So instead of getting the Pytorch extension, I installed it from a local clone as mentioned in the readme file.

hashFactory commented 1 year ago

I was also getting the same error. Even after setting up the correct Python path in the virtual env, it was not able to find Torch.

You're right, I just tried it again and ran into the same issues following my instructions. I was able to fix it again by omitting the pip upgrade to 23.1.2. Everything seems to work as expected with pip 23.0.1.

valer-cara commented 10 months ago

pip 23.0.1 here, getting the same error. Tried python 3.9, 3.10 and 3.11 so far.

jloveric commented 3 months ago

Seeing this problem with pip 24 and 24.2 on ubuntu 22.04 which uses python3.10 and resolved changing pip to 23.0.1. Did see this error along the way DEPRECATION: tinycudann is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 so it seems the installation needs to be updated.