Programming and Technology

By Robert Roos

I recently stumbled upon a problem with Vulkan on one of my laptops running a NVIDIA Optimus setup, that is two graphics cards running on the same computer where you depending on the workload switch between the integrated one (Intel) and the dedicated one (NVIDIA).

The problem was that after upgrading Ubuntu to the latest kernel (5.3.7 at the time of writing) and the NVIDIA drivers (440 at the time of writing) all Vulkan based games stopped working.

This is quite the problem, since for example Steam Play (Proton) uses Vulkan for most games. Running vulkaninfo in the terminal showed that Vulkan could not be initialized, even though all the files and dependencies were in order.

After some extensive searching i found a very easy fix that seems to solve the problem, although it seems it needs to be done after each time you have switched between the Intel and NVIDIA card through the NVIDIA X Server software.

Simply run sudo vulkaninfo in a terminal instance and the problem is solved. This points to the problem being a rights one, I have not been able to figure out the source of it. But the above workaround at least works for now.

Screen tearing on some systems has been a common problem for users with Ubuntu based distros and running NVIDIA cards, I've never experienced it on any of my laptops (even though NVIDIA Optimus is another problem...), but I seem to be getting it quite frequently on stationary computers, especially with high-res screens.

No need to worry though, the solution is quite simple and as far as I can tell after some testing in games - the response times are next to not affected at all by the fix.

  1. Open the NVIDIA X server settings control panel
  2. Go to X Server Display Configuration
  3. At the bottom, click on the Advanced button
  4. Enable Force Full Composition Pipeline

Screenshot from 2019-10-19 13-45-28.png

Optionally to have the settings stored, save to X Configuration File.

And that should do it, after enabling this the screen tearing i had (very occasionally) in Ubuntu and in (very often) games disappeared. To explain what the 'Force Full Composition Pipeline' does, here is a quote for the NVIDIA forums:

The difference is scaling between ViewPortIn and ViewPortOut. If the display hardware can do the scaling, then the driver will use it even if ForceCompositionPipeline is enabled. However, ForceFullCompositionPipeline will disable the display scaling and use the GPU's shaders to do the scaling instead.

There's no difference if there's no scaling.

There will be somewhat of an impact to power draw and performance, but it's hard to quantify and depends heavily on your scaling configuration.

Good luck and hope it solves any screen tearing issues you may have!