Y9000p,3060-laptop,ubuntu安装显卡驱动nvidia-driver-470

问题介绍

最近搞了好几次系统来装显卡驱动,重启后一直有问题,最后成功安装。特此记录
电脑配置:2021联想y9000p

心酸历程

1.ubuntu18.04+RTX3060 (laptop)+nvidia-driver-470

用系统自带的软件和更新方法安装驱动,重启后,进入ubuntu系统左上角一直有图标一闪一闪,
无法进入图形化界面,进入tty命令行界面能输入

nvidia-smi

看到驱动已经安装,有长方块显示,但是nvidia-settings无法进入

2.ubuntu18.04+RTX3060 (laptop)+nvidia-driver-470

后来重装系统,用最原始的方法安装驱动,还是一样的问题,我以为是哪一步配置不对,后来发现不是这个问题,百度到说可能是内核和驱动不匹配。于是重装ubuntu20.04

3.ubuntu20.04+RTX3060 (laptop)+nvidia-driver-470

新系统打开第一件事更换软件源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo gedit /etc/apt/sources.list

删除全部内容,更换为

#添加阿里源
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
#添加清华源
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 multiverse
sudo apt-get update

之后立刻进入软件和更新,点击附加驱动,选择推荐的显卡驱动,重启后就正常了,能够进入图形化界面,输入

nvidia-smi
nvidia-settings

都有对应输出
问题解决!!!!

题外话:
如果nvidia-smi显示
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver
终端输入

sudo apt install nvidia-cuda-toolkit

问题解决方法:
无法连接NVIDIA驱动:NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver

问题总结

如果电脑是刚买的新版本,ubuntu18.04的支持度不够,必须装ubuntu20.04

你可能感兴趣的:(环境配置,ubuntu,深度学习,pytorch)