Xorg

如何將我的輔助 GPU 用於顯示輸出而主 GPU 僅用於計算?

  • March 19, 2021

我有兩個 GPU,GTX 1070 和 GT 710。我只有一個顯示器,我希望這個顯示器可以脫離 GT710,這樣當我使用 CUDA 訓練模型時我可以繼續工作。我已經在這工作了好幾個小時,我能做到的最遠的事情是在顯示器連接到 GT 710 的情況下以“備份模式”啟動到 Mint。

我一直在遵循這裡的說明: https ://forums.developer.nvidia.com/t/how-do-i-set-one-gpu-for-display-and-the-other-two-gpus-for- cuda 計算/49113

我的系統資訊如下

在此處輸入圖像描述

我試過兩種方法

1)第一次嘗試:根據使用者“birdie”上面連結的建議,我在目錄/etc/X11/xorg.conf.d 中創建了文件nvidia.conf,內容如下

   Section "Device"
       Identifier      "GT710"
       BusID           "PCI:5:0:0" # my Bus ID for gt710
       Driver          "nvidia"
       VendorName      "NVIDIA"
   EndSection

然後我去了 /etc/X11/ 中的 xorg.conf 並修改了 screen 的條目如下

Section "Screen"
   Identifier     "Screen0"
   Device         "GT710" #modified here
   Monitor        "Monitor0"
   DefaultDepth    24
   Option         "Stereo" "0"
   Option         "nvidiaXineramaInfoOrder" "DFP-6"
   Option         "metamodes" "2560x1440_75 +0+0"
   Option         "SLI" "Off"
   Option         "MultiGPU" "Off"
   Option         "BaseMosaic" "off"
   SubSection     "Display"
       Depth       24
   EndSubSection
EndSection

通過這樣做,我能夠在我的顯示器連接到 GT710 的情況下以備份模式啟動到 mint。

2)第二次嘗試:我在 /etc/X11/xorg.conf 中創建了第二個設備條目

   Section "Device"
       Identifier     "Device1"
       Driver         "nvidia"
       VendorName     "NVIDIA Corporation"
       BusID           "PCI:5:0:0" 
       BoardName      "GeForce GT 710"
       option          "AllowEmptyInitialConfiguration"                    
   EndSection

然後我在 /etc/X11/xorg.conf 中編輯了 Screen 條目,如下所示:

Section "Screen"
   Identifier     "Screen0"
   Device         "Device1" #edited here
   Monitor        "Monitor0"
   DefaultDepth    24
   Option         "Stereo" "0"
   Option         "nvidiaXineramaInfoOrder" "DFP-6"
   Option         "metamodes" "2560x1440_75 +0+0"
   Option         "SLI" "Off"
   Option         "MultiGPU" "Off"
   Option         "BaseMosaic" "off"
   SubSection     "Display"
       Depth       24
   EndSubSection
EndSection

再次,當連接到 GT710 時,我能夠啟動到 mint,但只能在備份模式下啟動。

我將不勝感激在完成這項工作方面的任何幫助。

謝謝你

我解決了這個問題。解決方案是使用方法 #2 並編輯 /etc/X11/xorg.conf/ 添加第二個 GPU,如上所示。然後在“螢幕”部分下將“MultiGPU”更改為“on”

更多細節可以在這裡看到在這裡輸入連結描述

我將發布我的新 xorg.con,以防將來對任何人有所幫助

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 440.82

Section "ServerLayout"
   Identifier     "Layout0"
   Screen      0  "Screen0" 0 0
   InputDevice    "Keyboard0" "CoreKeyboard"
   InputDevice    "Mouse0" "CorePointer"
   Option         "Xinerama" "0"
EndSection

Section "Files"
   EndSection

Section "Module"
   Load           "dbe"
   Load           "extmod"
   Load           "type1"
   Load           "freetype"
   Load           "glx"
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"
   # HorizSync source: edid, VertRefresh source: edid
   Identifier     "Monitor0"
   VendorName     "Unknown"
   ModelName      "Philips PHL 325E1"
   HorizSync       114.0 - 114.0
   VertRefresh     48.0 - 75.0
   Option         "DPMS"
EndSection

#makes gtx 1070 work on display

Section "Device"
   Identifier     "Device0"
   Driver         "nvidia"
   VendorName     "NVIDIA Corporation"
   BoardName      "GeForce GTX 1070"
EndSection

#added to make GT710 run my Display doesnt work
Section "Device"
   Identifier     "Device1"
   Driver         "nvidia"
   VendorName     "NVIDIA Corporation"
BusID           "PCI:5:0:0"
option          "AllowEmptyInitialConfiguration"                    
EndSection

Section "Screen"
   Identifier     "Screen0"
   Device         "Device1"
   Monitor        "Monitor0"
   DefaultDepth    24
   Option         "Stereo" "0"
   Option         "nvidiaXineramaInfoOrder" "DFP-6"
   Option         "metamodes" "2560x1440_75 +0+0"
   Option         "SLI" "Off"
   Option         "MultiGPU" "on" #"Off" #CHANGE APPLIED HERE
   Option         "BaseMosaic" "off"
   SubSection     "Display"
       Depth       24
   EndSubSection
EndSection

引用自:https://unix.stackexchange.com/questions/640016