问题描述
我正在运行2个GPU,并且试图强制X服务器在一个GPU上运行.根据此网站: http://nvidia.custhelp.com/app/answers/detail/a_id/3029/~/using-cuda-and-x ,这是我应该如何进行的操作:
I'm running 2 GPUs and I'm trying to force X server to run on one GPU.According to this website : http://nvidia.custhelp.com/app/answers/detail/a_id/3029/~/using-cuda-and-x , here is how i should proceed :
这是我的xorg.conf文件:
Here is my xorg.conf file :
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 304.64 (buildmeister@swio-display-x86-rhel47-12) Tue Oct 30 12:04:46 PDT 2012
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
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"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
因此,我尝试使用正确的BusID修改小节显示,但仍然无法正常工作,我也尝试将其放置在设备"部分.
So I tried to modify the subsection display with the correct BusID but it still does not work, I also tried to put it in the section Device.
有人知道我该怎么做吗?
Anyone knows how i could do that ?
推荐答案
如果您有2个NVIDIA GPU,请同时获取两个的BusID参数.您链接的文档介绍了几种方法,但是nvidia-smi -a
非常简单.
If you have 2 NVIDIA GPUs, get the BusID parameters for both. The doc you linked explains a couple ways to do that, but nvidia-smi -a
is pretty easy.
您将需要确定要保留用于显示的GPU,以及要保留用于CUDA的GPU.同样,这在nvidia-smi -a
You will need to figure out which GPU you want to keep for display, and which you want to keep for CUDA. Again, this should be pretty obvious from nvidia-smi -a
让我们假设您的nvidia-smi -a
包含以下部分:
Let's suppose your nvidia-smi -a
includes a section like this:
PCI
Bus : 0x02
Device : 0x00
Domain : 0x0000
Device Id : 0x06D910DE
Bus Id : 0000:02:00.0
然后按如下所示修改设备部分:
Then modify the device section like this:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:2:0:0"
EndSection
然后重新启动.确保要保留的那一根是连接了显示电缆的那一根!
Then reboot.Make sure the one you are keeping for display is the one with the display cable attached!
您可能也有兴趣阅读 nvidia驱动程序自述文件,然后在"BusID"上搜索其他提示.
You may also be interested in reading the nvidia driver readme and search on "BusID" for additional tips.
您链接的文档引用了显示"部分,但是应该是设备"部分.
The document you linked references a "Display" section but that should be the "Device" section.
这篇关于如何修改xorg.conf文件以强制X服务器在特定GPU上运行? (我正在使用多个GPU)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!