安装tiny-cuda-nn时报错RuntimeError: Could not locate a supported Microsoft Visual C++ installation

问题描述

按照官方教程安装nerf studio,运行命令pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch安装tiny-cuda-nn时,出现以下报错:

× python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Lenovo\AppData\Local\Temp\pip-req-build-lz_n7l05\bindings/torch\setup.py", line 53, in <module>
          raise RuntimeError("Could not locate a supported Microsoft Visual C++ installation")
      RuntimeError: Could not locate a supported Microsoft Visual C++ installation
      Building PyTorch extension for tiny-cuda-nn version 1.7
      Obtained compute capability 86 from PyTorch
      [end of output]

根据报错,出现问题的原因是找不到Visual C++编译器的位置。

解决方法

参考链接:https://github.com/NVlabs/nvdiffrec/issues/35

Step1: 安装VS2019(已安装可跳过)

下载Visual Studio Installer

Visual Studio2019下载链接:https://visualstudio.microsoft.com/zh-hans/vs/older-downloads/

本人选择的是免费的Community版本:
在这里插入图片描述
勾选使用C++的桌面开发:
在这里插入图片描述

注意:如果安装的VS不是2017-2019版本,会出现以下报错:
#error: -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2019 are supported!

Step2: 添加环境变量

右键此电脑->属性->高级系统设置->高级->环境变量
在这里插入图片描述
在系统变量Path中添加:G:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64 (按照自己的VS安装路径,我的安装路径是G:\Program Files (x86)\Microsoft Visual Studio)
在这里插入图片描述
在这里插入图片描述

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值