nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

tinny-cuda wont install. CUDA not found

Open Sinicyn78 opened this issue 1 year ago • 8 comments

(nerfstudio) root@home:/home/sinicyn/Downloads# 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-b8w1_isc Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn/ /tmp/pip-req-build-b8w1_isc Resolved https://github.com/NVlabs/tiny-cuda-nn/ to commit 14053e9a87ebf449d32bda335c0363dd4f5667a4 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 ╰─> [10 lines of output] /root/anaconda3/envs/nerfstudio/lib/python3.8/site-packages/torch/cuda/init.py:83: UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 803: system has unsupported display driver / cuda driver combination (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:109.) return torch._C._cuda_getDeviceCount() > 0 Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-req-build-b8w1_isc/bindings/torch/setup.py", line 30, 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. No CUDA runtime is found, using CUDA_HOME='/usr' 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.

Sinicyn78 avatar Jan 05 '23 12:01 Sinicyn78

Where did you install CUDA_HOME and CUDA_PATH?

THE-COB avatar Jan 06 '23 00:01 THE-COB

I'm trying to install in windows via conda Installed CUDA 11.3 now these errors

image

Sinicyn78 avatar Jan 06 '23 14:01 Sinicyn78

I'm trying to install in windows via conda Installed CUDA 11.3 now these errors

image

Can I see a screenshot of your system and user environment variables

THE-COB avatar Jan 06 '23 19:01 THE-COB

I'm trying to install in windows via conda Installed CUDA 11.3 now these errors image

Can I see a screenshot of your system and user environment variables

image image image image

Sinicyn78 avatar Jan 07 '23 18:01 Sinicyn78

Try making a CUDA_HOME env variable with the same value as CUDA_PATH in both system and user variables (this way you can do it on both admin and user accounts)

THE-COB avatar Jan 08 '23 02:01 THE-COB

Try making a CUDA_HOME env variable with the same value as CUDA_PATH in both system and user variables (this way you can do it on both admin and user accounts)

now these errors: image image image

Sinicyn78 avatar Jan 08 '23 10:01 Sinicyn78

Try installing ninja like in this issue https://github.com/NVlabs/tiny-cuda-nn/issues/169#issuecomment-1291990467

THE-COB avatar Jan 18 '23 00:01 THE-COB

I also ran into this problem and tried many solutions. I found the solution here #1177 and installed tiny-cuda-nn thanks to this comment.

To document what I have done to get nerfstudio via conda to work properly:

  1. Installed CUDA 11.7 and VS 2019 and deinstalled all other versions

  2. Created a conda envoriment conda create --name nerfstudio -y python=3.8 conda activate nerfstudio python -m pip install --upgrade pip

  3. Installed pytorch pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html

  4. Git cloned tiny-cuda-nn via the repo into miniconda3\envs\nerfstudio\Lib\site-packages git clone --recursive https://github.com/nvlabs/tiny-cuda-nn cd tiny-cuda-nn cmake . -B build cmake --build build --config RelWithDebInfo -j (cmake commands run in VS developer command prompt)

  5. Installed nerfstudio pip install nerfstudio

  6. Reinstalled tiny-cuda-nn via pip pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

How tiny-cuda-nn was installed may not makes sense, but that's what worked in the end. Nerfstudio is now fully functional.

dooonnis avatar Feb 06 '23 00:02 dooonnis

Closing, feel free to reopen if it is still and issue.

tancik avatar Feb 22 '23 18:02 tancik

This one worked for me but I had to install CUDA 12.1.1 before runing cmake . -B build

Xerthor avatar Apr 21 '23 21:04 Xerthor