Linux 中的多个 GPU - 如何指定哪个 GPU 运行 X windows

kue*_*ues 12 linux cuda x-windows

我一直在带有 GTX 480 的系统上运行 Red Hat Enterprise Linux 6.1。最近我添加了一个 3GB GTX 580,因为我的 CUDA 应用程序需要比 480 上更多的内存。由于盒子里的空间问题,我不得不把580放在离CPU最近的PCI-E总线上,把480移到第二个插槽。

现在,当我运行 RHEL 时,X windows 正在 580 上运行。我想要 480 运行 X windows,以便 580 上有完整的 3GB 可用。我只有一台显示器,它只能在连接到 580 时显示; 如果连接到 480 则没有信号。

我探索了几个选项:

  1. 更改 BIOS - 似乎没有任何方法可以在我的 BIOS 上指定主 GPU

  2. 更改 xorg.conf 文件。我跑了nvidia-xconfig -a。我的xorg.conf文件的尾端附在下面。

我认为我可以删除“屏幕”部分之一并让 Screen0 使用 Device1 但这会阻止 X windows 运行。


Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 580" BusID "PCI:9:0:0" EndSection    
Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 480" BusID "PCI:7:0:0" EndSection
Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 SubSection "Display" Depth 24 EndSubSection EndSection
Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 SubSection "Display" Depth 24 EndSubSection EndSection
Run Code Online (Sandbox Code Playgroud)

以下是 X windows 无法启动时 xorg.0.log 中的精选亮点:

(==) Using config file: "/etc/X11/xorg.conf"
(==) ServerLayout "Layout0"
(**) |-->Screen "Screen0" (0)
(**) |   |-->Monitor "Monitor0"
(**) |   |-->Device "Device1"
...
(--) PCI: (0:7:0:0) 10de:06c0:10de:075f nVidia Corporation GF100 [GeForce GTX 480] rev 163, Mem @ 0xf6000000/33554432, 0xc8000000/134217728, 0xd0000000/67108864, I/O @ 0x0000dc00/128, BIOS @ 0x????????/524288
(--) PCI:*(0:9:0:0) 10de:1080:19da:2203 nVidia Corporation GF110 [Geforce GTX 580] rev 161, Mem @ 0xfa000000/16777216, 0xd8000000/134217728, 0xd6000000/33554432, I/O @ 0x0000ec00/128, BIOS @ 0x????????/524288
...
(II) Module nvidia: vendor="NVIDIA Corporation"
    compiled for 4.0.2, module version = 1.0.0
    Module class: X.Org Video Driver
(II) NVIDIA dlloader X Driver  270.41.19  Mon May 16 23:33:35 PDT 2011
(II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
(II) Primary Device is: PCI 09@00:00:0
...
(**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
(==) NVIDIA(0): RGB weight 888
(==) NVIDIA(0): Default visual is TrueColor
(==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
(II) Sep 15 16:18:27 NVIDIA(0): NVIDIA GPU GeForce GTX 480 (GF100) at PCI:7:0:0 (GPU-0)
(--) Sep 15 16:18:27 NVIDIA(0): Memory: 1572864 kBytes
(--) Sep 15 16:18:27 NVIDIA(0): VideoBIOS: 70.00.21.00.02
(II) Sep 15 16:18:27 NVIDIA(0): Detected PCI Express Link width: 8X
(--) Sep 15 16:18:27 NVIDIA(0): Interlaced video modes are supported on this GPU
(--) Sep 15 16:18:27 NVIDIA(0): Connected display device(s) on GeForce GTX 480 at PCI:7:0:0
(--) Sep 15 16:18:27 NVIDIA(0):     none
(EE) Sep 15 16:18:27 NVIDIA(0): No display devices found for this X screen.
(II) UnloadModule: "nvidia"
(II) UnloadModule: "wfb"
(II) UnloadModule: "fb"
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found
Run Code Online (Sandbox Code Playgroud)

Alw*_*ing 1

如果我正确地读取了您的配置,您似乎在 PCI 9:0:0 处有 Device0 = 您的 580,并且在 7:0:0 处有 Device1 = 您的 480。screen0 是 Monitor0 上 580 (Device0) 的配对,screen1 是 480 和 Monitor1 上的配对。

但另一方面,输出日志认为Layout0是三元组screen0、monitor0和Device1,这不是想要的。难道只是您需要在配置中将 Layout0 定义为三元组 screen1、monitor1、device1 吗?也许是 ServerLayout 节?