具有混合显卡(amd / nvidia)和多显示器的 Xorg 配置

具有混合显卡(amd / nvidia)和多显示器的 Xorg 配置

我有一台华硕笔记本电脑,TUF566IV,运行 Kubuntu 23.04。它配备了 RTX 2060 和集成的 AMD gpu。

我最初有一个 HDMI 外接显示器,显示由 iGPU 处理,仅使用 RTX 进行机器学习。

我添加了另一台显示器,插入 USB-C 端口(兼容显示端口),所以现在我使用所有 3 个显示器:2 个外接显示器和笔记本电脑屏幕。

显然,除非 RTX 处理显示,否则我无法让 USB-C 显示器工作,这会导致 GPU 不断使用(根据 nvidia-smi 为 1% 到 25%),风扇不断或多或少发出很大的声音,更烦人的是,kde/plasmashell 频繁崩溃,从而杀死浏览器、pycharm 等多个应用程序。

Xorg 进程也持续占用大约 7% 的 CPU。

作为参考,这是我当前的 xorg.conf(我测试了相当多的变化并且这个有效,即所有 3 个监视器都处于活动状态):

    Identifier     "Device0"
    Driver         "amdgpu"
    VendorName     "amd"
    BusID          "PCI:5:0:0"
    Option         "UseNvKmsCompositionPipeline" "false"
EndSection

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor2"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device1"
    Monitor        "Monitor0"
    Option         "UseNvKmsCompositionPipeline" "false"
    Option         "ForceCompositionPipeline" "1"
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    Option         "UseNvKmsCompositionPipeline" "false"
    Option         "ForceCompositionPipeline" "1"    
EndSection

Section "Screen"
    Identifier     "Screen2"
    Device         "Device1"
    Monitor        "Monitor2"
    Option         "UseNvKmsCompositionPipeline" "false"
    Option         "ForceCompositionPipeline" "1"  
EndSection```

And the nvidia-smi output:
```+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.30.02              Driver Version: 530.30.02    CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                  Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf            Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 2060         Off| 00000000:01:00.0 Off |                  N/A |
| N/A   42C    P5                9W /  90W|    609MiB /  6144MiB |      3%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      1347      G   /usr/lib/xorg/Xorg                          307MiB |
|    0   N/A  N/A      2346      G   /usr/bin/ksmserver                            2MiB |
|    0   N/A  N/A      2348      G   /usr/bin/kded5                                2MiB |
|    0   N/A  N/A      2351      G   /usr/bin/kwin_x11                            75MiB |
|    0   N/A  N/A      2391      G   /usr/bin/plasmashell                         28MiB |
|    0   N/A  N/A      2412      G   ...c/polkit-kde-authentication-agent-1        2MiB |
|    0   N/A  N/A      2461      G   /usr/bin/birdtray                             2MiB |
|    0   N/A  N/A      2471      G   ...86_64-linux-gnu/libexec/kdeconnectd        2MiB |
|    0   N/A  N/A      2485      G   /usr/bin/kaccess                              2MiB |
|    0   N/A  N/A      2490      G   ...-linux-gnu/libexec/DiscoverNotifier       12MiB |
|    0   N/A  N/A      2667      G   /usr/lib/thunderbird/thunderbird             90MiB |
|    0   N/A  N/A      2700      G   ...-gnu/libexec/xdg-desktop-portal-kde        2MiB |
|    0   N/A  N/A      3396      G   ...61807972,1722809804713501230,262144       66MiB |
|    0   N/A  N/A      3587      G   ...bin/plasma-browser-integration-host        2MiB |
|    0   N/A  N/A      3784      G   /usr/bin/konsole                              2MiB |
+---------------------------------------------------------------------------------------+

我认为我不能只使用集成 GPU 来拥有这 3 个显示器,因为 USB-C 输出没有物理连接到它。但是,如果有人能给我一些指点,我想找到一种方法来提高性能并避免这些频繁的崩溃。

相关内容