从过去 2~3 天开始,当我登录 22.04.4 时,我遇到了严重的减速。我已启用 HWE 并使用 Nvidia 550.54.14(最新稳定二进制文件 - 通过安装专有 GPU 驱动程序 ppa)
dmesg 的输出非常有说服力,9 到 16 秒之间的间隔大约是我使用 gnome UI 时遇到的“卡住”时间(请注意,我最后总是遇到 nvidia 模式设置错误)。
[ 9.146934] rfkill: input handler disabled
[ 9.844813] igb 0000:08:00.0 enp8s0: igb: enp8s0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[ 16.114188] kauditd_printk_skb: 89 callbacks suppressed
[ 16.114191] audit: type=1400 audit(1712125860.060:100): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=2844 comm="snap-confine" capability=12 capname="net_admin"
[ 16.114197] audit: type=1400 audit(1712125860.060:101): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=2844 comm="snap-confine" capability=38 capname="perfmon"
[ 16.194249] Bluetooth: RFCOMM TTY layer initialized
[ 16.194255] Bluetooth: RFCOMM socket layer initialized
[ 16.194259] Bluetooth: RFCOMM ver 1.11
[ 16.500417] rfkill: input handler enabled
[ 16.757563] usb 5-1: reset high-speed USB device number 2 using xhci_hcd
[ 18.233844] rfkill: input handler disabled
[ 18.258517] audit: type=1400 audit(1712125862.204:102): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=3344 comm="snap-confine" capability=12 capname="net_admin"
[ 18.258528] audit: type=1400 audit(1712125862.204:103): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=3344 comm="snap-confine" capability=38 capname="perfmon"
[ 18.386970] warning: `kdeconnectd' uses wireless extensions which will stop working for Wi-Fi 7 hardware; use nl80211
[ 18.454209] audit: type=1400 audit(1712125862.400:104): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=3456 comm="snap-confine" capability=12 capname="net_admin"
[ 18.454222] audit: type=1400 audit(1712125862.400:105): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=3456 comm="snap-confine" capability=38 capname="perfmon"
[ 18.535374] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 19.043168] audit: type=1107 audit(1712125862.988:106): pid=1457 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/PolicyKit1/Authority" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.5" pid=3344 label="snap.snap-store.ubuntu-software" peer_pid=1472 peer_label="unconfined"
exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 19.043473] audit: type=1107 audit(1712125862.988:107): pid=1457 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/PolicyKit1/Authority" interface="org.freedesktop.PolicyKit1.Authority" member="CheckAuthorization" mask="send" name=":1.5" pid=3344 label="snap.snap-store.ubuntu-software" peer_pid=1472 peer_label="unconfined"
exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 19.045188] audit: type=1107 audit(1712125862.992:108): pid=1457 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/PolicyKit1/Authority" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.5" pid=3344 label="snap.snap-store.ubuntu-software" peer_pid=1472 peer_label="unconfined"
exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 19.045351] audit: type=1107 audit(1712125862.992:109): pid=1457 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/PolicyKit1/Authority" interface="org.freedesktop.PolicyKit1.Authority" member="CheckAuthorization" mask="send" name=":1.5" pid=3344 label="snap.snap-store.ubuntu-software" peer_pid=1472 peer_label="unconfined"
exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 20.020929] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.021003] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.021053] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.021099] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.039781] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.039839] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.039886] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.039931] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.073323] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.073380] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.073424] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 20.073467] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
我下一步该怎么做?完全删除 snap,看看速度是否变慢了?这snap store
可能是特定问题吗?还是snap
普遍问题?这发生在 LTS 上 - 也许我应该在使用了 16 年之后放弃 Ubuntu?
编辑 - 似乎 snap 应用程序一直存在 apparmor 问题并阻止了我的 gnome UI...
[ 20.073467] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 266.613145] kauditd_printk_skb: 1 callbacks suppressed
[ 266.613148] audit: type=1400 audit(1712126110.334:111): apparmor="DENIED" operation="open" class="file" profile="snap-update-ns.firefox" name="/usr/local/share/" pid=5087 comm="5" reques
ted_mask="r" denied_mask="r" fsuid=0 ouid=0
[ 266.618778] audit: type=1400 audit(1712126110.342:112): apparmor="DENIED" operation="open" class="file" profile="snap-update-ns.firefox" name="/var/lib/" pid=5087 comm="5" requested_mask
="r" denied_mask="r" fsuid=0 ouid=0
[ 266.619153] audit: type=1400 audit(1712126110.342:113): apparmor="DENIED" operation="open" class="file" profile="snap-update-ns.firefox" name="/var/lib/" pid=5087 comm="5" requested_mask
="r" denied_mask="r" fsuid=0 ouid=0
[ 266.946131] audit: type=1400 audit(1712126110.666:114): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:255" pid=5169 comm="glxtest"
requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 266.947868] audit: type=1400 audit(1712126110.670:115): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=5169 comm="glxtest" r
equested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 266.947939] audit: type=1400 audit(1712126110.670:116): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=5169 comm="glxtest" r
equested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 266.948058] audit: type=1400 audit(1712126110.670:117): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=5169 comm="glxtest" r
equested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 266.948173] audit: type=1400 audit(1712126110.670:118): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=5169 comm="glxtest" r
equested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 266.949436] audit: type=1400 audit(1712126110.670:119): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:255" pid=5169 comm="glxtest"
requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 266.949543] audit: type=1400 audit(1712126110.670:120): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:254" pid=5169 comm="glxtest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 308.257923] kauditd_printk_skb: 18 callbacks suppressed
[ 308.257927] audit: type=1107 audit(1712126151.983:139): pid=1457 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/timedate1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.156" pid=5067 label="snap.firefox.firefox" peer_pid=5912 peer_label="unconfined"
exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 309.318389] loop33: detected capacity change from 0 to 26472
[ 309.712187] audit: type=1400 audit(1712126153.435:140): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/snapd/21184/usr/lib/snapd/snap-confine" pid=6274 comm="apparmor_parser"
[ 309.712196] audit: type=1400 audit(1712126153.435:141): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/snapd/21184/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=6274 comm="apparmor_parser"
[ 309.946786] audit: type=1400 audit(1712126153.671:142): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.snap-store.hook.configure" pid=6278 comm="apparmor_parser"
[ 310.209264] audit: type=1400 audit(1712126153.935:143): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.snap-store.ubuntu-software" pid=6280 comm="apparmor_parser"
[ 310.210764] audit: type=1400 audit(1712126153.935:144): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.snap-store.snap-store" pid=6279 comm="apparmor_parser"
[ 310.236851] audit: type=1400 audit(1712126153.959:145): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.snap-store.ubuntu-software-local-file" pid=6281 comm="apparmor_parser"
[ 310.689415] audit: type=1400 audit(1712126154.415:146): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap-update-ns.snap-store" pid=6277 comm="apparmor_parser"
[ 1354.275646] audit: type=1400 audit(1712127198.025:147): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=8458 comm="snap-confine" capability=12 capname="net_admin"
[ 1354.275653] audit: type=1400 audit(1712127198.025:148): apparmor="DENIED" operation="capable" class="cap" profile="/usr/lib/snapd/snap-confine" pid=8458 comm="snap-confine" capability=38 capname="perfmon"
[ 1354.438438] audit: type=1400 audit(1712127198.185:149): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:255" pid=8549 comm="glxtest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 1354.438599] audit: type=1400 audit(1712127198.185:150): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=8549 comm="glxtest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 1354.438668] audit: type=1400 audit(1712127198.185:151): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=8549 comm="glxtest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 1354.438785] audit: type=1400 audit(1712127198.185:152): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=8549 comm="glxtest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 1354.438912] audit: type=1400 audit(1712127198.189:153): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=8549 comm="glxtest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 1354.440300] audit: type=1400 audit(1712127198.189:154): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:255" pid=8549 comm="glxtest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 1354.440434] audit: type=1400 audit(1712127198.189:155): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:254" pid=8549 comm="glxtest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 1354.440493] audit: type=1400 audit(1712127198.189:156): apparmor="DENIED" operation="symlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=8549 comm="glxtest" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 1360.543146] rfkill: input handler enabled
[ 1361.906161] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 1362.650837] rfkill: input handler disabled
[ 1370.450052] rfkill: input handler disabled
[ 1370.701264] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 1372.183502] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 1372.183580] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
增加更多证据,看起来火狐snap 是 trin 来访问/etc/fstab
。为什么?!?!
[ 5566.107612] audit: type=1400 audit(1712302387.753:203): apparmor="DENIED" operation="open" class="file" profile="snap.firefox.firefox" name="/etc/fstab" pid=6762 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[ 5566.145003] audit: type=1400 audit(1712302387.793:204): apparmor="DENIED" operation="open" class="file" profile="snap.firefox.firefox" name="/home/ema/Downloads/ubuntu-22.04.3-desktop-amd64.iso" pid=6762 comm="pool-firefox-be" requested_mask="r" denied_mask="r" fsuid=1000 ouid=64055
[ 5566.248740] audit: type=1107 audit(1712302387.897:205): pid=1332 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.781" pid=6762 label="snap.firefox.firefox" peer_pid=19705 peer_label="unconfined" exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 5566.249878] audit: type=1107 audit(1712302387.897:206): pid=1332 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.781" pid=6762 label="snap.firefox.firefox" peer_pid=19705 peer_label="unconfined" exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 5702.337389] audit: type=1107 audit(1712302523.989:207): pid=1332 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_signal" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.19" mask="receive" pid=6762 label="snap.firefox.firefox" peer_pid=1551 peer_label="unconfined" exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 5702.815941] audit: type=1107 audit(1712302524.465:208): pid=1332 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_signal" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.19" mask="receive" pid=6762 label="snap.firefox.firefox" peer_pid=1551 peer_label="unconfined" exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 6284.717835] audit: type=1107 audit(1712303106.387:209): pid=1332 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_signal" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.19" mask="receive" pid=6762 label="snap.firefox.firefox" peer_pid=1551 peer_label="unconfined" exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
[ 6943.444220] audit: type=1107 audit(1712303765.136:210): pid=1332 uid=102 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_signal" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.19" mask="receive" pid=6762 label="snap.firefox.firefox" peer_pid=1551 peer_label="unconfined" exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
这又造成了短暂的冻结。
添加更多证据表明我的桌面环境重置可能是因为 snap 应用程序被 apparmor 阻止:
[ 22.188245] audit: type=1400 audit(1714109480.140:99): apparmor="DENIED" operation="capable" class="cap" profile="/snap/snapd/21465/usr/lib/snapd/snap-confine" pid=3540 comm="snap-confine" capability=12 capname="net_admin"
[ 22.188260] audit: type=1400 audit(1714109480.140:100): apparmor="DENIED" operation="capable" class="cap" profile="/snap/snapd/21465/usr/lib/snapd/snap-confine" pid=3540 comm="snap-confine" capability=38 capname="perfmon"
[ 22.202813] [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000e00] Failed to grab modeset ownership
[ 22.270619] audit: type=1400 audit(1714109480.220:101): apparmor="DENIED" operation="symlink" class="file" profile="snap.snapd-desktop-integration.snapd-desktop-integration" name="/dev/char/195:255" pid=3612 comm="snapd-desktop-i" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 22.272070] audit: type=1400 audit(1714109480.220:102): apparmor="DENIED" operation="symlink" class="file" profile="snap.snapd-desktop-integration.snapd-desktop-integration" name="/dev/char/195:0" pid=3612 comm="snapd-desktop-i" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 22.272188] audit: type=1400 audit(1714109480.220:103): apparmor="DENIED" operation="symlink" class="file" profile="snap.snapd-desktop-integration.snapd-desktop-integration" name="/dev/char/195:0" pid=3612 comm="snapd-desktop-i" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 22.272336] audit: type=1400 audit(1714109480.224:104): apparmor="DENIED" operation="symlink" class="file" profile="snap.snapd-desktop-integration.snapd-desktop-integration" name="/dev/char/195:0" pid=3612 comm="snapd-desktop-i" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 22.272466] audit: type=1400 audit(1714109480.224:105): apparmor="DENIED" operation="symlink" class="file" profile="snap.snapd-desktop-integration.snapd-desktop-integration" name="/dev/char/195:0" pid=3612 comm="snapd-desktop-i" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
[ 22.276113] audit: type=1400 audit(1714109480.224:106): apparmor="DENIED" operation="symlink" class="file" profile="snap.snapd-desktop-integration.snapd-desktop-integration" name="/dev/char/195:255" pid=3612 comm="snapd-desktop-i" requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000