How can I modify the xorg.conf file to make the X server run on a specific GPU? (I use several GPUs)

I have 2 GPUs running, and I'm trying to get the X server to run on the same GPU. According to this site: http://nvidia.custhelp.com/app/answers/detail/a_id/3029/~/using-cuda-and-x , here is how I should act:

The X display must be forced on to one GPU using the BusID parameter in the corresponding "Display" section of the xorg.conf file. In addition, any other sections of the "Display" should be deleted. For example: BusID "PCI: 34: 0: 0"

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 

So, I tried to change the display of the subkey with the correct BusID, but it still does not work, I also tried to put it in the Device section.

Does anyone know how I can do this?

+4
source share
1 answer

If you have 2 NVIDIA GPUs, get BusID parameters for both. The document you linked explains a couple of ways to do this, but nvidia-smi -a pretty easy.

You will need to figure out which GPU you want to save for display, and which you want to save for CUDA. Again, this should be pretty obvious from nvidia-smi -a

Suppose your nvidia-smi -a includes this section:

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

Then change the device section as follows:

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

Then reboot. Make sure the one you hold for display is the one that comes with the display screen.

You may also be interested in reading the nvidia driver readme and finding additional tips in the "BusID".

The document you linked refers to the Show section, but it should be the Device section.

+5
source

Source: https://habr.com/ru/post/1498391/


All Articles