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
相关推荐
小猪佩奇TONY1 分钟前
Linux 内核学习(14) --- linux x86-32 虚拟地址空间
linux·学习
Lam㊣11 分钟前
Centos 7 系统docker:更换镜像源
linux·docker·centos
FL162386312921 分钟前
win11+WSL+Ubuntu-xrdp+远程桌面闪退+黑屏闪退解决
linux·运维·ubuntu
石头53029 分钟前
Kubernetes监控全栈解决方案:从零搭建Prometheus+Grafana监控体系
linux
ha204289419434 分钟前
Linux操作系统学习记录之---TcpSocket
linux·网络·c++·学习
AOwhisky1 小时前
Linux逻辑卷管理:从“固定隔间”到“弹性存储池”的智慧
linux·运维·服务器
刘一说2 小时前
TypeScript 与 JavaScript:现代前端开发的双子星
javascript·ubuntu·typescript
石像鬼₧魂石2 小时前
22端口(OpenSSH 4.7p1)渗透测试完整复习流程(含实战排错)
大数据·网络·学习·安全·ubuntu
C Yu小白2 小时前
Linux系统调用与文件操作详解
linux·运维·服务器
ZFB00013 小时前
【麒麟桌面系统】V10-SP1 2503 系统知识——常见用户组简介
linux·运维·kylin