背景
在安装wonder3d的时候要安装tinycudnn,
- 命令如下:
pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
- 报错如下:
error: #error C++17 or later compatible compiler is required to use PyTorch.
解决方法:
参考本文:https://github.com/open-mmlab/mmdeploy/issues/2529,
核心是把setup.py 里面的
extra_compile_args={“cxx”: ????} 这个???改成[‘-std=c++14’]:
extra_compile_args['cxx'] = ['-std=c++14']
if parse_version(torch.__version__) >= parse_version('2.0.0'):extra_compile_args['cxx'] = ['-std=c++17']
所以步骤如下:
- git clone --recursive https://github.com/NVlabs/tiny-cuda-nn
- 进去修改setup.py,
extra_compile_args['cxx'] = ['-std=c++17']
- 我这里是把
extra_compile_args={"cxx": cflags, "nvcc": nvcc_flags},
修改为extra_compile_args={"cxx": ["-std=c++17"], "nvcc": nvcc_flags},
- 注意,外面的[]不要漏了
- 然后在本地安装:pip install tiny-cuda-nn/bindings/torch