gpt4 book ai didi

cuda - 如何修改 xorg.conf 文件以强制 X 服务器在特定 GPU 上运行? (我使用多个 GPU)

转载 作者:行者123 更新时间:2023-12-02 05:07:31 24 4
gpt4 key购买 nike

我正在运行 2 个 GPU,并且我试图强制 X 服务器在一个 GPU 上运行。根据该网站:http://nvidia.custhelp.com/app/answers/detail/a_id/3029/~/using-cuda-and-x ,这是我应该如何进行:

The X display should be forced onto a single GPU using the BusID parameter in the relevant "Display" section of the xorg.conf file. In addition, any other "Display" sections should be deleted. For example: BusID "PCI:34:0:0"

这是我的 xorg.conf 文件:

# 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修改该小节的显示,但它仍然不起作用,我还尝试将它放在Device部分中。

有人知道我该怎么做吗?

最佳答案

如果您有 2 个 NVIDIA GPU,请获取两个 GPU 的 BusID 参数。您链接的文档解释了几种方法来做到这一点,但是 nvidia-smi -a 非常简单。

您需要弄清楚要保留哪个 GPU 用于显示,以及要保留哪个 GPU 用于 CUDA。同样,这从 nvidia-smi -a

中应该非常明显

假设您的 nvidia-smi -a 包含如下部分:

PCI
Bus : 0x02
Device : 0x00
Domain : 0x0000
Device Id : 0x06D910DE
Bus Id : 0000:02:00.0

然后像这样修改设备部分:

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:2:0:0"
EndSection

然后重新启动。确保您保留用于显示的那台是连接有显示电缆的那台!

您可能还有兴趣阅读nvidia driver readme并搜索“BusID”以获取更多提示。

您链接的文档引用了“显示”部分,但应该是“设备”部分。

关于cuda - 如何修改 xorg.conf 文件以强制 X 服务器在特定 GPU 上运行? (我使用多个 GPU),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18382271/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com