安装tiny-cuda-nn的Torch绑定报错:subprocess-exited-with-error
tiny-cuda-nn Torch绑定安装失败解决办法
问题背景
安装NeRFstudio过程中,执行以下命令安装tiny-cuda-nn的Torch绑定:
pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
出现报错,核心错误为:
RuntimeError: Could not locate a supported Microsoft Visual C++ installation
已尝试执行python -m pip install --upgrade pip升级pip,提示依赖已满足,但问题未解决。
解决步骤
安装Visual C++ Build Tools
tiny-cuda-nn编译需要C++编译环境,直接安装微软的Visual Studio Build Tools:- 前往微软官网搜索并下载「Visual Studio Build Tools」安装包
- 运行安装程序,勾选「桌面开发使用C++」组件(默认包含MSVC编译器、Windows SDK等必需组件)
- 完成安装后重启电脑,重新执行tiny-cuda-nn的安装命令
验证编译环境
打开命令提示符,输入cl,若输出MSVC编译器版本信息,说明环境配置成功版本匹配检查
确保PyTorch与CUDA版本兼容,tiny-cuda-nn推荐搭配PyTorch 2.x + CUDA 11.7/11.8使用
内容的提问来源于stack exchange,提问作者Kirk Ding
相关产品推荐
相关产品推荐

