Ubuntu 17.10下NVIDIA多显卡多显示器XScreen异常问题求助
Hey there! I’ve tackled similar multi-GPU display setups on Ubuntu before, so let’s get your 6 monitors working as a single unified desktop instead of separate XScreens. The core problem here is that Ubuntu’s default Xorg config is treating each NVIDIA GPU’s outputs as independent screen sessions—we need to merge them into one desktop space.
1. Verify Your NVIDIA Drivers Are Properly Installed
First, make sure you’re using the official NVIDIA proprietary drivers (open-source nouveau won’t cut it for multi-GPU setups). Run this command to check if all 4 GPUs are detected:
nvidia-smi
You should see all 4 GPUs listed with their status. If not, open "Software & Updates" > "Additional Drivers" and select the latest stable NVIDIA driver, then reboot to apply.
2. Generate & Modify the Xorg Configuration File
We’ll create a custom Xorg config to force all screens into a single desktop using Xinerama (the standard way to merge XScreens for NVIDIA multi-GPU setups):
Backup Existing Config (If Any)
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
Generate a Base Config
Run this command to generate a config that enables all your GPUs:
sudo nvidia-xconfig --enable-all-gpus --cool-bits=28
The --cool-bits=28 flag is optional but lets you adjust GPU fan speeds later if needed.
Edit the Config to Merge Screens
Open the generated config with a text editor:
sudo nano /etc/X11/xorg.conf
Update the ServerLayout Section
Find the Section "ServerLayout" block and add the Xinerama option to merge all screens. It should look something like this:
Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen0" Screen 2 "Screen2" RightOf "Screen1" Screen 3 "Screen3" RightOf "Screen2" # Enable Xinerama to unify all screens into one desktop Option "Xinerama" "1" EndSection
Adjust the RightOf directives if your monitor layout isn’t left-to-right—use LeftOf, Above, or Below as needed to match your physical setup.
Add AllowEmptyInitialConfiguration to Each Device Section
For each Section "Device" block (one per GPU), add this line to ensure the driver recognizes all outputs even if they’re not active on boot:
Option "AllowEmptyInitialConfiguration" "True"
Your Device section will look like:
Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "Your GPU Model" BusID "PCI:1:0:0" # This should match your GPU's PCI address Option "AllowEmptyInitialConfiguration" "True" EndSection
3. Reboot & Verify
Save the config (Ctrl+O, then Enter in nano) and reboot your system:
sudo reboot
After rebooting:
- Open "Settings" > "Displays"—you should see all 6 monitors listed with their correct positions.
- Try dragging a window between screens—it should now work seamlessly across all displays.
Troubleshooting Tips
- If Xinerama doesn’t work, some newer NVIDIA drivers prefer using RandR for multi-GPU setups. You can try removing the
Xineramaline and addingOption "BaseMosaic" "True"to each Device section instead. - Double-check your BIOS settings to ensure all GPUs are enabled and multi-monitor output is allowed.
- If you run into Xorg startup errors, revert to the backup config with
sudo cp /etc/X11/xorg.conf.bak /etc/X11/xorg.confand reboot.
内容的提问来源于stack exchange,提问作者narbue

