RTX3080+cuda问题

18 篇文章 1 订阅

1.在运行pytorch程序的时候报这样的错:
GeForce RTX 3080 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功能的GeForce RTX 3080 sm_86与当前Pythorch安装不兼容。当前Pythorch安装支持CUDA功能sm_37sm_50 sm_60 sm_61 sm_70 sm_75 compute_37。
我配置的环境是 ubuntu20系统,nvdia-455显卡驱动,安装的cuda 是1.2版本对应的cudnn是8_8.0.5.39。torch是torch-1.7.0-cp38-cp38-linux_x86_64。
去torch的githup上和去cuda的官网上查看发现
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.
(大概意思是说如果你gpu算力是7.5的话,算力是7的cuda可以在上边运行,但算力为7.5的cuda不能够在算力为7的gpu上运行。算力为7的cuda不能够在算力为8的gpu上运行。)说人话,就是cuda算力要低于或等于gpu的算法,但是跨版本就不行。
so综上所述我们要下算力为8的cuda才能够在gpu上运行程序。
2.在cuda官方文档中发现cuda10.2最高支持的是7.5的因此报错是正常的。
With versions 11.0 of the CUDA Toolkit, nvcc can generate cubin native to the NVIDIA Ampere GPU architecture (compute capability 8.0). When using CUDA Toolkit 11.0, to ensure that nvcc will generate cubin files for all recent GPU architectures as well as a PTX version for forward compatibility with future GPU architectures, specify the appropriate -gencode= parameters on the nvcc command line as shown in the examples below.
从上述文档可以看到11.0就可以了。于是我就去踩坑去了。可以的话会发教程的。
3. 解决方案:
下载cuda11重新配置环境。
参考文章
1.参考文章1,csdn的
2.cdua官方文档,英文都是上边的
3.pytorch的githup issue,国外的小伙也遇到问题了

  • 7
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
在 Ubuntu 20.04 上使用 RTX 3080 和 CUDA 进行 GPU 加速,您需要按照以下步骤进行设置: 1. 首先,确保您的系统已经安装了适当的 NVIDIA 显卡驱动程序。您可以通过以下命令检查当前安装的驱动程序版本: ``` nvidia-smi ``` 如果未安装驱动程序或版本过旧,您可以通过以下命令安装最新的驱动程序: ``` sudo apt-get update sudo apt-get install nvidia-driver-460 ``` 2. 安装 CUDA 工具包。在 Ubuntu 20.04 上,您可以通过以下命令安装 CUDA 11.2 版本: ``` wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 wget https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda-repo-ubuntu2004-11-2-local_11.2.2-460.32.03-1_amd64.deb sudo dpkg -i cuda-repo-ubuntu2004-11-2-local_11.2.2-460.32.03-1_amd64.deb sudo apt-key add /var/cuda-repo-ubuntu2004-11-2-local/7fa2af80.pub sudo apt-get update sudo apt-get install cuda ``` 3. 配置环境变量。打开您的 `~/.bashrc` 文件,并添加以下行到文件末尾: ``` export PATH=/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH ``` 保存文件后,运行以下命令使更改生效: ``` source ~/.bashrc ``` 4. 验证安装。您可以通过运行以下命令来验证 CUDA 是否正确安装: ``` nvcc --version ``` 如果安装成功,您应该能够看到 CUDA 版本信息。 现在,您的 Ubuntu 20.04 系统应该已经配置好了使用 RTX 3080 和 CUDA 进行 GPU 加速。您可以在开发环境中使用 CUDA 编程或在支持 CUDA 的应用程序中利用 GPU 加速。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值