Ubuntu20.4使用心得

最近在物理机上装了Ubuntu20.4,并成功弄好了nvidia-driver435 + cuda10.0 + cudnn v7.6.5 for cuda10.0

一、更换apt源和pip源

1. apt: 配置文件在 /etc/apt/sources.list中(直接去阿里巴巴镜像站https://developer.aliyun.com/mirror/)

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

2. pip源

阿里巴巴镜像站https://developer.aliyun.com/mirror/pypi?spm=a2c6h.13651102.0.0.3e221b11uGZHjw

二、桌面美化gnome

三、安装qq微信

见这篇文章https://github.com/zq1997/deepin-wine

四、cuda 和 cuddn的安装

见这篇文https://blog.csdn.net/ashome123/article/details/105822040

最后注意:版本一定要对应

在运行过程中可能会报错

  • 1. 找不到文件,或者不能打开文件libcuddn.so.10.1等等,这类问题,只需建立软链接即可 sudo ln -s libcuddn.so.10 libcuddn.so.10.1(注意这里的软链接一定要建立在这个文件被引用的地方,报错中会指明,或者是tensorflow的lib模块中,具体问题具体分析)
  • 2. 提示out of memory,1. 将显存获取改为动态获取(见以下代码);2. 将batch_size调小
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
    try:
        # Currently, memory growth needs to be the same across GPUs
        for gpu in gpus:
            tf.config.experimental.set_memory_growth(gpu, True)
        logical_gpus = tf.config.experimental.list_logical_devices('GPU')
        print(len(gpus), "Physical GPUs,", len(logical_gpus), "Logical GPUs")
    except RuntimeError as e:
        # Memory growth must be set before GPUs have been initialized
        print(e)

五、注意

  1. 不要随便rm,以免系统崩溃
  2. linux卸载软件有指定的命令的,不能随便删(多读readme.md)

 

你可能感兴趣的:(linux)