Debian 内核更新 KDE 桌面失效小记

废话不多说,上脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# 更新系统内核
sudo apt update && sudo apt upgrade

# 若此时重启会在开机时卡在组件加载,无法进入KDE,切换原内核后一切正常

# 不使用KDE重启
sudo systemctl set-default multi-user.target
sudo reboot

# 重装相关GPU驱动(AMD 5625U APU)
sudo apt reinstall xserver-xorg-video-amdgpu
sudo apt update --fix-missing

sudo update-initramfs -u

# 检查出了realtek的问题,顺带修复
sudo apt reinstall firmware-realtek

sudo update-initramfs -u

dpkg -l | grep amdgpu

sudo apt remove --purge fgirx*
sudo apt remove --purge xserver-xorg-video-ati
sudo apt remove --purge xserver-xorg-video-amdgpu
sudo apt remove libdrm-amdgpu1:i386

sudo apt install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core

sudo dpkg-reconfigure xserver-xorg
sudo update-initramfs -u
sudo update-grub

sudo apt-get install --reinstall firmware-amd-graphics libgl1-mesa-dri libglx-mesa0 mesa-vulkan-drivers xserver-xorg-video-all
sudo reboot

# 此时并没有解决问题,进入命令行系统时显卡驱动并未加载

sudo systemctl set-default multi-user.target
sudo systemctl isolate graphical.target
# 失败

cat /var/log/Xorg.0.log | grep '(EE)'

# (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
# [ 1172.091] (EE) Failed to load module "amdgpu" (module does not exist, 0)
# 此处并无amdgpu模块加载

ls /lib/modules/$(uname -r)/kernel/drivers/gpu/drm/amd/amdgpu/amdgpu.ko
# /lib/modules/6.1.0-16-amd64/kernel/drivers/gpu/drm/amd/amdgpu/amdgpu.ko
# 检查对应模块存在

sudo apt-get install xserver-xorg-video-amdgpu
sudo update-initramfs -u
sudo reboot

startx
# 正常

# 查询开机模块启动策略
nano /etc/modules-load.d/modules.conf
sudo nano /etc/modules-load.d/modules.conf

# 此处有不知名黑名单禁用了amdgpu,注释或删除即可
cat /etc/modprobe.d/blacklist-amdgpu.conf
# blacklist amdgpu

ls /etc/modprobe.d/
cat /etc/modprobe.d/blacklist-amdgpu.conf
sudo nano /etc/default/grub

cd /etc/modprobe.d
sudo nano blacklist-amdgpu.conf
sudo update-initramfs -u

#update-initramfs: Generating /boot/initrd.img-6.1.0-16-amd64
#W: Possible missing firmware /lib/firmware/amdgpu/ip_discovery.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/vega10_cap.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/sienna_cichlid_cap.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/navi12_cap.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_11_ta.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_11_toc.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_10_ta.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/psp_13_0_10_sos.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/aldebaran_cap.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_3_imu.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_4_rlc.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_4_mec.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_4_me.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_4_pfp.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_3_rlc.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_3_mec.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_3_me.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_3_pfp.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_0_toc.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/sdma_6_0_3.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/sienna_cichlid_mes1.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/sienna_cichlid_mes.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/navi10_mes.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_4_mes1.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_4_mes_2.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_4_mes.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_3_mes1.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_3_mes_2.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_3_mes.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_2_mes_2.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_1_mes_2.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/gc_11_0_0_mes_2.bin for module amdgpu
#W: Possible missing firmware /lib/firmware/amdgpu/smu_13_0_10.bin for module amdgpu

sudo systemctl set-default graphical.target
# 一切正常