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
相关推荐
实心儿儿20 分钟前
Linux —— 传输层协议TCP
linux·服务器·tcp/ip
祖力5532 分钟前
Linux应用软件编程:目录IO与framebuffer
linux·运维·算法·framebuffer·目录io
词却1 小时前
Linux基础:常用基本命令与软件包管理
linux
2401_890603402 小时前
Linux 进程控制
linux·运维·服务器
啦啦啦啦啦zzzz2 小时前
时间轮定时器
linux·服务器·网络·c++·定时器
神威难绷泪3 小时前
Linux应用软件编程:目录IO framebuffer
linux
byte轻骑兵3 小时前
【BlueZ 】BLE 与经典蓝牙的差异:BlueZ 中双模式的源码区分设计
linux·bluez·电脑蓝牙·嵌入式蓝牙
小雪崩4 小时前
嵌入式学习 day30:minilog
linux·c语言·学习
嵌入式小能手4 小时前
飞凌嵌入式ElfBoard-Shell脚本编写基础-传参-$0
linux
丰锋ff4 小时前
初识Linux操作系统
linux·运维·服务器