The second monitor remains black on Ubuntu 22.04 after installing NVIDIA drivers because the system fails to correctly initialize the display output during boot, often due to missing kernel parameters or incorrect Xorg configuration. The most reliable fix involves adding specific GRUB kernel arguments to force the NVIDIA DRM modeset and ensuring the correct driver is loaded before the display manager starts.
Analyzing the Root Cause
When a second monitor connected to an NVIDIA graphics card stays black, the issue typically stems from how the Linux kernel interacts with the proprietary NVIDIA driver. Unlike open-source drivers, NVIDIA’s proprietary stack requires explicit permission to manage the display hardware at the kernel level. If this permission is not granted early in the boot process, the X server may start without detecting the secondary display, leaving it in a powered-off or unresponsive state. This problem is particularly common on systems with hybrid graphics (Optimus) or when upgrading from older versions of Ubuntu where default configurations were less strict about DRM (Direct Rendering Manager) integration. The Xorg log file usually reveals errors related to "No screens found" or failures to attach outputs to the screen section. While troubleshooting tools likexrandr are essential for manual adjustments, as discussed in our guide on How to Use xrandr Command to Turn On Your Monitor in Linux, they cannot fix a hardware initialization failure that occurs before the desktop environment loads.
Enabling NVIDIA DRM Modeset via GRUB
The primary solution involves enabling the DRM modeset feature in the NVIDIA driver through the GRUB bootloader configuration. This allows the kernel to take control of the display earlier, preventing conflicts between the kernel mode setting and the X server. To apply this fix, you must edit the GRUB configuration file. Open a terminal and run the following command to open the configuration file in a text editor:sudo nano /etc/default/grub
Locate the line starting with GRUB_CMDLINE_LINUX_DEFAULT. It typically looks something like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
You need to add nvidia-drm.modeset=1 inside the quotes. The line should then read:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1"
If your system uses secure boot, you might also need to ensure that the module signing is handled correctly, but for most standard installations, the modeset parameter is sufficient. After saving the file (using Ctrl+O, Enter, and Ctrl+X), you must update GRUB to apply the changes:
sudo update-grub
Once updated, restart your computer. Upon reboot, check if the second monitor is detected. If it is still black, proceed to verify the driver installation.
Verifying Driver Installation and Reinstallation
Even with the correct kernel parameters, a corrupted or incomplete driver installation can cause display issues. Ubuntu 22.04 ships with a newer version of the NVIDIA driver stack, but sometimes the initial package selection during setup fails to include all necessary components. First, verify which driver is currently active by running:nvidia-smi
If this command returns an error or fails to list your GPU, the driver is not properly installed. In such cases, reinstalling the recommended driver through the Software & Updates tool is the safest approach. Navigate to System Settings > Software & Updates > Additional Drivers. Select the recommended proprietary NVIDIA driver (usually labeled as "Using NVIDIA driver metapackage") and apply changes.
For more advanced users who prefer using the command line, you can install the latest stable driver using the ubuntu-drivers utility:
sudo ubuntu-drivers autoinstall
After installation, reboot the system. It is crucial to allow the system enough time to load the desktop environment, as the initial login might be slow as the driver initializes the displays.
Checking Xorg Configuration Files
In rare cases, a customxorg.conf file created by previous attempts to fix display issues may be overriding the automatic detection. If you previously edited files in /etc/X11/xorg.conf.d/, these configurations might be forcing the wrong resolution or disabling the second output.
Check for any existing configuration files:
ls /etc/X11/xorg.conf.d/
If you find files specifically named for NVIDIA or display configuration, try renaming them temporarily (e.g., appending .bak) to see if the system falls back to automatic detection. Note that modern Ubuntu versions often do not require a manual xorg.conf file, relying instead on the driver's built-in capabilities.
Additionally, ensure that the display cables are securely connected and that the monitor is set to the correct input source. While software fixes are primary, physical connection issues can mimic software failures. If you suspect hardware incompatibility, refer to resources on Nvidia RTX 2060 Super 8GB (Inno3D) Crashing Randomly on Arch Linux for insights into hardware-specific quirks, although the OS differs, the underlying GPU behavior principles can be similar.
Alternative Solutions: Wayland vs. X11
Ubuntu 22.04 defaults to the Wayland display server, which has improved NVIDIA support but still encounters edge cases with multi-monitor setups. If the above steps fail, switching to the X11 session might resolve the issue. At the login screen, click your username. Before entering your password, look for a gear icon in the bottom right corner. Select Ubuntu (on Xorg) from the menu. Log in and check if the second monitor activates. X11 has a longer history of stability with proprietary NVIDIA drivers, making it a viable fallback for critical workstations.Frequently Asked Questions
Why does my monitor stay black even after installing drivers?
This usually happens because the NVIDIA DRM modeset is not enabled in the kernel parameters, causing a conflict between the kernel and the X server. You must add nvidia-drm.modeset=1 to your GRUB configuration and update the bootloader to resolve this initialization conflict.
Can I use xrandr to turn on a black monitor if the driver is broken?
No, xrandr operates at the user-space level within the X server. If the driver fails to initialize the hardware at the kernel level, the X server will not detect the monitor, rendering xrandr commands ineffective until the underlying driver issue is fixed.
Does switching to Wayland help with dual monitors on NVIDIA?
Wayland support for NVIDIA has improved significantly in Ubuntu 22.04, but it can still exhibit bugs with certain multi-monitor configurations. If you experience flickering or black screens, switching to the X11 session via the login gear icon is often a more stable solution for professional workflows.
What should I do if nvidia-smi shows no devices?
If nvidia-smi reports no devices, the kernel module is not loading. Ensure that Secure Boot is disabled or that the NVIDIA modules are properly signed. Reinstalling the driver via ubuntu-drivers autoinstall and rebooting usually resolves missing module issues.
Is it safe to delete xorg.conf files manually?
It is generally safe to remove or rename custom xorg.conf files in /etc/X11/xorg.conf.d/ on modern Ubuntu versions, as the system relies on automatic detection. However, always create a backup of the original file before deleting it to ensure you can restore the previous state if needed.