MBZ*_*MBZ 12 display nvidia xorg gpu xserver
我的机器上有两个 GPU:
$ lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GM200 [GeForce GTX 980 Ti] (rev a1)
03:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 730] (rev a1)
Run Code Online (Sandbox Code Playgroud)
我想使用第一个 gpu 进行计算,所以我需要它免费。但是,默认情况下 X 服务器在第一个服务器上运行,这会消耗 gpu 容量的 %2 到 %10。
如何将X 服务器移动到第二个 gpu?
好的,我想通了。
首先尝试使用以下命令创建 xorg 配置:
sudo nvidia-xconfig
Run Code Online (Sandbox Code Playgroud)
这将在/etc/X11/xorg.conf.
然后将设备部分更改为如下所示:
Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:2:0:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device1"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
Run Code Online (Sandbox Code Playgroud)
重要提示:确保您的显示器连接到第二个 GPU。重新启动,瞧!
我有两个 GPU。以下是我为显示设置 GPU2 所做的操作:
要获取十六进制格式的 PCI,请使用:
lspci | grep VGA
Run Code Online (Sandbox Code Playgroud)
对我来说,它返回:
05:00.0 VGA compatible controller: NVIDIA Corporation Device 1b02 (rev a1)
09:00.0 VGA compatible controller: NVIDIA Corporation GM200 [GeForce GTX TITAN X] (rev a1)
Run Code Online (Sandbox Code Playgroud)
因此,在我的例子中,我希望用于显示的 GPU (GPU2) 的时间是 09:00.0。然后我生成了/etc/X11/xorg.conf使用sudo nvidia-xconfig.
这将在 处创建一个新的 xorg 配置/etc/X11/xorg.conf。
然后我只在文件的以下部分添加了 BusID 行/etc/X11/xorg.conf:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:9:0:0"
EndSection
Run Code Online (Sandbox Code Playgroud)
然后我重新启动计算机并将显示器连接到 GPU2。此后,少数 USB 端口停止工作,但其他端口可以用于键盘和鼠标。