降级内核(因与gpu驱动不兼容)

dell@dell-Precision-3630-Tower  /nvme/cudaspace  nvidia-smi               
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

原因是因为内核升级,导致驱动和内核不兼容
解决办法:降级内核,从5.15.0-107降级为5.15.0-102
查找linux指定版本的内核镜像

apt-cache search linux| grep 5.15.0-102

打开软件源配置文件,添加新的软件源,并更新

sudo vim /etc/apt/sources.list

deb http://security.ubuntu.com/ubuntu trusty-security main

sudo apt-get update

安装指定版本内核的linux系统头文件以及镜像还有扩展

sudo apt-get install linux-image-5.15.0-102-generic
sudo apt-get install linux-image-extra-5.15.0-102-generic #没有安装也没影响
sudo apt-get install linux-headers-5.15.0-102-generic
sudo apt-get install linux-headers-5.15.0-102 #不建议安装这个,因为大概一晚上过去了

输入以下命令可以查看安装的内核版本有哪些

dell@dell-Precision-3630-Tower  /etc/apt/sources.list.d  dpkg --get-selections | grep linux-image                   

linux-image-5.15.0-101-generic			deinstall
linux-image-5.15.0-102-generic			install
linux-image-5.15.0-105-generic			install
linux-image-5.15.0-107-generic			install
linux-image-5.15.0-75-generic			deinstall
linux-image-5.15.0-76-generic			deinstall
linux-image-5.15.0-78-generic			deinstall
linux-image-5.15.0-79-generic			deinstall
linux-image-5.15.0-82-generic			deinstall
linux-image-5.15.0-83-generic			deinstall
linux-image-5.15.0-84-generic			deinstall
linux-image-5.15.0-86-generic			deinstall
linux-image-5.15.0-87-generic			deinstall
linux-image-5.4.0-26-generic			deinstall
linux-image-generic-hwe-20.04			install

安装显卡网卡等驱动

sudo apt-get install linux-tools-5.15.0-102-generic
sudo apt-get install linux-modules-extra-5.15.0-102-generic

查看当前内核启动顺序并修改

dell@dell-Precision-3630-Tower  /etc/apt/sources.list.d  grep menuentry /boot/grub/grub.cfg                         
if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
  menuentry_id_option=""
export menuentry_id_option
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-1efebe71-306e-4781-aef0-830571f2aacd' {
submenu 'Ubuntu 的高级选项' $menuentry_id_option 'gnulinux-advanced-1efebe71-306e-4781-aef0-830571f2aacd' {
	menuentry 'Ubuntu,Linux 5.15.0-107-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-107-generic-advanced-1efebe71-306e-4781-aef0-830571f2aacd' {
	menuentry 'Ubuntu, with Linux 5.15.0-107-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-107-generic-recovery-1efebe71-306e-4781-aef0-830571f2aacd' {
	menuentry 'Ubuntu,Linux 5.15.0-105-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-105-generic-advanced-1efebe71-306e-4781-aef0-830571f2aacd' {
	menuentry 'Ubuntu, with Linux 5.15.0-105-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-105-generic-recovery-1efebe71-306e-4781-aef0-830571f2aacd' {
	menuentry 'Ubuntu,Linux 5.15.0-102-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-102-generic-advanced-1efebe71-306e-4781-aef0-830571f2aacd' {
	menuentry 'Ubuntu, with Linux 5.15.0-102-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.15.0-102-generic-recovery-1efebe71-306e-4781-aef0-830571f2aacd' {
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
sudo vim /etc/default/grub

#add
GRUB_DEFAULT="Advanced options for Ubuntu > Ubuntu, Linux 5.15.0-102-generic"

#更新配置
sudo update-grub

sudo reboot

在重启过程中一直按esc进入ubuntu 的高级选项,选择Linux 5.15.0-102-generic
查看内核版本,发现降级成功

dell@dell-Precision-3630-Tower  /etc/apt/sources.list.d  uname -r
5.15.0-102-generic
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值