tiny-cuda-nn icon indicating copy to clipboard operation
tiny-cuda-nn copied to clipboard

tiny cuda install error

Open amorell1234 opened this issue 1 year ago • 9 comments

(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?

amorell1234 avatar Dec 02 '22 19:12 amorell1234

try to install pytorch

mints7 avatar Dec 03 '22 09:12 mints7

try to install pytorch

Could you tell me how to solve this problem?

newforests avatar Dec 15 '22 11:12 newforests

try to install pytorch

Could you tell me how to solve this problem?

pip install torch

grofattila avatar Feb 06 '23 20:02 grofattila

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.

jaggzh avatar Apr 17 '23 21:04 jaggzh

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'
...

hashFactory avatar Apr 19 '23 16:04 hashFactory

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.

gautam-sh avatar May 04 '23 06:05 gautam-sh

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.

hashFactory avatar May 10 '23 14:05 hashFactory

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

valer-cara avatar Feb 06 '24 20:02 valer-cara

I encountered the same error. I uninstalled all the packages I had installed with pip and then reinstalled tiny-cuda-nn following the Nerf Studio guide.

DinisMartinho avatar Feb 08 '24 15:02 DinisMartinho