首页 > 系统相关 >使用ubuntu根据cuda11.2安装pytorch

使用ubuntu根据cuda11.2安装pytorch

时间:2023-12-12 17:46:09浏览次数:44  
标签:PyTorch pytorch version cuda 版本 ubuntu cuda11.2 安装

在使用镜像新建了一个cuda11.2-python3.9 容器配置环境的过程中需要安装PyTorch。一开始我直接使用 pip install torch 来进行安装,但是运行程序时出现报错:

RuntimeError: The NVIDIA driver on your system is too old (found version 11020). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver.

这个错误表明目前系统上安装的 NVIDIA 驱动程序版本太旧,不满足 PyTorch 对 cuda驱动程序的要求。根据提示我们可以选择更新NVIDIA 驱动,或者安装适当版本的PyTorch。这里我选择了更新PyTorch。

首先通过 nvcc -V 指令查看cuda版本,得知为版本11.2

在官方安装pytorch2.0的文档中,最低cuda版本为11.8.因此我们需要安装一个旧版pytorch

在官方的旧版pytorch与cuda版本对应中可以找到支持版本11.2以下的最高版本是v1.12.1,通过安装指令:

# CUDA 10.2
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=10.2 -c pytorch

标签:PyTorch,pytorch,version,cuda,版本,ubuntu,cuda11.2,安装
From: https://www.cnblogs.com/tungsten106/p/install_pytorch_by_cuda_ubuntu.html

相关文章

  • ubuntu 22.04 server 命令行很卡 很慢 无语
    我找到了另一个禁用帧缓冲区。我添加blacklistvga16fb到/etc/modprobe.d/blacklist-framebuffer.conf.......
  • ubuntu的默认root密码
    Ubuntu默认是没有为root用户设置密码的。在Ubuntu系统中,root用户默认是锁定的,这意味着您无法直接作为root用户登录。但是,您可以通过以下方法访问root用户的权限:使用sudo:Ubuntu推荐使用sudo命令来执行需要管理员权限的操作。当您在命令前加上sudo并且输入您的普......
  • ubuntu使用疑难问题记录
    1虚拟机ubuntu安装好VMwareTools后,可以和windows共享文件,但是终端与windows之间还是无法复制粘贴文字。解决办法:sudoapt-getinstallopen-vm-toolssudoapt-getinstallopen-vm-tools-desktop2windows终端登录开发板后,输入长命令无法自动换行,并且会覆盖前面......
  • ubuntu 下 docker 中部署 jenkins,并配置安卓 python 开发环境
    1、ubuntu中下载AndroidSdk#安装unzip工具sudoaptupdatesudoaptinstallunzip#下载AndroidSDKwgethttps://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip#解压unzipcommandlinetools-linux-7302050_latest.zip-dandroid......
  • Ubuntu开启NTP时间同步
    Ubuntu使用timesyncd开启NTP时间同步,并替换为ntpd步进式的逐渐校正时间。环境为Ubuntu22.04LTS时区在Ubuntu20.04及之后的版本中,内置了时间同步功能,并且默认使用systemd的timesyncd服务来激活。timesyncd替代了老旧的ntpdate的功能。检查当前时区命令:timedatectl......
  • Ubuntu 22设置静态IP
    打开终端,以管理员身份运行以下命令以编辑网络配置文件:sudonano/etc/netplan/00-installer-config.yaml在打开的文件中,找到类似于以下内容的部分:network:ethernets:enp0s3:dhcp4:trueversion:2将dhcp4:true修改为dhcp4:false,然后添加以下内容以设置静......
  • 装完Ubuntu后默认root用户的密码是多少?如何修改root密码
    1、Ubuntu的默认root密码是随机的,即每次开机都有一个新的root密码。可以在终端输入命令:sudopasswd然后输入当前用户的密码。2、终端会提示输入新的密码并确认,此时的密码就是root新密码。修改成功后,输入命令:suroot再输入新的密码就ok了。......
  • Ubuntu20.04 PostgreSQL 14 安装配置记录
    PostgreSQL名称来源ItwasoriginallynamedPOSTGRES,referringtoitsoriginsasasuccessortotheIngresdatabasedevelopedattheUniversityofCalifornia,Berkeley.In1996,theprojectwasrenamedtoPostgreSQLtoreflectitssupportforSQL.PostgreSQL......
  • ubuntu给终端加代理服务器
    ubuntu给终端加代理访问google.com是否可以访问通curlhttps://www.google.com如果访问不通说明代理服务器没有配置好。使用gedit~/.bashrc打开网络配置gedit~/.bashrc找到文章的最后添加代理exporthttp_proxy='http://127.0.0.1:7890'exporthttps_proxy='http://127.0.0.1......
  • ubuntu-购买云服务器修改为root权限并安装宝塔上线官网静态页面
    1、首先在购买服务器时会让你填写用户名和密码,需要记住,然后登录默认是 在设置密码时默认登录名为ubuntu不可选 2、使用vim /etc/ssh/sshd_config修改下面的参数:PermitRootLogin yes保存退出,重启ssh服务(systemctl restart sshd)。然后在控制台重置密码,选择自定义用户,填......