如何使用 nvidia-xconfig 与 2 个 GPU 并且其中一个不是 NVidia?

如何使用 nvidia-xconfig 与 2 个 GPU 并且其中一个不是 NVidia?

我有一组运行 Ubuntu 10.04 LTS 的机器,它们配备了两块显卡,一块是 NVidia GeForce GT 240(辅助显卡),一块是 Matrox 显卡(主显卡)。因为它似乎忽略了 Matrox 显卡,所以nvidia-xconfig没有必要BusID在我的/etc/X11/XF86Config文件中添加字段,我需要手动添加。考虑到 BusID 字段在不同机器上有所不同,我很高兴它能nvidia-xconfig自动完成这项工作。

在特定情况下,是否可以强制nvidia-xconfig指定正确的 BusID?请注意,使用该选项--enable-all-gpus不起作用!

答案1

我想到的一个解决方法是使用nvidia-xconfig --query-gpu-info获取 BusID,然后再次将其提供给nvidia-xconfig更新 XF86Config 文件。以下是执行此操作的脚本行:

nvidia-xconfig --connected-monitor="CRT" --busid=`nvidia-xconfig --query-gpu-info | grep BusID | sed 's/PCI BusID : PCI:/PCI:/'`

最后,我的XF86Config文件如下所示:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
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"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection


Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 240"
    BusID          "  PCI:5:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "ConnectedMonitor" "CRT"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

相关内容