RTX3090 与pytorch对应版本的安装问题汇总 |
您所在的位置:网站首页 › 汪汪队立大功第一季免费观看完整版中文 › RTX3090 与pytorch对应版本的安装问题汇总 |
一、Linux查看CUDA版本以及cudnn版本号
1、查看CUDA版本 方法1: 查看文件 cat /usr/local/cuda/version.txt方法2: 命令 nvcc --version2、查看cudnn版本 cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2注意:如果系统本身没安装cuda和cudnn,无法进行查询;实际使用过程中,发现在创建虚拟环境后,安装特定cuda版本的pytorch时会自带cuda和cudnn,这点需要关注。 二、RTX3090 与pytorch版本对应关系1、在RTX 3090 上判断,当前版本的的torch版本是否可以用,一般需要通过如下方式: (1)python 进入python 环境, import torch 导入torch 安装包; (2)测试 torch.cuda.is_available(), (3)测试 torch.zeros(1).cuda()才能说明当前版本的cuda 可以调用当前版本的pytorch 问题现象: >>> torch.zeros(1).cuda() /home/respecting/anaconda3/envs/torch1.8.1/lib/python3.7/site-packages/torch/cuda/__init__.py:104: UserWarning: NVIDIA GeForce RTX 3090 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_70. If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/问题分析: (1)表明当前的安装的pytorch 版本没有匹配上合适的cuda, 即当前pytorch 版本的 cuda 版本没有对应到自己主机上安装的cuda版本, (2)pytorch 环境中安装的cuda 版本,需要满足以下两个条件: 1、当前pytorch版本的算力支持当前机器上显卡的算力; 2、pytorch 中的 cuda 版本不能高于当前机器上已经安装的 cuda版本; 解决问题: 知道了问题的原因之后, 我们便可以解决了: 1、RTX3090 至少需要cuda 11.1 版本,才能够驱动该设备, 故我们可以安装cuda11.1 以上版本 所以在想要安装的 pytorch 版本中,找到大于cuda11.1 > import torch >>> torch.zeros(1).cuda() tensor([0.], device='cuda:0') >>> 出现这表示验证通过 四、查看PyTorch的版本及CUDA和cuDNN版本 检查PyTorch版本 torch.version # PyTorch version torch.version.cuda # Corresponding CUDA version torch.backends.cudnn.version() # Corresponding cuDNN version torch.cuda.get_device_name(0) # GPU type |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |