Kubuntu 并非所有外接显示器都在工作

Kubuntu 并非所有外接显示器都在工作

不久前,在更新一些软件包后,KDE 停止运行,我只看到黑屏,但我能够使用 ctrl+alt+f2 进入终端。重新安装 KDE(不是整个操作系统,只是软件包)后,我能够让它再次工作。在此之前,我确实尝试重新安装 amdgpu 驱动程序,但失败了。(我使用的是配备 ryzen cpu(radeon 显卡)+ nvidia rtx 3070 的笔记本电脑)

KDE 功能正常,除了 3 个外部屏幕中的 2 个不再工作(它们之前工作正常)。我只能让内部屏幕和 1 个外部显示器工作。1 个显示器通过 HDMI 连接,另外 2 个显示器使用 usb-c 转显示端口适配器通过显示端口连接。正在工作的屏幕是显示端口屏幕之一。我尝试删除 kscreen 设置并重新启动,但这不起作用。

这是所有显示器都已连接时的 xrandr 输出,我已启用 2 个外接显示器,但只有 1 个在工作。其他(内置和外接显示器)均已禁用。(如果我启用第 3 个外接显示器,则只能看到半个屏幕。)

Screen 0: minimum 320 x 200, current 5119 x 1440, maximum 16384 x 16384
eDP connected primary (normal left inverted right x axis y axis)
   2560x1600    165.00 +  60.00 +
   1920x1200    165.00  
   1920x1080    165.00  
   1600x1200    165.00  
   1680x1050    165.00  
   1280x1024    165.00  
   1440x900     165.00  
   1280x800     165.00  
   1280x720     165.00  
   1024x768     165.00  
   800x600      165.00  
   640x480      165.00  
DisplayPort-0 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     59.95*+
   1920x1440     60.00  
   2560x1080     60.00    59.94    50.00    30.00    29.97    24.00    23.98    25.00  
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080     60.00    50.00    59.94    30.00    25.00    24.00    29.97    23.98  
   1600x1200     59.95  
   1680x1050     59.95  
   1280x1024     75.02    60.02  
   1440x900      59.89  
   1280x800      59.95  
   1152x864      75.00  
   1280x720      60.00    50.00    59.94  
   1440x576      50.00  
   1024x768      75.03    70.07    60.00  
   1440x480      60.00    59.94  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
DisplayPort-2 disconnected (normal left inverted right x axis y axis)
DisplayPort-3 disconnected (normal left inverted right x axis y axis)
DisplayPort-4 disconnected (normal left inverted right x axis y axis)
DisplayPort-5 disconnected (normal left inverted right x axis y axis)
DP-1-7 connected (normal left inverted right x axis y axis)
   2560x1440     59.95 +
   1920x1200     59.88  
   1920x1080     60.00    50.00    59.94    23.98  
   1600x1200     60.00  
   1680x1050     59.95  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1152x864      75.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-1-8 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 connected (normal left inverted right x axis y axis)
   1920x1080     60.00 +  50.00    59.94  
   1600x1200     60.00  
   1680x1050     59.95  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1280x720      50.00    59.94  
   1152x720      60.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       59.94    59.93  
eDP-1-2 disconnected (normal left inverted right x axis y axis)
  2560x1440 (0x67) 241.500MHz +HSync -VSync
        h: width  2560 start 2608 end 2640 total 2720 skew    0 clock  88.79KHz
        v: height 1440 start 1443 end 1448 total 1481           clock  59.95Hz
  1920x1200 (0x72) 193.250MHz -HSync +VSync
        h: width  1920 start 2056 end 2256 total 2592 skew    0 clock  74.56KHz
        v: height 1200 start 1203 end 1209 total 1245           clock  59.88Hz
  1920x1080 (0x74) 148.500MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  56.25KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  50.00Hz
  1680x1050 (0x7c) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1280x1024 (0x7d) 135.000MHz +HSync +VSync
        h: width  1280 start 1296 end 1440 total 1688 skew    0 clock  79.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  75.02Hz
  1280x1024 (0x7e) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1152x864 (0x81) 108.000MHz +HSync +VSync
        h: width  1152 start 1216 end 1344 total 1600 skew    0 clock  67.50KHz
        v: height  864 start  865 end  868 total  900           clock  75.00Hz
  1280x720 (0x82) 74.250MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  45.00KHz
        v: height  720 start  725 end  730 total  750           clock  60.00Hz
  1280x720 (0x83) 74.250MHz +HSync +VSync
        h: width  1280 start 1720 end 1760 total 1980 skew    0 clock  37.50KHz
        v: height  720 start  725 end  730 total  750           clock  50.00Hz
  1024x768 (0x86) 78.750MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock  60.02KHz
        v: height  768 start  769 end  772 total  800           clock  75.03Hz
  1024x768 (0x88) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x8d) 49.500MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock  46.88KHz
        v: height  600 start  601 end  604 total  625           clock  75.00Hz
  800x600 (0x8e) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  720x576 (0x90) 27.000MHz -HSync -VSync
        h: width   720 start  732 end  796 total  864 skew    0 clock  31.25KHz
        v: height  576 start  581 end  586 total  625           clock  50.00Hz
  720x480 (0x92) 27.000MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
  640x480 (0x93) 31.500MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock  37.50KHz
        v: height  480 start  481 end  484 total  500           clock  75.00Hz
  640x480 (0x97) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  1920x1080 (0x73) 148.500MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.50KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  60.00Hz
  1440x900 (0x7f) 106.500MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  55.93KHz
        v: height  900 start  903 end  909 total  934           clock  59.89Hz
  800x600 (0x8f) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz

信息:

hwinfo --gfxcard --short
graphics card:                                                  
                       nVidia GA104M [GeForce RTX 3070 Mobile / Max-Q]
                       ATI VGA compatible controller

Primary display adapter: #18

GPU:

sudo lspci -k | grep -A 2 -i "VGA"
pcilib: Error reading /sys/bus/pci/devices/0000:00:08.3/label: Operation not permitted
01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)
        Subsystem: Lenovo GA104M [GeForce RTX 3070 Mobile / Max-Q]
        Kernel driver in use: nvidia
--
34:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] (rev c8)
        Subsystem: Lenovo Rembrandt [Radeon 680M]
        Kernel driver in use: amdgpu

amdgpu-install 输出:

Hit:1 http://nl.archive.ubuntu.com/ubuntu lunar InRelease
Hit:2 http://packages.microsoft.com/repos/code stable InRelease                                              
Hit:3 http://nl.archive.ubuntu.com/ubuntu lunar-updates InRelease                                            
Hit:4 https://ppa.launchpadcontent.net/cappelikan/ppa/ubuntu lunar InRelease                                 
Hit:5 https://download.docker.com/linux/ubuntu jammy InRelease                                               
Hit:6 http://nl.archive.ubuntu.com/ubuntu lunar-backports InRelease                                          
Hit:7 https://repo.fig.io/apt stable InRelease                                                               
Hit:8 https://packages.microsoft.com/repos/edge stable InRelease                                             
Get:9 https://packages.microsoft.com/repos/ms-teams stable InRelease [5.931 B]                               
Ign:10 https://repo.vivaldi.com/stable/deb stable InRelease                                            
Hit:11 http://security.ubuntu.com/ubuntu lunar-security InRelease   
Hit:12 https://repo.vivaldi.com/stable/deb stable Release
Hit:13 https://repo.radeon.com/amdgpu/5.4.6/ubuntu focal InRelease
Hit:14 https://repo.radeon.com/rocm/apt/5.4.6 focal InRelease
Fetched 5.931 B in 1s (5.671 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-headers-6.2.0-23-generic is already the newest version (6.2.0-23.23).
linux-headers-6.2.0-23-generic set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libegl1-amdgpu-mesa:i386 : Depends: libwayland-amdgpu-client0:i386 but it is not installable
                            Depends: libwayland-amdgpu-server0:i386 but it is not installable
 libgbm1-amdgpu:i386 : Depends: libwayland-amdgpu-server0:i386 but it is not installable
 libwayland-amdgpu-client0 : Depends: libffi7 (>= 3.3~20180313) but it is not installable
 libwayland-amdgpu-server0 : Depends: libffi7 (>= 3.3~20180313) but it is not installable
 xserver-xorg-amdgpu-video-amdgpu : Depends: xorg-video-abi-24 but it is not installable
E: Unable to correct problems, you have held broken packages.



cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  525.116.04  Thu Apr 27 17:56:37 UTC 2023
GCC version:  

我该怎么做才能让所有外接显示器重新工作?

我还尝试查看是否可以使用 GNOME 的软件和更新“附加驱动程序”选项卡切换驱动程序,但它卡在“继续使用手动安装的驱动程序”上,所有其他选项都显示为灰色。

答案1

最后修复了它

sudo ubuntu-drivers autoinstall

我之前犹豫要不要用这个,因为我之前用过,结果黑屏了。但这次似乎可以轻松修复我的 nvidia 驱动程序。:)

此后,外接显示器可以正常工作,但渲染速度仍然很慢(只有当我的鼠标位于该屏幕上时才能正确渲染)。我使用命令修复了这个问题

nvidia-settings

然后在“PRIME Profiles”中切换到 NVIDIA(性能模式)。重启后一切正常。

运行 amdgpu-install 时,它仍然显示 sam 错误(未找到 libffi7,但我似乎找不到如何安装此包)。如果有人能解释为什么会发生这种情况以及如何修复(如果我应该修复它),那就太好了。

相关内容