赞
踩
【下载地址】https://mirrors.aliyun.com/oldubuntu-releases/releases/20.04.3/?spm=a2c6h.25603864.0.0.36217ff3gWdrml
【安装教程参考】https://blog.csdn.net/Eyesleft_being/article/details/126020113
【注意】安装时把安装图形、第三方软件的也√上
安装完成后的第一件事,先把apt的源给换了,具体操作如下:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份默认源
cd /etc/apt/
sudo rm -f /etc/apt/sources.list #删除原有的源
sudo vi sources.list #然后将复制的内容粘贴进去保存退出
sudo apt-get update #检查更新
在sources.list文件的前面添加下面内容(在原来的基础上增加清华源)
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
保存退出,更新一下源
sudo apt update
sudo apt upgrade
到cuda包存放的目录下打开终端,进行安装
sudo sh cuda_11.4.2_470.57.02_linux.run
【只选择cuda,其他的nvidia、后面三个都不选】
修改配置
echo 'export PATH=/usr/local/cuda-11.4/bin${PATH:+:${PATH}}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc
source ~/.bashrc
nvcc -V
根据CUDA和Ubuntu的版本,选择对应的cudnn
https://developer.nvidia.com/rdp/cudnn-archive
安装cudnn,讲cudnn的include和lib64中的所有文件,复制到cuda安装位置中include和lib64的文件夹中
tar -zxvf cudnn-11.4-linux-x64-v8.2.4.15.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
参考:https://www.quanxiaoha.com/idea-pojie/idea-reset-30-day.html
【3】下载pycharm2021.2.2版本,地址:
https://www.jetbrains.com/pycharm/download/other.html
解压,并转移
tar zxvf pycharm-professional-2021.2.2.tar.gz
sudo mv pycharm-professional-2021.2.2 /opt/
重置的破解包,点这下载
链接: https://pan.baidu.com/s/1xoM59N_wj2Ju1cKFo2EaNg 提取码: wuye
去到下载的文件夹内,执行命令:
bash Anaconda3-2020.02-Linux-x86_64.sh
添加/更换 conda 清华源
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/main/'
conda config --set show_channel_urls yes
配置conda环境变量
sudo gedit ~/.bashrc
在文件末尾添加
#选择自己的anaconda安装路径
export PATH=”/home/wuye/anaconda3/bin:$PATH”
#更新一下:
source ~/.bashrc
最后输入conda -V检验一下,出现conda的版本信息即安装成功。
创建个人环境,我搭建tensorFlow1专用环境
conda create -n tf1 python=3.8
在创建的tf1环境中安装包
conda activate tf1
30系列显卡不支持TensorFlow1,可使用nvidia-tensorflow替代,按照官网走即可
nvidai-tensorflow官网: https://developer.nvidia.com/blog/accelerating-tensorflow-on-a100-gpus/
安装nvidia-tensorflow
apt update
pip install --upgrade pip setuptools requests
pip install nvidia-pyindex
pip install nvidia-tensorflow[horovod]
#查看是否安装成功
pip list | grep nvidia
# 查看tensorflow版本
python -c 'import tensorflow as tf; print(tf.__version__)'
# 验证GPU调用tensorflow
python -c "import tensorflow as tf; print('Num GPUs Available: ', len(tf.config.experimental.list_physical_devices('GPU')))"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。