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
相关推荐
Struggle Sheep1 小时前
linux安装redis
linux·运维·redis
butteringing2 小时前
BuildFarm Worker 简要分析
linux·软件构建·bazel·re api
JolyouLu2 小时前
PyTorch-基础(CUDA、Dataset、transforms、卷积神经网络、VGG16)
人工智能·pytorch·cnn
reset20213 小时前
ubuntu离线安装ollama
linux·ubuntu·ollama
m0_748248773 小时前
在 Ubuntu 上安装 Nginx 的详细指南
nginx·ubuntu·postgresql
放氮气的蜗牛3 小时前
Linux命令终极指南:从入门到精通掌握150+核心指令
linux·运维·服务器
DC_BLOG4 小时前
Linux-Ansible模块进阶
linux·运维·服务器·ansible
Imagine Miracle4 小时前
【Deepseek】Linux 本地部署 Deepseek
linux·运维·服务器
SuperPurse4 小时前
linux下查看当前用户、所有用户的方法
linux·运维·服务器
Once_day4 小时前
linux之perf(17)PMU事件采集脚本
linux·运维·perf