Ubuntu 20.04 随机“锁定”——USB 问题?

Ubuntu 20.04 随机“锁定”——USB 问题?

这是在我的桌面上全新安装的 Ubuntu 20.04。我一开始使用的是 Ubuntu Server 20.04,然后添加了 GNOME 以进行最小设置。这是在自建系统上,配有 Ryzen 7 1800x 和 Gigabyte AX370 Gaming 5 主板。操作系统正在 UEFI 模式下从 NVMe 驱动器启动。

问题是,有时我的机器会突然死机。这种情况在 18.04 中也发生过,但并不常见(大约每周一次,但现在我已经在过去一小时内看到 4 次崩溃)。另一个不同之处在于,当我的系统在 18.04 中死机时,我仍然可以 ping 或 SSH 进入它,但在 20.04 中,系统会完全断网。ping 根本没有回复。

我检查了dmesg一下可能出了什么问题,但没有发现任何表明存在问题的信息。因此,我查看了系统日志消息,将范围缩小到系统崩溃前的时刻,并注意到:

May  3 16:33:39 ubuntu fido_id[37963]: 1-12:1.0: Failed to open report descriptor at '/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-12/1-12:1.0/report_descriptor': No such file or directory
May  3 16:33:39 ubuntu kernel: [43202.523116] hid-generic 0003:1B1C:0C04.2991: hiddev0,hidraw0: USB HID v1.11 Device [Corsair Memory, Inc. Integrated USB Bridge] on usb-0000:02:00.0-12/input0
May  3 16:33:39 ubuntu kernel: [43202.532084] hid-generic 0003:1B1C:0C04.2992: hiddev0,hidraw0: USB HID v1.11 Device [Corsair Memory, Inc. Integrated USB Bridge] on usb-0000:02:00.0-12/input0
May  3 16:33:39 ubuntu fido_id[37965]: 1-12:1.0: Failed to open report descriptor at '/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-12/1-12:1.0/report_descriptor': No such file or directory
May  3 16:33:39 ubuntu kernel: [43202.541495] hid-generic 0003:1B1C:0C04.2993: hiddev0,hidraw0: USB HID v1.11 Device [Corsair Memory, Inc. Integrated USB Bridge] on usb-0000:02:00.0-12/input0
May  3 16:33:39 ubuntu fido_id[37967]: 1-12:1.0: Failed to open report descriptor at '/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-12/1-12:1.0/report_descriptor': No such file or directory
May  3 16:33:39 ubuntu fido_id[37969]: 1-12:1.0: Failed to open report descriptor at '/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-12/1-12:1.0/report_descriptor': No such file or directory
May  3 16:33:39 ubuntu fido_id[37971]: 1-12:1.0: Failed to open report descriptor at '/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-12/1-12:1.0/report_descriptor': No such file or directory
May  3 16:33:39 ubuntu fido_id[37973]: 1-12:1.0: Failed to open report descriptor at '/sys/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-12/1-12:1.0/report_descriptor': No such file or directory
May  3 16:33:39 ubuntu kernel: [43202.601501] hid-generic 0003:1B1C:1C07.2994: hiddev0,hidraw0: USB HID v1.11 Device [                                                ] on usb-0000:02:00.0-13.2/input0
May  3 16:33:39 ubuntu kernel: [43202.606771] hid-generic 0003:1B1C:0C04.2995: hiddev4,hidraw4: USB HID v1.11 Device [Corsair Memory, Inc. Integrated USB Bridge] on usb-0000:02:00.0-12/input0

<... a bunch of invalid characters here...>

Invalid argument
May  3 16:36:06 ubuntu systemd-modules-load[625]: Inserted module 'lp'

由此,我相信这Invalid argument是系统停止响应之前的最后一行......但这似乎并没有说明太多问题(如果有的话)。

ls -al /var/crash显示崩溃目录几乎是空的:

root@ubuntu:~# ls -al /var/crash
total 8
drwxrwxrwt  2 root root 4096 May  3 19:56 .
drwxr-xr-x 15 root root 4096 May  3 03:02 ..

此外,这里还有来自free -hsysctl vm.swappiness和 的更多输出dmidecode -s bios-version

root@ubuntu:~# free -h
              total        used        free      shared  buff/cache   available
Mem:           47Gi       1.4Gi        45Gi       3.0Mi       637Mi        45Gi
Swap:          15Gi          0B        15Gi
root@ubuntu:~# sysctl vm.swappiness
vm.swappiness = 60
root@ubuntu:~# dmidecode -s bios-version
F50a

内存配置:

  *-memory
       description: System Memory
       physical id: 9
       slot: System board or motherboard
       size: 48GiB
     *-bank:0
          description: DIMM DDR4 Synchronous Unbuffered (Unregistered) 2400 MHz (0.4 ns)
          product: KHX2400C15/8G
          vendor: Kingston
          physical id: 0
          serial: AF2C5F46
          slot: DIMM 0
          size: 8GiB
          width: 64 bits
          clock: 2400MHz (0.4ns)
     *-bank:1
          description: DIMM DDR4 Synchronous Unbuffered (Unregistered) 2400 MHz (0.4 ns)
          product: CMK32GX4M2A2400C16
          vendor: Unknown
          physical id: 1
          serial: 00000000
          slot: DIMM 1
          size: 16GiB
          width: 64 bits
          clock: 2400MHz (0.4ns)
     *-bank:2
          description: DIMM DDR4 Synchronous Unbuffered (Unregistered) 2400 MHz (0.4 ns)
          product: KHX2400C15/8G
          vendor: Kingston
          physical id: 2
          serial: BE2A03A9
          slot: DIMM 0
          size: 8GiB
          width: 64 bits
          clock: 2400MHz (0.4ns)
     *-bank:3
          description: DIMM DDR4 Synchronous Unbuffered (Unregistered) 2400 MHz (0.4 ns)
          product: CMK32GX4M2A2400C16
          vendor: Unknown
          physical id: 3
          serial: 00000000
          slot: DIMM 1
          size: 16GiB
          width: 64 bits
          clock: 2400MHz (0.4ns)

系统上运行的另一个重要的东西是运行 Windows 10 的 KVM 客户机,带有带 VFIO 的直通 GPU:

09:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] [10de:1b06] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: ASUSTeK Computer Inc. GP102 [GeForce GTX 1080 Ti] [1043:85e5]
    Flags: fast devsel, IRQ 128
    Memory at f4000000 (32-bit, non-prefetchable) [size=16M]
    Memory at c0000000 (64-bit, prefetchable) [size=256M]
    Memory at d0000000 (64-bit, prefetchable) [size=32M]
    I/O ports at e000 [size=128]
    Expansion ROM at f5000000 [disabled] [size=512K]
    Capabilities: [60] Power Management version 3
    Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [78] Express Legacy Endpoint, MSI 00
    Capabilities: [100] Virtual Channel
    Capabilities: [250] Latency Tolerance Reporting
    Capabilities: [128] Power Budgeting <?>
    Capabilities: [420] Advanced Error Reporting
    Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
    Capabilities: [900] Secondary PCI Express
    Kernel driver in use: vfio-pci
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

09:00.1 Audio device [0403]: NVIDIA Corporation GP102 HDMI Audio Controller [10de:10ef] (rev a1)
    Subsystem: ASUSTeK Computer Inc. GP102 HDMI Audio Controller [1043:85e5]
    Flags: fast devsel, IRQ 129
    Memory at f5080000 (32-bit, non-prefetchable) [size=16K]
    Capabilities: [60] Power Management version 3
    Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [78] Express Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Kernel driver in use: vfio-pci
    Kernel modules: snd_hda_intel

那么是什么原因导致了崩溃?据我所知,这可能与 USB 设备有关,但为什么整个系统会这样锁定?如何解决这个问题?

谢谢!

编辑:从更多阅读来看,可能导致问题的另一个原因可能是 Ryzen C6 状态。我目前正在测试的是将 BIOS 设置更改为Power Supply Idle Controltypical current更改Cool n QuietoffGlobal C state control更改为disabled。这似乎有效,但只有时间才能证明……

修改 2:问题似乎与电源状态无关。不过,我已将问题缩小到 IOMMU 或 KVM/QEMU 的问题。

仅当 IOMMU 开启且我的 Windows VM(带有通过 VFIO 直通的 PCIe 设备)处于活动状态时,才会发生冻结。在 IOMMU 完全关闭的情况下,我已经运行了 48 小时以上,没有发生崩溃。但我需要 VM 正常工作,所以我必须进一步调查。

答案1

超频

如果您对 CPU 或 RAM 进行了超频,请将其重置为正常。

BIOS

你已经是最晚的了,F50a。

锐龙

部分 Ryzen 7 1800X 处理器在 Linux 下运行不佳。已召回。

https://www.extremetech.com/computing/254750-amd-replaces-ryzen-cpus-users-affected-rare-linux-bug

记忆

确保内存以相等匹配的对安装,以便系统可以利用内存交叉。用于sudo lshw -C memory确认配置。确认通道 A/通道 B 配置正确。

https://www.memtest86.com/并下载/运行他们的免费记忆测试来测试你的记忆力。至少完成一次所有 4/4 测试以确认记忆力良好。这可能需要几个小时才能完成。

交换

您的交换空间太大了。我会将其减少到 4G,看看效果如何。

答案2

这听起来很像是内存问题或电压问题。

我注意到您的 RAM 内存来自两个不同的供应商,大小也不同。从内存配置的输出来看,您似乎在内存之间交替使用:

Bank1:金士顿 8GB Bank2:无品牌 16GB Bank3:金士顿 8GB Bank4:无品牌 16GB

您应该将相同大小和相同品牌的存储器保存在相邻的存储器组中。

如果内存交换不起作用,我会检查电源装置。你那里似乎有一台非常强大的机器(实际上它与我的设置几乎相同:48GB RAM,Geforce 1080,但我有一台英特尔 8770k),所以你需要一个可以处理所有这些的电源装置。

如果你查看规格页面GTX 1080Ti您会发现它本身就消耗 250W。如果您使用的是 300W/400W 范围内的电源(考虑到您使用的是优质品牌,较便宜的品牌的标称值为 600w、700w,但实际输出要低得多),则图形板很可能会破坏整个系统的电压,因此应寻找更强大的电源。

相关内容