阿里云服务器(vgn7i-vws) anaconda(py39)+pytorch1.12.0(cu113)

用xshell连接ip地址,端口号22,输入用户密码

安装anaconda 2022 10 py3.9

wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh

sha256sum Anaconda3-2022.10-Linux-x86_64.sh #校验数据完整性

chmod u+x Anaconda3-2022.10-Linux-x86_64.sh #添加执行权限

bash Anaconda3-2022.10-Linux-x86_64.sh #执行安装脚本

Do you accept the license terms? [yes|no]

yes

/home/anaconda3

yes

#添加环境变量

vim /etc/profile

i

(末尾)export PATH=/home/develop/anaconda3/bin:$PATH

:wq!

#查看conda版本

conda -V

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

conda config --show-sources

查看硬件版本,阿里云vgn7i-vws公共镜像需管理员权限装显卡驱动

lspci | grep -i vga

lspci | grep -i nvidia

安装驱动

sudo apt-get update

apt install ubuntu-drivers-common

ubuntu-drivers devices

sudo ubuntu-drivers autoinstall

查看驱动

nvidia-smi(看到11.4版本)

wget ......cuda11.4.sh

bash cuda11.4.sh

wget ......cudnn-CUDA11.x%28v8.9.3%29.sh

bash cudnn-CUDA11.x\(v8.9.3\).sh

重启生效

reboot

nvcc -V

装pytorch(cu113即可,cuda114向下兼容)

pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html

python

import torch

torch.version

VSCode连接

用户名@ip地址 root@127.xx.xx.xxx 不用写端口号

继续/跳过/不再显示

输入密码

相关推荐
java叶新东老师3 小时前
git stash 命令详解
linux·运维·flink
写bug的羊羊4 小时前
CentOS 9 配置国内 YUM 源
linux·运维·centos
毛飞龙4 小时前
Python类(class)参数self的理解
python··self
魔尔助理顾问4 小时前
系统整理Python的循环语句和常用方法
开发语言·后端·python
颜颜yan_6 小时前
Python面向对象编程详解:从零开始掌握类的声明与使用
开发语言·redis·python
Johny_Zhao6 小时前
CentOS Stream 9上部署FTP应用服务的两种方法(传统安装和docker-compose)
linux·网络安全·信息安全·kubernetes·云计算·containerd·ftp·yum源·系统运维
我的ID配享太庙呀7 小时前
Django 科普介绍:从入门到了解其核心魅力
数据库·后端·python·mysql·django·sqlite
守望时空337 小时前
RustDesk搭建指南
linux
C++ 老炮儿的技术栈7 小时前
在 Scintilla 中为 Squirrel 语言设置语法解析器的方法
linux·运维·c++·git·ubuntu·github·visual studio
@蓝莓果粒茶8 小时前
LeetCode第350题_两个数组的交集II
c++·python·学习·算法·leetcode·职场和发展·c#