Ubuntu – Screen (slowly) goes black after full-screening apps


Whenever I full-screen certain applications, my entire screen will slowly begin to get covered by a black filter from the top down (see this YouTube video).

Upon any attempt at a screen refresh (for example, moving a mouse cursor or a game drawing a new frame) will cause the black bar to start from the top again. Doing this may also cause flickering and discoloration on the screen.

Certain applications (like Firefox and the terminal) will not exhibit this behavior, but others (like Google Chrome, Discord, and various games) will. No applications exhibit this behavior when running on the Nouveau driver.

Going back to a constantly-redrawing application (like the Unity desktop) will cause the black screen to not advance anymore, but it will also cause some slight flickering that will fade with time.

I am not able to take a screenshot or record it. This suggests to me that this is something lower-level than the X server or my display manager.

This error does not seem to occur on a guest session (or I have not been able to reproduce it there yet), suggesting something related to a bad configuration is at play. However, creating a new account will bring this bug with it.

What is going on? Is this just a driver bug? Is this a configuration error that just needs fixing somehow?

Current List Of Things Triedâ„¢ (that didn't work):

  • Reset all Unity configs
  • Delete NVIDIA settings file and regenerate
  • Uninstall/reinstall NVIDIA drivers
  • Using older NVIDIA drivers
  • Using an alternate display manager (xdm)

Disabling hardware acceleration in Chrome does allow it to function without this issue, but this still doesn't solve the underlying problem – it's not always an option to disable hardware acceleration.

If possible, I'd rather avoid resetting a profile or switching back to open-source drivers. These are both last-resorts in my mind and I still won't know why this happened, meaning I can't report a bug or avoid accidentally triggering it on my new profile if I go down that route.

Operating System: Ubuntu 16.04 LTS
Kernel: 4.10.0-36-generic, 4.11.0-14-generic
Graphics Card: Nvidia GTX 1080 (Not Optimus)
GC Driver: NVIDIA 387.12, repro with 384.90 and 381.22

Best Answer

Enable Force Composition Pipeline or Force Full Composition Pipeline on the affected screen from the nvidia-settings app.

Thing to click

Following this, click Apply. The screen may flicker momentarily, but the problem will be resolved immediately afterwards.

Alternatively, if you'd rather not have a true Xorg.conf file (usually a good idea), simply place the following into /usr/share/X11/xorg.conf.d/20-nvidia.conf (create if it does not exist):

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    Option         "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"

Restart your display manager using systemctl restart lightdm.service and it will work perfectly.

Disclaimer: I have no idea how this fixes the issue. It just does.