报错解决之GeForce RTX *** with CUDA capability sm_86 is not compatible with the current PyTorch...

Index 目录索引

  • 报错信息
  • 问题分析
  • 解决方法
  • 参考

报错信息

深度学习神经网络模型训练的时候,可能会报出如下错误:

GeForce RTX *** with CUDA capability sm_86 is not compatible with the current PyTorch installation. 
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.

问题分析

报错信息中的CUDA capability sm_86意思是算力8.6,即该RTX型号的显卡算力是8.6,但是当前的PyTorch依赖的CUDA版本支持的算力只有3.75.06.06.17.07.5

经查阅资料1,得到下述说明:

A CUDA application binary (with one or more GPU kernels) can contain the compiled GPU code in two forms, binary cubin objects and forward-compatible PTX assembly for each kernel. 
Both cubin and PTX are generated for a certain target compute capability. 
A cubin generated for a certain compute capability is supported to run on any GPU with the same major revision and same or higher minor revision of compute capability. 
For example, a cubin generated for compute capability 7.0 is supported to run on a GPU with compute capability 7.5, however a cubin generated for compute capability 7.5 is not supported to run on a GPU with compute capability 7.0, and a cubin generated with compute capability 7.x is not supported to run on a GPU with compute capability 8.x.

由此可知,显卡的算力要低于或等于所支持最高算力的CUDA版本号,例如算力7.0 的显卡可以在支持最高算力7.5 的CUDA 版本下运行,但是算力8.x 的显卡不可以在支持最高算力7.x 的CUDA 版本下运行2

解决方法

既然知道了报错的原因是PyTorch所对应的CUDA版本的问题,所以解决报错的方法很简单,只需更改CUDA 的版本,将其与PyTorch 适配即可,具体可以到PyTorch 官网下载界面下载对应的库文件进行安装,安装方法可以参考之前的这篇文章,离线安装 is recommended


如果我的这篇文章帮助到了你,那我也会感到很高兴,一个人能走多远,在于与谁同行


参考


  1. RTX3080+cuda问题 ↩︎

  2. GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation. ↩︎

你可能感兴趣的:(Debug,of,DL,PyTorch,pytorch,深度学习,神经网络)