Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application using Vulkan goes black after switching to another tty and switching back #80

Open
crazyboycjr opened this issue Sep 28, 2018 · 12 comments

Comments

@crazyboycjr
Copy link

crazyboycjr commented Sep 28, 2018

My test shows only programs using Vulkan such as vkcube and cube suffer from this issue. glxgears, openbox-session and other programs that without Vulkan as a dependency do not have this issue.

It happens when I switch to another text console(without X running) from the openbox-session and switch back. The running Vulkan application hangs and go black there, does not print any error information.

Another issue is that if I switch back from the X session running by Intel GPU, the nvidia-xrun will stop and exit anyway. The nvidia-xrun session works fine if I switch back from a non-X tty.

I'm not sure if these two issues are related.

It matters because steam games runs with Proton on linux. Proton was just released by Valve and it can run windows games in steam through DXVK which relies on Vulkan

I am on a XPS 15 9550 laptop with a NVIDIA 960m + Intel GPU. The nvidia driver version is 396.54.

Could anyone give any tips? I can send the logs and any other information if you need.

Thanks!

@crazyboycjr
Copy link
Author

Now without upgrade anything including kernel and nvidia driver, even without any reboot, the second issue of switching back from origin X session to the nvidia-xrun session has gone. However, the vulkan applications still give a blackscreen and freeze there.

After upgrade the driver to 410.57, the problem still there.

Thanks

@crazyboycjr
Copy link
Author

OK. I think the second issue is related to that I'm using an external monitor. When I disable the internal display in openbox-session, the switch issue disappears.

@mattosborn
Copy link

Did you make any progress on the Vulkan issue? I'm seeing that same problem.

@crazyboycjr
Copy link
Author

crazyboycjr commented Nov 4, 2018

If you mean the second issue that switching to another X session and switching back to openbox session cause nvidia-xrun exited. I found that this only happens when my laptop is connecting to a external monitor with join displays. The issue goes away when I use single display(means turn off the laptop's internal display).

No progress on the issue of vulkan applications goes black after switch back from another tty.

@jebbster88
Copy link

I can consistently replicate the same issue.

@connesc
Copy link

connesc commented Jan 15, 2019

Same problem here on XPS 15 9550 with NVIDIA GTX960M and NVIDIA driver version 415.25.

@BobbyWibowo
Copy link

Same here.
I ran mpv from terminal in tty2 + nvidia-xrun, switched to tty1 for a few moments, then went back to tty2, and I was spammed with these error message:

...
AV: 00:00:06 / 00:01:28 (7%) A-V: 0.000004 Vb: 94 kbps Ab: 125 kbps
[vo/vdpau] Error when uploading surface: An invalid handle value was provided.
AV: 00:00:06 / 00:01:28 (7%) A-V: 0.000004 Vb: 94 kbps Ab: 125 kbps
[vo/vdpau] Error when uploading surface: An invalid handle value was provided.
AV: 00:00:06 / 00:01:28 (7%) A-V: 0.000004 Vb: 94 kbps Ab: 125 kbps
[vo/vdpau] Recovered from display preemption.

The last one was after I switched back to tty2.
So, well, I don't know, but from the sound of it, when you switch to tty1 which have a running X server, the one in tty2 will become unavailable due to the display being used by the X server in tty1? Games (or perhaps the DXVK thing itself) likely don't have any countermeasure to such behavior, so it will just continue blacking out even after we go back to tty2.
Anyways, just a mere speculation on my part.

@alex9099
Copy link

So, any solution/workaround for this?

@teggun1
Copy link

teggun1 commented Oct 31, 2020

This problem is still a real pain, it ruins being able to use the desktop with intel and nvidia-xrun with steam comfortably if you plan on using Proton DXVK or even just native games with Vulkan support, i can force Proton to use OpenGL instead and it works fine and i can switch without problems but some games work much better with DXVK and some other games just outright won't work without it.

If you notice very carefully, even OpenGL applications have a momentary black screen when you switch back (at least the ones i tried do) but they are able to recover and pick back up where they left, Vulkan based applications instead crash or sometimes just stay as a black screen.

Trying to figure what is going on, using mangohud vkcube gave me the following errors when switching, not sure if it's related:

$ mangohud vkcube
'data->vtable.AllocateMemory(data->device, &alloc_info, NULL, buffer_memory)' line 1825 failed with VK_ERROR_OUT_OF_DEVICE_MEMORY
'data->vtable.AllocateMemory(data->device, &alloc_info, NULL, buffer_memory)' line 1825 failed with VK_ERROR_OUT_OF_DEVICE_MEMORY

Any new ideas on this?

@alex9099
Copy link

alex9099 commented Nov 1, 2020

Even though it does not solve this specific bug as a workaround i've been using prime-run (proprietary tool from nvidia i guess?), works like a charm on my laptop, either with vulkan or opengl

@teggun1
Copy link

teggun1 commented Nov 3, 2020

prime-run works great if you're planning to use it in the same X server, however, i prefer always running my games in a separate X server if i can help it, so i can switch back to my desktop in case a game doesn't react to well to "Alt-Tabbing" and to avoid headaches of games not setting back to my native resolution (when playing games that run in less than native resolution)

Even if i try to run a vulkan game in a separate X server with prime-run and switch around it still crashes, plus apparently power management with prime-run offloading is experimental and the nvidia card seems to always stays on in my laptop, i like nvidia-xrun more because it can actually turn it off when it's done.

It seems to only happen when using nvidia, if for example i run vkcube in two separate X servers while using the intel card i can switch between them no problem, i don't know if there's any way to fix this in software or if it's a limitation of the way the cards interact with eachother.

@marchellodev
Copy link

marchellodev commented Aug 6, 2021

Facing the exact same issue. Opengl works fine. Guess I'm switching back to prime-run :)

Kernel: Arch 5.13.8-xanmod1-cacule-1


GPU:
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)
00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]


Drivers:
lib32-nvidia-utils 470.57.02-1
lib32-opencl-nvidia 470.57.02-1
nvidia-dkms 470.57.02-3
nvidia-settings 470.57.02-1
nvidia-utils 470.57.02-3
nvidia-xrun-git 0.3.83.g270b6c0-1
opencl-nvidia 470.57.02-3

intel-gmmlib 21.2.1-1
intel-media-driver 21.2.3-1
intel-media-sdk 21.2.3-1
intel-ucode 20210608-1
lib32-vulkan-intel 21.1.6-1
vulkan-intel 21.1.6-1
xf86-video-intel 1:2.99.917+916+g31486f40-1

lib32-vulkan-icd-loader 1.2.184-1
lib32-vulkan-intel 21.1.6-1
vulkan-icd-loader 1.2.185-1
vulkan-intel 21.1.6-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants