在vast.ai的Ubuntu18.04环境安装nerfstudio时tinycudann报错求助
在vast.ai Ubuntu 18.04环境安装nerfstudio时tinycudann安装失败
环境说明
- 运行环境:vast.ai提供的Ubuntu 18.04系统
- 已完成:Conda、PyTorch安装验证正常
- 安装依据:nerfstudio官方安装流程
报错详情
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-s8v5l299 Running command git clone --filter=blob:none --quiet https://github.com/NVlabs/tiny-cuda-nn/ /tmp/pip-req-build-s8v5l299 Resolved https://github.com/NVlabs/tiny-cuda-nn/ to commit a77dc53ed770dd8ea6f78951d5febe175d0045e9 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] /root/miniconda3/envs/nerfstudio/lib/python3.8/site-packages/torch/cuda/__init__.py:88: 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 "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "/tmp/pip-req-build-s8v5l299/bindings/torch/setup.py", line 49, in <module> 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.
解决方法
1. 确认GPU计算能力
执行命令查看当前实例的GPU型号:
nvidia-smi
根据GPU型号查询对应的CUDA计算能力(例如RTX 3090对应86,A100对应80,V100对应70)。
2. 设置环境变量指定计算架构
在安装前设置TCNN_CUDA_ARCHITECTURES环境变量,示例(以A100为例):
export TCNN_CUDA_ARCHITECTURES=80
若需兼容多个架构,用分号分隔:
export TCNN_CUDA_ARCHITECTURES=70;80;86
3. 重新安装tiny-cuda-nn
执行安装命令:
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
4. 修复CUDA驱动兼容问题(可选)
若仍出现驱动不兼容警告,需匹配CUDA与NVIDIA驱动版本:
- 查看当前CUDA版本:
nvcc --version - 安装对应版本的NVIDIA驱动(例如CUDA 11.7要求驱动版本≥450.80.02)
内容的提问来源于stack exchange,提问作者piorkoo
相关产品推荐
相关产品推荐

