RTK3090使用cuda11.0报错:nvcc fatal : Unsupported gpu architecture ‘compute_86‘或者RuntimeError: CUDA error: no kernel image is available for execution on the device
问题描述
使用libtorch1.7+cuda11.0跑openpcdet,遇到报错:
nvcc fatal : Unsupported gpu architecture ‘compute_86‘
或者
RuntimeError: CUDA error: no kernel image is available for execution on the device
原因分析:
RTX3090算力太高,和cuda11.0不匹配,TORCH_CUDA_ARCH_LIST为8.6,应该设置为8.0(不是7.5)
参考链接(正确答案在评论区):
解决方案:
在终端设置环境变量:
export TORCH_CUDA_ARCH_LIST="8.0"
设置完成后再对openpcdet(或者其他项目)进行编译,安装和推理的时候都不会报错了,如果设置成7.5,可能安装编译成功,但是在训练模型的时候报这个错:
RuntimeError: CUDA error: no kernel image is available for execution on the device
需要进行以下操作:
unset TORCH_CUDA_ARCH_LIST
export TORCH_CUDA_ARCH_LIST="8.0"
然后对项目进行编译,再训练就不会报错了