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
相关推荐
Sheffield1 小时前
Docker的跨主机服务与其对应的优缺点
linux·网络协议·docker
Sheffield9 小时前
Alpine是什么,为什么是Docker首选?
linux·docker·容器
Johny_Zhao1 天前
centos7安装部署openclaw
linux·人工智能·信息安全·云计算·yum源·系统运维·openclaw
haibindev1 天前
在 Windows+WSL2 上部署 OpenClaw AI员工的实践与踩坑
linux·wsl2·openclaw
元Y亨H1 天前
华硕主机重装 Ubuntu 系统完全指南
ubuntu
Narrastory1 天前
明日香 - Pytorch 快速入门保姆级教程(三)
pytorch·深度学习
0xDevNull2 天前
Linux切换JDK版本详细教程
linux
进击的丸子2 天前
虹软人脸服务器版SDK(Linux/ARM Pro)多线程调用及性能优化
linux·数据库·后端
字节逆旅3 天前
ubuntu应用深度守护
ubuntu