ubuntu下anconda装pytorch

1、禁用nouveau

复制代码
sudo vim /etc/modprobe.d/blacklist.conf

在文件最后部分插入以下两行内容

复制代码
blacklist nouveau
options nouveau modeset=0

更新系统

复制代码
sudo update-initramfs -u

重启系统

2、装nvidia驱动

卸载原来驱动

复制代码
  sudo apt-get remove nvidia-*  (若安装过其他版本或其他方式安装过驱动执行此项)

给驱动run文件赋予执行权限:

复制代码
sudo chmod  a+x NVIDIA-Linux-x86_64-418.43.run

安装

复制代码
sudo ./NVIDIA-Linux-x86_64-418.43.run -no-x-check -no-nouveau-check -no-opengl-files 

3、装anconda

清华源下载符合自己系统的最新版(尽可能下载新的,否则pytorch也不能安装比较新的版本)Index of /https://repo.anaconda.com/archive/配置安装清华源:

复制代码
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
conda config --set show_channel_urls yes

3、装pytorch

复制代码
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xxx
相关推荐
我只会发热2 分钟前
Ubuntu 20.04.6 根目录扩容(图文详解)
linux·运维·ubuntu
爱潜水的小L15 分钟前
自学嵌入式day34,ipc进程间通信
linux·运维·服务器
保持低旋律节奏16 分钟前
linux——进程状态
android·linux·php
zhuzewennamoamtf25 分钟前
Linux I2C设备驱动
linux·运维·服务器
zhixingheyi_tian44 分钟前
Linux 之 memory 碎片
linux
邂逅星河浪漫1 小时前
【域名解析+反向代理】配置与实现(步骤)-SwitchHosts-Nginx
linux·nginx·反向代理·域名解析·switchhosts
梅尔文.古1 小时前
RaspberryPi-如何启用看门狗
linux·运维·服务器
木子欢儿1 小时前
Ubuntu 24 安装 fcitx5 + rime + 雾凇配置
linux·运维·服务器·ubuntu
Alice1 小时前
linux scripts
java·linux·服务器
代码游侠1 小时前
学习笔记——IPC(进程间通信)
linux·运维·网络·笔记·学习·算法