环境:
虚拟机:Ubuntu 18.04.5 LTS (GNU/Linux 5.4.0-108-generic x86_64)
python:3.8.10
pytorch:1.7.1+cu110
cuda:11.0.221
问题:
/usr/local/cuda/bin/nvcc -I/tmp/pip-req-build-ui3v4u82/svox2/csrc/include -I/tmp/pip-req-build-ui3v4u82/usr/local/miniconda3/pkgs/nvidiacub-1.10.0-i0 -I/usr/local/lib/python3.8/dist-packages/torch/include -I/usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.8/dist-packages/torch/include/TH -I/usr/local/lib/python3.8/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.8 -c svox2/csrc/svox2_kernel.cu -o build/temp.linux-x86_64-3.8/svox2/csrc/svox2_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=csrc -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 -std=c++14
nvcc fatal : Unsupported gpu architecture 'compute_86'
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1
解决方案:
原因:应该是硬件能够支持的算力比较高,能达到8.6,但是cuda支持不了这么高的算力,降低算力要求即可
设置环境变量:
export TORCH_CUDA_ARCH_LIST="7.5"