(Optimus) Artifacts and vulkan applications crashing when switching TTY

Hello.

I’ve encountered a problem where some applications such as web browsers and word processors go completely blank when switching to and from a different Virtual Terminal (TTY Switching), sometimes i can get some visuals back if i scroll pages or do anything that updates the application (i guess) but the issue still persists and some sections remain blank.

I usually use the nvidia-xrun utility to create a new X session that runs completely on the nvidia card, and it runs fine but as soon as i want to switch back to another TTY, being to use the Intel Graphics Desktop or just text mode, and i swich back to the X session running Nvidia, graphical glitches and crashes ensues.

Just to make sure it wasn’t a problem with nvidia-xrun in particular i’ve tried using the official PRIME support but regardless of the method i use to actually activate and use the dGPU the same problem persists.

In terms of games, this switching TTY can consistently crash Vulkan games, most OpenGL applications in my testing do not have this issue, although they stay at a black screen for a while before resuming back to where they were left on.

If i leave vkcube running on a session using the Nvidia card in TTY1, for example, and i switch to TTY2 and then back, the vkcube window will be black, and it won’t close unless i run a command to kill it in a terminal, and the system momentarily hangs when trying to kill it, vkcube throws no errors.

Here’s the nvidia-bug-report.log.gz and a small .gif file to show what’s happening more visually.

nvidia-bug-report.log.gz (282.2 KB)


(Whenever the entire screen turns black means i’ve switched to a different TTY)

Laptop is Aspire V3-572G, with NVIDIA GeForce 840M and
Intel Graphics using Optimus technology, running Arch Linux with kernel 5.9.3-arch1-1, although i should note that this issue was also present in Ubuntu, or at least when i tried it back with 16.04.

Issue still persists from my testing despite having recently received some updates to the Nvidia drivers and vulkan packages, Any insights?

Some more updates to the driver and vulkan packages later, but still, no dice.

It’s odd that applications running with OpenGL seem to resume from a TTY switch just fine, albeit sometimes with visual artifacts, it’s just Vulkan it seems.

Can at least confirm this happening, vkcube window black and frozen after tty switch both on Kepler Optimus in render offload and Pascal single gpu.
Didn’t try the 460 beta driver yet, though.

1 Like

Thank you for confirmation, I hope a solution can be found, so far most of the time i get an update to either the nvidia drivers or vulkan packages i give it a shot to see if anything’s different, but no luck so far.

I’m on nvidia 460.32.03 and this issue is still present as far as i’m aware, however i have found some information that may or may not be related to this problem, in an unrelated discussion i’ve been pointed to this part of documentation from KhronosGroup:

https://www.khronos.org/registry/OpenGL/extensions/NV/NV_robustness_video_memory_purge.txt

I know this is talking about OpenGL, but could something of the same situation be related to this problem?

What i mean is could the same concept be happening specifically with Vulkan applications? Resources in video memory being lost between TTY switching and suspend/resume?

In the documentation there is mention of a planned eventual architectural evolution that will allow memory to be persistent, would this solve the issue?

Any thoughts or help would be welcome.

Issue is still present on nvidia 460.56, using kernel 5.11.6.

Unforuntately the issue is still happening on my laptop using Kernel 5.12.10 and Nvidia package 465.31-9, another user has pointed out that these applications apparently seem to crash on vkVaitForFences()

Not sure how much that can help.